---
title: "Create a workspace"
method: POST
path: "/v3/workspaces"
tags: ["Workspaces"]
---

# Create a workspace

`POST /v3/workspaces`

Creates a workspace.

## 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`.
  - `domain` string, required — The top-level domain associated with the workspace. You can't change the domain after the workspace is created.
  - `name` string, required — A short, descriptive name for the workspace.
  - `policy_id` string — The ID of the [policy](/docs/v3/agent-accounts/policies-rules-lists/) to attach to the workspace.
  - `rule_ids` string[] — The IDs of any [rules](/docs/v3/agent-accounts/policies-rules-lists/#rules) to attach to the workspace.

## Response `200`

Success. Returns new 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 body was invalid, or a workspace already exists for the application and domain.
- `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)
