---
title: "Update a workspace"
method: PATCH
path: "/v3/workspaces/{workspace_id}"
tags: ["Workspaces"]
---

# Update a workspace

`PATCH /v3/workspaces/{workspace_id}`

Updates the specified workspace. You cannot change a workspace's `domain` after it's created.

On the application's default workspace, you can update only the `policy_id` and `rule_ids` values.

## Request body

- object
  - `auto_group` boolean — When `true`, specifies that newly created grants in the application are automatically assigned to the workspace if their email address' domain matches the `domain`.
  - `name` string — A short, descriptive name for the workspace.
  - `policy_id` string, nullable — The ID of the [policy](/docs/v3/agent-accounts/policies-rules-lists/) to attach to the workspace. Set a policy ID to attach the policy, set `null` to detach the current policy, or omit the field to keep the current value. The policy must belong to your application.
  - `rule_ids` string[], nullable — The IDs of any [rules](/docs/v3/agent-accounts/policies-rules-lists/#rules) to attach to the workspace. Set an array to replace the current rules, set `null` or an empty array to detach all rules, or omit the field to keep the current value. Each rule must belong to your application.

## Response `200`

Success. Returns updated Workspace object.

- object
  - `request_id` string — The request ID.
  - `data` WorkspaceObject
    - `application_id` string — The ID of the application the workspace is associated with.
    - `auto_group` boolean — When `true`, specifies that newly created grants in the application are automatically assigned to the workspace if their email address' domain matches the `domain`.
    - `created_at` integer — When the workspace was created, in seconds using the Unix timestamp format.
    - `default` boolean — When `true`, the workspace is the application's default workspace, which Nylas creates and manages. Nylas includes this field when you retrieve workspaces. For more information, see the [Workspaces overview](/docs/reference/api/workspaces/).
    - `domain` string — The top-level domain associated with the workspace.
    - `name` string — The name of the workspace.
    - `policy_id` string — The ID of the [policy](/docs/v3/agent-accounts/policies-rules-lists/) attached to the workspace. The policy applies to Agent Accounts in the workspace.
    - `rule_ids` string[] — The IDs of any [rules](/docs/v3/agent-accounts/policies-rules-lists/#rules) attached to the workspace. The rules apply to Agent Accounts in the workspace.
    - `updated_at` integer — When the workspace was last updated, in seconds using the Unix timestamp format. Initially, this value is the same as `created_at`.
    - `workspace_id` string — The workspace ID.

## Other responses

- `400` — Error: Bad request. For example, the request tried to change the workspace's `domain`, modify a value other than `policy_id` or `rule_ids` on the application's default workspace, or set a `policy_id` or `rule_ids` value that doesn't belong to the application.
- `401` — Error: Not authenticated
- `404` — Error: Not found

---

[API](https://skmtc.dev/nylas/apis/nylas-api.md) · [All operations](https://skmtc.dev/nylas/apis/nylas-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nylas/nylas-api/revisions/51c2c1b4ecff/schema)
