---
title: "Set a workspace-level feature flag"
description: "Turns a feature flag on or off for the whole workspace. SaaS platform owners only. CRM_CORE is reserved and rejected with code RESERVED_FEATURE_FLAG."
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Workspaces

`PUT /api/feature-flag-admin/workspaces/{workspaceId}/flags/{flagName}`

Turns a feature flag on or off for the whole workspace. SaaS platform owners only. CRM_CORE is reserved and rejected with code RESERVED_FEATURE_FLAG.

## Authentication

- `BearerAuth`, http, header `Authorization`, format `JWT`

## Path parameters

- `workspaceId` (`put/api/feature-flag-admin/workspaces/workspaceId/flags/flagName.path.workspaceId`; string, required)
- `flagName` (`put/api/feature-flag-admin/workspaces/workspaceId/flags/flagName.path.flagName`; string, required) — SCREAMING_SNAKE_CASE flag name

## Request body

_Required._

- `enabled` (`put/api/feature-flag-admin/workspaces/workspaceId/flags/flagName.enabled`; boolean, required)

## Example request

```json
{
  "enabled": true
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.channelautomation.com/api/feature-flag-admin/workspaces/<workspaceId>/flags/<flagName>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "enabled": true
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/feature-flag-admin/workspaces/<workspaceId>/flags/<flagName>';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({enabled: true})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/feature-flag-admin/workspaces/<workspaceId>/flags/<flagName>"

payload = { "enabled": True }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Updated flag map

### 400

Invalid or reserved flag name, or invalid body

### 401

Missing or invalid verified user session

### 403

Not a SaaS platform owner

### 500

Server error

### 503

Identity verification unavailable


Source: https://developer.channelautomations.com/api/put-api-feature-flag-admin-workspaces-workspace-id-flags-flag-name/index.md
