> For the complete documentation index, see [llms.txt](https://docs.discloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.discloud.com/en/api-and-integrations/api-overview/team.md).

# Team

## List teams

> Lists the user's teams (owned and where the user is a member).

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Management","description":"Operations about team management"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams":{"get":{"tags":["Team Management"],"summary":"List teams","description":"Lists the user's teams (owned and where the user is a member).","operationId":"listTeams","responses":{"200":{"description":"Teams listed successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Apps accessible via teams

> Lists the apps accessible by the user through the teams they belong to.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Management","description":"Operations about team management"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/apps":{"get":{"tags":["Team Management"],"summary":"Apps accessible via teams","description":"Lists the apps accessible by the user through the teams they belong to.","operationId":"listTeamsApps","responses":{"200":{"description":"Accessible apps listed successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Role permissions

> Returns the permissions associated with a role (admin, developer or viewer).

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Management","description":"Operations about team management"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/roles/{role}/permissions":{"get":{"tags":["Team Management"],"summary":"Role permissions","description":"Returns the permissions associated with a role (admin, developer or viewer).","operationId":"teamRolePermissions","parameters":[{"name":"role","in":"path","required":true,"description":"Role (admin, developer or viewer)","schema":{"type":"string"}}],"responses":{"200":{"description":"Role permissions","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid role","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Team details

> Returns the details of a team, including members and projects.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Management","description":"Operations about team management"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/{teamID}":{"get":{"tags":["Team Management"],"summary":"Team details","description":"Returns the details of a team, including members and projects.","operationId":"getTeam","parameters":[{"name":"teamID","in":"path","required":true,"description":"Team ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Team details","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to view the team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Delete team

> Removes a team. Owner only.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Management","description":"Operations about team management"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/{teamID}":{"delete":{"tags":["Team Management"],"summary":"Delete team","description":"Removes a team. Owner only.","operationId":"deleteTeam","parameters":[{"name":"teamID","in":"path","required":true,"description":"Team ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Team deleted successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not the team owner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Update team

> Updates the name and/or description of a team. Owner only.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Management","description":"Operations about team management"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/{teamID}":{"patch":{"tags":["Team Management"],"summary":"Update team","description":"Updates the name and/or description of a team. Owner only.","operationId":"updateTeam","parameters":[{"name":"teamID","in":"path","required":true,"description":"Team ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}}}}}},"responses":{"200":{"description":"Team updated successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Not the team owner","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## List members

> Lists the members of a team.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Member","description":"Operations about team members"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/{teamID}/members":{"get":{"tags":["Team Member"],"summary":"List members","description":"Lists the members of a team.","operationId":"listTeamMembers","parameters":[{"name":"teamID","in":"path","required":true,"description":"Team ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Members listed successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to view the members","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Add member

> Adds a member to the team with a specific role.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Member","description":"Operations about team members"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/{teamID}/members":{"post":{"tags":["Team Member"],"summary":"Add member","description":"Adds a member to the team with a specific role.","operationId":"addTeamMember","parameters":[{"name":"teamID","in":"path","required":true,"description":"Team ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userID","role"],"properties":{"userID":{"type":"string"},"role":{"type":"string","description":"admin, developer or viewer"}}}}}},"responses":{"201":{"description":"Member added successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to manage members","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Team or user not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Remove member

> Removes a member from the team.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Member","description":"Operations about team members"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/{teamID}/members/{memberUserID}":{"delete":{"tags":["Team Member"],"summary":"Remove member","description":"Removes a member from the team.","operationId":"removeTeamMember","parameters":[{"name":"teamID","in":"path","required":true,"description":"Team ID","schema":{"type":"string"}},{"name":"memberUserID","in":"path","required":true,"description":"Member user ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Member removed successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to manage members","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Team or member not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Update member role

> Updates the role of a team member.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Member","description":"Operations about team members"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/{teamID}/members/{memberUserID}":{"patch":{"tags":["Team Member"],"summary":"Update member role","description":"Updates the role of a team member.","operationId":"updateTeamMember","parameters":[{"name":"teamID","in":"path","required":true,"description":"Team ID","schema":{"type":"string"}},{"name":"memberUserID","in":"path","required":true,"description":"Member user ID","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["role"],"properties":{"role":{"type":"string","description":"admin, developer or viewer"}}}}}},"responses":{"200":{"description":"Role updated successfully","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No permission to manage members","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Team or member not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Leave team

> Removes the current user from the team. The owner cannot leave.

```json
{"openapi":"3.0.3","info":{"title":"Discloud API","version":"2.0.0"},"tags":[{"name":"Team Member","description":"Operations about team members"}],"servers":[{"url":"https://api.discloud.app/v2","description":"API Server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"api-token"}},"schemas":{"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/teams/{teamID}/leave":{"post":{"tags":["Team Member"],"summary":"Leave team","description":"Removes the current user from the team. The owner cannot leave.","operationId":"leaveTeam","parameters":[{"name":"teamID","in":"path","required":true,"description":"Team ID","schema":{"type":"string"}}],"responses":{"200":{"description":"Left the team successfully","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The owner cannot leave the team","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Team not found or not a member","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
