# Update workspace assignments

> **POST** `https://api.us.nylas.com/v3/workspaces/{workspace_id}/manual-assign`

Source: https://developer.nylas.com/docs/reference/api/workspaces/manually-assign-workspace/

Manually assigns or removes specified grants to or from a specific workspace. You must specify at
least one grant ID in either `assign_grants` or `remove_grants`. You can include up to 500 grants
per list.

**Authentication:** NYLAS_API_KEY

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `workspace_id` | string | Yes | ID of the workspace to access. |

## Request body

Content-Type: application/json

- `assign_grants` (array) - A list of grant IDs to be assigned to the workspace.
- `remove_grants` (array) - A list of grant IDs to be removed from the workspace.

## Responses

### 200 - Success. Returns updated grant information.

- `request_id` (string) - The request ID.
- `data` (object)
  - `application_id` (string) - The ID of the Nylas application associated with the workspace.
  - `domain` (string) - The top-level domain associated with the workspace.
  - `grants_assigned` (array) - A list of grant IDs assigned to the workspace.
  - `grants_removed` (array) - A list of grant IDs removed from the workspace.
  - `workspace_id` (string) - The ID of the workspace that was updated.

### 401 - Error: Not authenticated

- `request_id` (string) **(required)** - ID of the request
- `error` (object) **(required)** - Error object
  - `type` (string) - Type of error
  - `message` (string) - Informative error message
  - `provider_error` (object) - (OPTIONAL) informative error message from provider's side

### 404 - Error: Not found

- `request_id` (string) **(required)** - ID of the request
- `error` (object) **(required)** - Error object
  - `type` (string) - Type of error
  - `message` (string) - Informative error message
  - `provider_error` (object) - (OPTIONAL) informative error message from provider's side

## Code samples

### cURL

```bash
curl --request POST \
  --url "https://api.us.nylas.com/v3/workspaces/<WORKSPACE_ID>/manual-assign" \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "assign_grants": [
      "10726e7c-89c3-4a1d-9f4a-5f3f37f6f2d9",
      "3b9f5c1a-21d4-46c1-b84f-0e8d1f9eaa42"
    ],
    "remove_grants": [
      "5f1a2c9e-739b-4c66-9a3d-2c88a0c6d123",
      "9c6e4b7d-2e4a-4ef0-a1b8-badf5a76a555"
    ]
  }'
```
