Teams
/api/v1/teamsTeams in the active organization, paginated, name-ordered.
Authorization
HTTPBearer In: header
Query Parameters
Page number
1 <= value1Items per page
1 <= value <= 10020Response 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}/api/v1/teamsAuthorization
HTTPBearer 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"}/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 In: header
Path Parameters
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" } ]}/api/v1/teams/{slug}Authorization
HTTPBearer In: header
Path Parameters
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"}/api/v1/teams/{slug}Deletes the team. Any assignment pointing at it is nulled rather
than orphaned — see TeamService._clear_assignments.
Authorization
HTTPBearer In: header
Path Parameters
Response Body
application/json
curl -X DELETE "https://example.com/api/v1/teams/string"/api/v1/teams/{slug}/membersAdds 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 In: header
Path Parameters
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"}/api/v1/teams/{slug}/membersRemoves 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 In: header
Path Parameters
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" }'