# Check user plugin access

`POST /api/plugins/{pluginId}/subscription/access/check`

Validates if a specific user has access to the 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: [CheckPluginSubscriptionAccessDTO](https://sourcey-gauzy.pages.dev/api-reference/models/checkpluginsubscriptionaccessdto/index.md)

- `pluginId` (required)
  Type: string
  
  Plugin ID to check access for

- `userId` (optional)
  Type: string
  
  User ID to check access for

Responses:

- 200: Access check result

Content type: application/json

Type: object

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

- `hasAccess` (required)
  Type: boolean
  
  Whether the user has access to the plugin

- `accessLevel` (optional)
  Type: string
  
  Access level/scope

- `canAssign` (required)
  Type: boolean
  
  Whether the user can assign this plugin to others

- `requiresSubscription` (required)
  Type: boolean
  
  Whether the plugin requires a subscription

- `canActivate` (required)
  Type: boolean
  
  Whether the user can activate the plugin

- `subscription` (optional)
  Type: object
  
  Subscription details if available

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/plugins/550e8400-e29b-41d4-a716-446655440000/subscription/access/check' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "pluginId": "string",
  "userId": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "pluginId": "string",
  "userId": "string"
}`;

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

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

### Python

```python
import requests

body = '''{
  "pluginId": "string",
  "userId": "string"
}'''

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