> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swisstools.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Teams API Reference

> List and retrieve the teams your account belongs to, including personal and shared teams with their slugs and reference IDs.

Teams are the top-level organizational unit in Swisstools. Every account has at least one team — a personal team provisioned automatically on signup. You can also belong to additional shared teams. All projects, mocks, webhooks, and feature flags are owned by a team through a project.

All team endpoints require a valid session cookie. See [Authentication](/api-reference/authentication) for details.

## List Teams

`GET /api/teams`

Returns all teams that the authenticated user belongs to.

**Request**

```bash theme={null}
curl https://swisstools.dev/api/teams \
  -b cookies.txt
```

**Response**

```json theme={null}
[
  {
    "id": "018e4f2a-1c3d-7b8e-9f0a-2b3c4d5e6f7a",
    "referenceId": "aB3cD4eF",
    "name": "Acme Corp",
    "slug": "acme-corp",
    "isPersonal": false,
    "createdAt": "2024-01-15T09:00:00.000Z",
    "updatedAt": "2024-01-15T09:00:00.000Z"
  },
  {
    "id": "018e4f2a-2d4e-8c9f-a0b1-3c4d5e6f7a8b",
    "referenceId": "xY7zA1bC",
    "name": "Jane Doe",
    "slug": "jane-doe",
    "isPersonal": true,
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z"
  }
]
```

## Get Team

`GET /api/teams/:teamId`

Returns a single team by its ID.

**Path Parameters**

<ParamField path="teamId" type="string" required>
  The UUID of the team.
</ParamField>

**Request**

```bash theme={null}
curl https://swisstools.dev/api/teams/018e4f2a-1c3d-7b8e-9f0a-2b3c4d5e6f7a \
  -b cookies.txt
```

**Response**

```json theme={null}
{
  "id": "018e4f2a-1c3d-7b8e-9f0a-2b3c4d5e6f7a",
  "referenceId": "aB3cD4eF",
  "name": "Acme Corp",
  "slug": "acme-corp",
  "isPersonal": false,
  "createdAt": "2024-01-15T09:00:00.000Z",
  "updatedAt": "2024-01-15T09:00:00.000Z"
}
```

## Team Object

<ResponseField name="id" type="string">
  UUID that uniquely identifies the team. Use this in all API paths that accept `:teamId`.
</ResponseField>

<ResponseField name="referenceId" type="string">
  An 8-character alphanumeric identifier used as the subdomain prefix for mock and webhook URLs (e.g., `aB3cD4eF-my-project.swisstools.dev`).
</ResponseField>

<ResponseField name="name" type="string">
  The display name of the team.
</ResponseField>

<ResponseField name="slug" type="string">
  A URL-friendly version of the team name. Unique across all teams.
</ResponseField>

<ResponseField name="isPersonal" type="boolean">
  `true` if this is the auto-created personal team for the user's account. Personal teams cannot be deleted.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when the team was created.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp of the last update.
</ResponseField>
