# Team

## Retrieves teams for a company scope.

> Resolves effective company access and returns teams available to the caller.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Team"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Team/Get":{"get":{"tags":["Team"],"summary":"Retrieves teams for a company scope.","description":"Resolves effective company access and returns teams available to the caller.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"companyId","in":"query","schema":{"type":"string","format":"uuid","default":null}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Retrieves teams for a company scope.

> Resolves effective company access and returns teams available to the caller.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Team"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Team/Get/{teamId}":{"get":{"tags":["Team"],"summary":"Retrieves teams for a company scope.","description":"Resolves effective company access and returns teams available to the caller.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"teamId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Creates a new team.

> Creates a team within the specified company after license and access checks.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Team"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"CreateTeamViewModel":{"required":["teamName"],"type":"object","properties":{"teamName":{"type":"string","description":"Name of the team to create."},"teamDescription":{"type":"string","description":"Optional description of the team purpose.","nullable":true},"azureGroupId":{"type":"string","description":"Optional Azure group identifier for directory synchronization.","nullable":true}},"description":"Represents the payload for creating a team."}}},"paths":{"/v1/Team/Create/{companyId}":{"post":{"tags":["Team"],"summary":"Creates a new team.","description":"Creates a team within the specified company after license and access checks.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"companyId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTeamViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/CreateTeamViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/CreateTeamViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Updates an existing team.

> Applies partial team metadata updates after access validation.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Team"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"UpdateTeamsViewModel":{"type":"object","properties":{"teamName":{"type":"string","description":"Updated team name.","nullable":true},"teamDescription":{"type":"string","description":"Updated team description.","nullable":true},"azureGroupId":{"type":"string","description":"Updated Azure group identifier.","nullable":true}},"description":"Represents optional fields for updating a team."}}},"paths":{"/v1/Team/Update/{teamId}":{"patch":{"tags":["Team"],"summary":"Updates an existing team.","description":"Applies partial team metadata updates after access validation.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"teamId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamsViewModel"}},"text/json":{"schema":{"$ref":"#/components/schemas/UpdateTeamsViewModel"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/UpdateTeamsViewModel"}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Deletes a team.

> Removes the selected team after validating company-level access.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Team"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Team/Delete/{teamId}":{"delete":{"tags":["Team"],"summary":"Deletes a team.","description":"Removes the selected team after validating company-level access.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"teamId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Adds a member to a team.

> Adds the specified app user to the selected team after access checks.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Team"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Team/AddMember/{teamId}/{AppUserId}":{"get":{"tags":["Team"],"summary":"Adds a member to a team.","description":"Adds the specified app user to the selected team after access checks.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"teamId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"AppUserId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Removes a member from a team.

> Removes the specified app user from the selected team if membership exists.\
> \
> Required roles: Admin, Moderator.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Team"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Team/RemoveMember/{teamId}/{AppUserId}":{"get":{"tags":["Team"],"summary":"Removes a member from a team.","description":"Removes the specified app user from the selected team if membership exists.\n\nRequired roles: Admin, Moderator.","parameters":[{"name":"teamId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"AppUserId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.safegpt.nl/api-nl/endpoints/team.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
