# Enabled or disabled features

`POST /api/feature/toggle`

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

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

- `tenant` (optional)
  Type: object

- `tenantId` (optional)
  Type: string

- `featureId` (required)
  Type: string

- `isEnabled` (required)
  Type: boolean

- `organization` (required)
  Type: object
  
  readOnly: true

- `organizationId` (required)
  Type: string
  
  readOnly: true

Responses:

- 201: The record has been successfully created/updated.

- 400: Invalid input, The response body may contain clues as to what went wrong

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/feature/toggle' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "tenant": {},
  "tenantId": "string",
  "featureId": "string",
  "isEnabled": true
}'
```

### JavaScript

```javascript
const body = `{
  "tenant": {},
  "tenantId": "string",
  "featureId": "string",
  "isEnabled": true
}`;

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

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

### Python

```python
import requests

body = '''{
  "tenant": {},
  "tenantId": "string",
  "featureId": "string",
  "isEnabled": true
}'''

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