Endpoints

Teams

GET/api/v1/teams

Teams in the active organization, paginated, name-ordered.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

page?Page

Page number

Range1 <= value
Default1
per_page?Per Page

Items per page

Range1 <= value <= 100
Default20

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/teams"
{  "items": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",      "name": "string",      "slug": "string",      "description": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "total": 0,  "page": 0,  "per_page": 0}
POST/api/v1/teams

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

POST /api/v1/teams body.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/teams" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "slug": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "name": "string",  "slug": "string",  "description": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET/api/v1/teams/{slug}

One team by its slug, within the active organization, with its current membership. No separate list-members endpoint exists — see TeamDetailResponse's docstring.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

slug*Slug

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v1/teams/string"
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "name": "string",  "slug": "string",  "description": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "members": [    {      "team_id": "810007d0-bec5-486c-b5d1-28fcd8a079ba",      "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",      "added_at": "2019-08-24T14:15:22Z"    }  ]}
PATCH/api/v1/teams/{slug}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

slug*Slug

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

PATCH /api/v1/teams/{slug} body.

slug is deliberately absent — it is the URL's own addressing key, and the acceptance criteria for this task do not ask for it to be reassignable. extra="forbid" turns an attempt to send one into a 422 rather than a silently ignored write, matching ServiceAnnotationUpdate's reasoning for its own immutable fields.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/api/v1/teams/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "name": "string",  "slug": "string",  "description": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE/api/v1/teams/{slug}

Deletes the team. Any assignment pointing at it is nulled rather than orphaned — see TeamService._clear_assignments.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

slug*Slug

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/teams/string"
Empty
POST/api/v1/teams/{slug}/members

Adds an existing organization member to the team. This never touches the user's role or organization_members — see app/services/team_service.py's module docstring.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

slug*Slug

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Body for both POST /api/v1/teams/{slug}/members and DELETE /api/v1/teams/{slug}/members — the task's acceptance criteria name the same path for both verbs, so removal identifies the member by body rather than a {user_id} path segment.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/teams/string/members" \  -H "Content-Type: application/json" \  -d '{    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"  }'
{  "team_id": "810007d0-bec5-486c-b5d1-28fcd8a079ba",  "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",  "added_at": "2019-08-24T14:15:22Z"}
DELETE/api/v1/teams/{slug}/members

Removes a member from the team. Removing the last reference to a team a user is in changes nothing about their organization role — there was never anything to revoke.

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

slug*Slug

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Body for both POST /api/v1/teams/{slug}/members and DELETE /api/v1/teams/{slug}/members — the task's acceptance criteria name the same path for both verbs, so removal identifies the member by body rather than a {user_id} path segment.

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/teams/string/members" \  -H "Content-Type: application/json" \  -d '{    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"  }'
Empty