---
title: "Grant workspace permissions to users or teams"
method: POST
path: "/v2/workspaces/{workspaceId}/grants"
tags: ["Workspaces"]
---

# Grant workspace permissions to users or teams

`POST /v2/workspaces/{workspaceId}/grants`

## Request

- Base URL: `https://api.sigmacomputing.com`
- URL: `https://api.sigmacomputing.com/v2/workspaces/{workspaceId}/grants`
- Auth: HTTP bearer

This endpoint allows creating a grant which specifies permissions for one or more users or teams to access a workspace.

### Usage notes
- **Grants**: An array of grant objects. Each object specifies a grantee and the permission level assigned to them.
- Retrieve the **workspaceId** by calling the [/v2/workspaces](https://help.sigmacomputing.com/reference/list-workspaces) endpoint.
- Do not set both **memberId** and **teamId** in the same **grantee** object. Instead, choose one based on the target of the grant.

  - Retrieve the **memberId** by calling the [/v2/members](https://help.sigmacomputing.com/reference/list-members) endpoint.
  - Retrieve the **teamId** by calling the [/v2/teams](https://help.sigmacomputing.com/reference/list-teams) endpoint.

### Usage scenarios
- **Access control setup**: Use this endpoint to set up or modify access controls for a workspace, specifying which users or teams can access and what actions they can perform.

### Best practices
- **Clear permission definitions**: Ensure that the permissions granted are well understood by both the grantor and the grantee to avoid misuse of access rights.

## Path parameters

- `workspaceId` string, required

## Request body

- object
  - `grants` V2WorkspacesWorkspaceIdGrantsPostRequestBodyContentApplicationJsonSchemaGrantsItems[], required
    - `grantee` union, required
      - V2WorkspacesWorkspaceIdGrantsPostRequestBodyContentApplicationJsonSchemaGrantsItemsGrantee0: The UUID of the member receiving the grant
        - `memberId` string, required
      - V2WorkspacesWorkspaceIdGrantsPostRequestBodyContentApplicationJsonSchemaGrantsItemsGrantee1: The UUID of the team receiving the grant
        - `teamId` string, required
    - `permission` 'view' | 'explore' | 'organize' | 'edit', required: Defines the level of access that is granted. Each permission level allows different types of operations.

## Response `200`

The response body.

- WorkspacesCreateWorkspaceGrantResponse200

---

[API](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api.md) - [All operations](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/revisions/fb6036208c49?raw)
