---
title: "Teams"
description: "The teams endpoints of the HTTP API."
---

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

# Teams

## GET /teams

List the teams with their members.

Only Admins can call this endpoint, and an Admin service-account key can too. Teams are sorted by name; at most 200 exist.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | Every team. | [`TeamList`](/docs/reference/api/schemas/#teamlist) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## POST /teams

Create a team that folders can be shared with by its name.

Only Admins can call this endpoint, and an Admin service-account key can too. A team's name works as a group name in a folder's access list: each member matches a group entry with exactly that name, as if their identity provider sent it. A team never changes a role; roles still come from identity-provider groups only. Names are unique without regard to case, and a name equal to an identity-provider group makes the team's members match that group's entries too.

### Request body

`application/json`, required.

A [`CreateTeamRequest`](/docs/reference/api/schemas/#createteamrequest) object.

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `201` | The team is created with no members. | [`Team`](/docs/reference/api/schemas/#team) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `409` | A team with this name exists (`team_exists`). | [`Error`](/docs/reference/api/schemas/#error) |
| `413` | The request body exceeds the size limit. | [`Error`](/docs/reference/api/schemas/#error) |
| `422` | 200 teams already exist (`too_many_teams`). | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## DELETE /teams/{id}

Delete a team.

Only Admins can call this endpoint, and an Admin service-account key can too. Its members lose what the team's name gave them at their next request; folder entries naming it stay and match no one unless a team or an identity-provider group of that name exists.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (required) | path | `string` (uuid) |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `204` | The team is deleted. |   |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## PUT /teams/{id}/members/{user_id}

Add a person to a team.

Only Admins can call this endpoint, and an Admin service-account key can too. Adding a member twice changes nothing. The person's access follows at their next request.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (required) | path | `string` (uuid) |   |
| `user_id` (required) | path | `string` (uuid) |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The team with its members. | [`Team`](/docs/reference/api/schemas/#team) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

## DELETE /teams/{id}/members/{user_id}

Remove a person from a team.

Only Admins can call this endpoint, and an Admin service-account key can too. Removing someone who is not a member changes nothing. The person loses what the team gave them at their next request.

### Parameters

| Name | In | Type | Description |
| --- | --- | --- | --- |
| `id` (required) | path | `string` (uuid) |   |
| `user_id` (required) | path | `string` (uuid) |   |

### Responses

| Status | Description | Body |
| --- | --- | --- |
| `200` | The team with its members. | [`Team`](/docs/reference/api/schemas/#team) |
| `400` | The request is malformed or fails validation. | [`Error`](/docs/reference/api/schemas/#error) |
| `401` | Authentication is missing or invalid. | [`Error`](/docs/reference/api/schemas/#error) |
| `403` | The caller is not allowed to perform the request; a role that is too low is code `forbidden_role`. | [`Error`](/docs/reference/api/schemas/#error) |
| `404` | The resource does not exist, or the caller cannot see it; the two are never told apart. | [`Error`](/docs/reference/api/schemas/#error) |
| `500` | The server failed to handle the request. | [`Error`](/docs/reference/api/schemas/#error) |

Generated from [`api/openapi.yaml`](https://github.com/slashobserve/slashobserve/blob/c770e5e0/api/openapi.yaml) at `c770e5e0`. [Report a problem](https://github.com/slashobserve/slashobserve/issues/new).
