# Get plugin subscription plan analytics

`POST /api/plugin-plans/analytics`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

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

- `planId` (required)
  Type: string
  
  Plan ID

- `dateFrom` (optional)
  Type: string
  
  Date range start (ISO string)

- `dateTo` (optional)
  Type: string
  
  Date range end (ISO string)

- `metrics` (optional)
  Type: array
  
  Metrics to include
  
  Items:
    Type: string

Responses:

- 200: Plugin subscription plan analytics retrieved successfully

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/plugin-plans/analytics' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "planId": "string",
  "dateFrom": "string",
  "dateTo": "string",
  "metrics": [
    "string"
  ]
}'
```

### JavaScript

```javascript
const body = `{
  "planId": "string",
  "dateFrom": "string",
  "dateTo": "string",
  "metrics": [
    "string"
  ]
}`;

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

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

### Python

```python
import requests

body = '''{
  "planId": "string",
  "dateFrom": "string",
  "dateTo": "string",
  "metrics": [
    "string"
  ]
}'''

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