---
title: "Create a new agent team with members and rule"
---

> 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 › AgentTeams

`POST /api/agent-teams/workspace/{workspaceId}`

## Authentication

- `ApiKeyAuth`, apiKey, in header, header `X-API-Key`, format `API_KEY`

## Path parameters

- `workspaceId` (`post/api/agent-teams/workspace/workspaceId.path.workspaceId`; string, required)

## Request body

_Required._

- `name` (`post/api/agent-teams/workspace/workspaceId.name`; string, required)
- `description` (`post/api/agent-teams/workspace/workspaceId.description`; string, optional)
- `priority` (`post/api/agent-teams/workspace/workspaceId.priority`; integer, optional)
- `distribution_strategy` (`post/api/agent-teams/workspace/workspaceId.distribution_strategy`; string, optional)
  - one of `"round_robin"`, `"least_busy"`
- `is_enabled` (`post/api/agent-teams/workspace/workspaceId.is_enabled`; boolean, optional)
- `member_ids` (`post/api/agent-teams/workspace/workspaceId.member_ids`; array<string>, optional)
- `conditions` (`post/api/agent-teams/workspace/workspaceId.conditions`; object, optional) — { logic, conditions[] }

## Example request

```json
{
  "name": "string",
  "description": "string",
  "priority": 0,
  "distribution_strategy": "round_robin",
  "is_enabled": true,
  "member_ids": [
    "string"
  ],
  "conditions": {}
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.channelautomation.com/api/agent-teams/workspace/<workspaceId>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <X-API-Key>' \
  --data '
{
  "name": "string",
  "description": "string",
  "priority": 0,
  "distribution_strategy": "round_robin",
  "is_enabled": true,
  "member_ids": [
    "string"
  ],
  "conditions": {}
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/agent-teams/workspace/<workspaceId>';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'X-API-Key': '<X-API-Key>'},
  body: JSON.stringify({
    name: 'string',
    description: 'string',
    priority: 0,
    distribution_strategy: 'round_robin',
    is_enabled: true,
    member_ids: ['string'],
    conditions: {}
  })
};

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/agent-teams/workspace/<workspaceId>"

payload = {
    "name": "string",
    "description": "string",
    "priority": 0,
    "distribution_strategy": "round_robin",
    "is_enabled": True,
    "member_ids": ["string"],
    "conditions": {}
}
headers = {
    "Content-Type": "application/json",
    "X-API-Key": "<X-API-Key>"
}

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

print(response.text)
```

## Responses

### 200

Team created

### 400

Invalid input


Source: https://developer.channelautomations.com/api/post-api-agent-teams-workspace-workspace-id/index.md
