# Assign users to a plugin

`POST /api/plugins/{pluginId}/users`

Assign one or more users to a specific plugin.

Authentication: no security requirement declared for this operation.

Parameters:

- `pluginId` (path, string, uuid, required) - Plugin ID
  Type: string, uuid

Request body: application/json (required)

Type: object

Schema: [AssignPluginUsersDTO](https://sourcey-gauzy.pages.dev/api-reference/models/assignpluginusersdto/index.md)

- `userIds` (required)
  Type: array
  
  Array of user IDs to assign to the plugin
  
  Items:
    Type: string

- `reason` (optional)
  Type: string
  
  Optional reason for the assignment

Responses:

- 201: Successfully assigned users to plugin

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/plugins/550e8400-e29b-41d4-a716-446655440000/users' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "userIds": [
    "string"
  ],
  "reason": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "userIds": [
    "string"
  ],
  "reason": "string"
}`;

const response = await fetch('http://localhost:3000/api/plugins/550e8400-e29b-41d4-a716-446655440000/users', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "userIds": [
    "string"
  ],
  "reason": "string"
}'''

response = requests.post(
    'http://localhost:3000/api/plugins/550e8400-e29b-41d4-a716-446655440000/users',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
