# Create team

> Source: https://elaichi.ai/docs/api-reference/teams/team/createteam/

`POST /team`

Resource: **Team** · API: **Teams**

## Request body

- **`name`** _(string)_
- **`description`** _(string,null)_
- **`member_ids`** _(array<string>)_
  User ids (`usr_…`) of existing organization members to add alongside the caller. Optional.

## Response body

- **`id`** _(string)_
  Team id (`team_…`).
- **`name`** _(string)_
  Unique within the organization.
- **`description`** _(string,null)_
- **`member_count`** _(integer)_
  How many people are in the team, counted server-side with one aggregate. This row carries no roster array to measure — `GET /team/{id}/member` is the roster.
- **`admin_count`** _(integer)_
  How many of them administer the team, counted the same way.
- **`admin_preview`** _(array<object>)_
  The first few administrators, with display names already resolved, so a client can name them without a lookup per row. At most 5 — a preview for a hover, never the set; `admin_count` is the size. `name` and `email` are both null for someone who has left the organization.
  - **`user_id`** _(string)_
  - **`name`** _(string,null)_
  - **`email`** _(string,null)_
  - **`avatar_url`** _(string,null)_
    The person's picture — the same one the console's user menu draws: their stored profile picture, else a Gravatar URL (`d=404`, 96px) derived server-side from their email (the address itself is not sent), else null. Draw initials when it is null or the image fails to load.
  - **`is_admin`** _(boolean)_
    Always true here.
- **`member_preview`** _(array<object>)_
  The same, for the first few members (administrators included, flagged by `is_admin`). `member_count` is the size; `GET /team/{id}/member` is the full, paginated roster.
  - **`user_id`** _(string)_
  - **`name`** _(string,null)_
  - **`email`** _(string,null)_
  - **`avatar_url`** _(string,null)_
    The person's picture — the same one the console's user menu draws: their stored profile picture, else a Gravatar URL (`d=404`, 96px) derived server-side from their email (the address itself is not sent), else null. Draw initials when it is null or the image fails to load.
  - **`is_admin`** _(boolean)_
- **`created_at`** _(string)_
- **`updated_at`** _(string)_

## Code examples

### curl

```bash
curl -X POST 'https://api.elaichi.ai/team' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"name":"your_name","member_ids":[]}'
```

### JavaScript

```javascript
const body = {
  "name": "your_name",
  "member_ids": []
};

const response = await fetch('https://api.elaichi.ai/team', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import os
import requests

url = "https://api.elaichi.ai/team"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "name": "your_name",
    "member_ids": []
}

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