Teams
Team management and collaboration
Teams
Team management and collaboration
List teams
GET /api/v1/teamsReturns all teams the current user is a member of
Operation ID: listTeams · Authentication: Authorization: Bearer <token>
Responses
| Status | Description | Body |
|---|---|---|
200 | List of teams | object |
401 | Authentication required | Error |
Response body (200)
| Field | Type | Description |
|---|---|---|
teams | object[] |
Example
curl -X GET "https://api.keyenv.dev/api/v1/teams" \
-H "Authorization: Bearer $KEYENV_TOKEN"Create team
POST /api/v1/teamsCreates a new team with the current user as owner
Operation ID: createTeam · Authentication: Authorization: Bearer <token>
Request body
application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes |
Responses
| Status | Description | Body |
|---|---|---|
201 | Team created | Team |
400 | Invalid request | Error |
401 | Authentication required | Error |
Response body (201)
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
name | string | |
slug | string | |
plan | enum (free, team, enterprise) | |
is_personal | boolean | |
created_at | string (date-time) |
Example
curl -X POST "https://api.keyenv.dev/api/v1/teams" \
-H "Authorization: Bearer $KEYENV_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"string"}'Get team
GET /api/v1/teams/{teamId}Returns team details including members
Operation ID: getTeam · Authentication: Authorization: Bearer <token>
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
teamId | string (uuid) | yes | Team UUID |
Responses
| Status | Description | Body |
|---|---|---|
200 | Team details | object |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
404 | Resource not found | Error |
Example
curl -X GET "https://api.keyenv.dev/api/v1/teams/{teamId}" \
-H "Authorization: Bearer $KEYENV_TOKEN"Invite team member
POST /api/v1/teams/{teamId}/membersInvites a user to join the team by email
Operation ID: inviteTeamMember · Authentication: Authorization: Bearer <token>
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
teamId | string (uuid) | yes | Team UUID |
Request body
application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
email | string (email) | yes | |
role | enum (admin, developer, viewer) | yes |
Responses
| Status | Description | Body |
|---|---|---|
201 | Member invited | TeamMember |
400 | Invalid request | Error |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
Response body (201)
| Field | Type | Description |
|---|---|---|
user_id | string (uuid) | |
email | string (email) | |
name | string | |
avatar_url | string (uri) | |
role | enum (owner, admin, developer, viewer) | |
joined_at | string (date-time) |
Example
curl -X POST "https://api.keyenv.dev/api/v1/teams/{teamId}/members" \
-H "Authorization: Bearer $KEYENV_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email":"string","role":"admin"}'Update member role
PATCH /api/v1/teams/{teamId}/members/{userId}Updates a team member's role
Operation ID: updateMemberRole · Authentication: Authorization: Bearer <token>
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
teamId | string (uuid) | yes | Team UUID |
userId | string (uuid) | yes | User UUID |
Request body
application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
role | enum (admin, developer, viewer) | yes |
Responses
| Status | Description | Body |
|---|---|---|
200 | Role updated | TeamMember |
400 | Invalid request | Error |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
Response body (200)
| Field | Type | Description |
|---|---|---|
user_id | string (uuid) | |
email | string (email) | |
name | string | |
avatar_url | string (uri) | |
role | enum (owner, admin, developer, viewer) | |
joined_at | string (date-time) |
Example
curl -X PATCH "https://api.keyenv.dev/api/v1/teams/{teamId}/members/{userId}" \
-H "Authorization: Bearer $KEYENV_TOKEN" \
-H "Content-Type: application/json" \
-d '{"role":"admin"}'Remove team member
DELETE /api/v1/teams/{teamId}/members/{userId}Removes a member from the team
Operation ID: removeTeamMember · Authentication: Authorization: Bearer <token>
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
teamId | string (uuid) | yes | Team UUID |
userId | string (uuid) | yes | User UUID |
Responses
| Status | Description | Body |
|---|---|---|
204 | Member removed | |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
404 | Resource not found | Error |
Example
curl -X DELETE "https://api.keyenv.dev/api/v1/teams/{teamId}/members/{userId}" \
-H "Authorization: Bearer $KEYENV_TOKEN"