# Groups

## Add Users To Group

> Create a new group.

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/groups/{group_id}/users":{"post":{"tags":["groups"],"summary":"Add Users To Group","description":"Create a new group.","operationId":"add_users_to_group_groups__group_id__users_post","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Group Id"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_add_users_to_group_groups__group_id__users_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupDTO"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_add_users_to_group_groups__group_id__users_post":{"properties":{"emails":{"items":{"type":"string","format":"email"},"type":"array","title":"The users to add to the group"},"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","required":["emails"],"title":"Body_add_users_to_group_groups__group_id__users_post"},"GroupDTO":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the group"},"id":{"type":"string","format":"uuid","title":"Id"}},"type":"object","required":["name","id"],"title":"GroupDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Remove Users From Group

> Remove users from a group.

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/groups/{group_id}/users":{"delete":{"tags":["groups"],"summary":"Remove Users From Group","description":"Remove users from a group.","operationId":"remove_users_from_group_groups__group_id__users_delete","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Group Id"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_remove_users_from_group_groups__group_id__users_delete"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupDTO"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_remove_users_from_group_groups__group_id__users_delete":{"properties":{"user_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"The users to add to the group"},"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","required":["user_ids"],"title":"Body_remove_users_from_group_groups__group_id__users_delete"},"GroupDTO":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the group"},"id":{"type":"string","format":"uuid","title":"Id"}},"type":"object","required":["name","id"],"title":"GroupDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Read Groups

> f\
> Retrieve a list of groups.

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/groups":{"get":{"tags":["groups"],"summary":"Read Groups","description":"f\nRetrieve a list of groups.","operationId":"read_groups_groups_get","parameters":[{"name":"workspace_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"The workspace id"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_read_groups_groups_get"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupFullDTO"},"title":"Response Read Groups Groups Get"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_read_groups_groups_get":{"properties":{"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_read_groups_groups_get"},"GroupFullDTO":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the group"},"id":{"type":"string","format":"uuid","title":"Id"},"group_type":{"type":"string","title":"Group Type"},"user_count":{"type":"integer","title":"User Count"}},"type":"object","required":["name","id","group_type","user_count"],"title":"GroupFullDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Create New Group

> Create a new group.

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/groups":{"post":{"tags":["groups"],"summary":"Create New Group","description":"Create a new group.","operationId":"create_new_group_groups_post","parameters":[{"name":"workspace_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"The workspace id"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_create_new_group_groups_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupDTO"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_create_new_group_groups_post":{"properties":{"name":{"type":"string","title":"The name of the group"},"emails":{"items":{"type":"string","format":"email"},"type":"array","title":"The users to add to the group"},"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","required":["name","emails"],"title":"Body_create_new_group_groups_post"},"GroupDTO":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the group"},"id":{"type":"string","format":"uuid","title":"Id"}},"type":"object","required":["name","id"],"title":"GroupDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Read Group

> Get a specific group by ID.

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/groups/{group_id}":{"get":{"tags":["groups"],"summary":"Read Group","description":"Get a specific group by ID.","operationId":"read_group_groups__group_id__get","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Group Id"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_read_group_groups__group_id__get"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupWithUsersDTO"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_read_group_groups__group_id__get":{"properties":{"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_read_group_groups__group_id__get"},"GroupWithUsersDTO":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the group"},"id":{"type":"string","format":"uuid","title":"Id"},"group_type":{"type":"string","title":"Group Type"},"user_count":{"type":"integer","title":"User Count"},"users":{"items":{"$ref":"#/components/schemas/UserDTO"},"type":"array","title":"Users"}},"type":"object","required":["name","id","group_type","user_count","users"],"title":"GroupWithUsersDTO"},"UserDTO":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"avatar_url":{"type":"string","title":"Avatar Url"},"user_type":{"$ref":"#/components/schemas/UserType"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"joined":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Joined"}},"type":"object","required":["id","name","email","avatar_url","user_type","external_id"],"title":"UserDTO"},"UserType":{"type":"string","enum":["regular","group"],"title":"UserType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Update Existing Group

> Update a group's name.

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/groups/{group_id}":{"put":{"tags":["groups"],"summary":"Update Existing Group","description":"Update a group's name.","operationId":"update_existing_group_groups__group_id__put","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Group Id"}},{"name":"workspace_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"The workspace id"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_update_existing_group_groups__group_id__put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupDTO"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_update_existing_group_groups__group_id__put":{"properties":{"name":{"type":"string","title":"The name of the group"},"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","required":["name"],"title":"Body_update_existing_group_groups__group_id__put"},"GroupDTO":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name of the group"},"id":{"type":"string","format":"uuid","title":"Id"}},"type":"object","required":["name","id"],"title":"GroupDTO"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```

## Delete Existing Group

> Delete a group by ID.

```json
{"openapi":"3.1.0","info":{"title":"shade","version":"dev"},"paths":{"/groups/{group_id}":{"delete":{"tags":["groups"],"summary":"Delete Existing Group","description":"Delete a group by ID.","operationId":"delete_existing_group_groups__group_id__delete","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Group Id"}},{"name":"password","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"The password","description":"The password header to use to fetch the preview"},"description":"The password header to use to fetch the preview"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_delete_existing_group_groups__group_id__delete"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_delete_existing_group_groups__group_id__delete":{"properties":{"body":{"additionalProperties":true,"type":"object","title":"Body","default":{}}},"type":"object","title":"Body_delete_existing_group_groups__group_id__delete"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
```


---

# 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://academy.shade.inc/developers/groups.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.
