> ## Documentation Index
> Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspace access API: Share Workspaces with Teams

> Read and replace who a workspace is shared with using the OneCLI API. Add people with a management role, or share with whole groups at once.

Workspace access controls which people and groups can use a workspace. Each person carries a management role, and groups grant access to all of their members.

Use these endpoints to sync access from your identity system or a script. Both are management actions. For automated user and group sync, see [User provisioning](https://onecli.sh/docs/guides/user-provisioning.md).

## Related guides

* [User provisioning: sync people and groups](https://onecli.sh/docs/guides/user-provisioning.md)
* [Projects: organize agents into workspaces](https://onecli.sh/docs/guides/projects.md)

## Endpoints

| Endpoint | Method and path | What it does |
| - | - | - |
| [List who a workspace is shared with](https://onecli.sh/docs/api-reference/workspace-access/list-who-a-workspace-is-shared-with.md) | `GET /workspaces/{workspaceId}/access` | List the people and groups a workspace is shared with, including each person's management role. |
| [Replace who a workspace is shared with](https://onecli.sh/docs/api-reference/workspace-access/replace-who-a-workspace-is-shared-with.md) | `PUT /workspaces/{workspaceId}/access` | Replace the full set of people and groups a workspace is shared with. |

## Next steps

* [API overview](https://onecli.sh/docs/api-reference.md): base URLs, authentication, and pagination
* [Errors](https://onecli.sh/docs/api-reference/errors.md): status codes and the error format
* [Editions](https://onecli.sh/docs/api-reference/editions.md): which endpoints each edition serves


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.