<!-- llms.txt: https://workos.com/llms.txt -->

# Team

A team is the WorkOS account that owns a user's environments and billing. A platform creates one team per user, and the user named as admin receives an email invitation to it.

:::code-group{title="Example Team"}

```json language="curl"
{
  "object": "team",
  "id": "team_01K4BN3VKH8AFZC5J334QZY3PM",
  "name": "Alice's Team",
  "production_state": "Inactive",
  "production_enabled_at": null,
  "created_at": "2026-01-15T07:41:09.394Z",
  "updated_at": "2026-01-15T07:41:09.394Z"
}
```

:::

## Endpoints

- [Create a team](https://workos.com/docs/reference/platform/team/create)
- [Get a team](https://workos.com/docs/reference/platform/team/get)

## Create a team

Creates a team along with its default project, a staging environment, and a production environment. An admin invitation is sent to `admin_email`, onboarding is marked complete with AuthKit enabled, and the calling platform is authorized to act inside the team.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request POST \
  --url "https://api.workos.com/platform/teams" \
  --header "Authorization: Bearer $PLATFORM_ACCESS_TOKEN" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "admin_email": "alice@example.com",
        "name": "Alice's Team"
    }
BODY
```

```json language="json" title="Response" tab="2"
{
  "object": "team",
  "id": "team_01K4BN3VKH8AFZC5J334QZY3PM",
  "name": "Alice's Team",
  "production_state": "Inactive",
  "production_enabled_at": null,
  "created_at": "2026-01-15T07:41:09.394Z",
  "updated_at": "2026-01-15T07:41:09.394Z"
}
```

:::

### Error responses

- **409** (`user_already_exists`): a WorkOS user already exists with that email address. Ask for a different address, or move the user through a flow that connects their existing team.

## Get a team

Returns a team, and doubles as a health check on the platform's access to it. Read `production_state` before attempting to create a production environment.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request GET \
  --url "https://api.workos.com/platform/teams/team_01K4BN3VKH8AFZC5J334QZY3PM" \
  --header "Authorization: Bearer $PLATFORM_ACCESS_TOKEN"
```

```json language="json" title="Response" tab="2"
{
  "object": "team",
  "id": "team_01K4BN3VKH8AFZC5J334QZY3PM",
  "name": "Alice's Team",
  "production_state": "Inactive",
  "production_enabled_at": null,
  "created_at": "2026-01-15T07:41:09.394Z",
  "updated_at": "2026-01-15T07:41:09.394Z"
}
```

:::

### Error responses

- **404** (`team_not_found`): the team doesn't exist, or the platform's access to it has been revoked. Both are terminal.

### team

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | "team" | Yes | The object type. |
| `id` | string | Yes | Unique identifier of the team. |
| `name` | string | Yes | The name of the team. |
| `production_state` | "Active" \| "Inactive" \| "Suspended" \| "Deleting" | Yes | Whether the team can host production environments. `Active` means billing is set up. `Inactive` means a team admin must add a payment method in the WorkOS Dashboard. `Suspended` and `Deleting` mean the team can't be provisioned into. |
| `production_enabled_at` | string | Yes | The timestamp when production was enabled for the team, or `null` if it never has been. |
| `created_at` | string | Yes | The timestamp when the team was created. |
| `updated_at` | string | Yes | The timestamp when the team was last updated. |

### POST /platform/teams

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `admin_email` | string | Yes | The email address of the person who will administer the team. An invitation is sent to this address. |
| `name` | string | Yes | The name of the team. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `team` | object | The created team. |

### GET /platform/teams/:team_id

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `team_id` | string | Yes | The ID of the team. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `team` | object | The team. |