# Manage Plugin Tenant Users

`POST /api/plugin-tenants/{id}/users`

Add or remove users from allowed/denied lists for a plugin tenant

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, string, required) - Plugin Tenant ID
  Type: string

Request body: application/json (required)

Type: object

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

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

- `operation` (required)
  Type: string
  
  Operation to perform: allow, deny, remove-allowed, remove-denied
  
  enum: ["allow","deny","remove-allowed","remove-denied","unassign"]

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

Responses:

- 200: User management operation completed successfully

Content type: application/json

Type: object

- 400: Invalid input data

- 404: Plugin tenant or users not found

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/plugin-tenants/string/users' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "userIds": [
    "string"
  ],
  "operation": "allow",
  "reason": "string"
}'
```

### JavaScript

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

const response = await fetch('http://localhost:3000/api/plugin-tenants/string/users', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

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

### Python

```python
import requests

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

response = requests.post(
    'http://localhost:3000/api/plugin-tenants/string/users',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
