Nylas Workspaces API

Workspaces group and organize grants in a Nylas application by a common attribute, such as the email address domain (for example, `nylas.com`). ## Assign grants to workspaces Nylas offers two endpoints to manage workspaces and the grants they contain: - [**Automatically Group Grants into Workspaces**](/docs/reference/api/workspaces/autogroup-workspace/): Starts a background job that, based on your filters, processes existing grants in your Nylas application and automatically sorts them to existing workspaces. If necessary, Nylas automatically creates new workspaces. - [**Update Workspace Assignments**](/docs/reference/api/workspaces/manually-assign-workspace/): Manually specify a workspace ID and up to 500 grants to add or remove from that workspace. ## Default workspace A Nylas application can have a _default workspace_, which Nylas creates automatically when the application is created and manages on your behalf. Applications created before default workspaces were introduced might not have one. When you retrieve workspaces, Nylas identifies the default workspace with `"default": true`, and the application object exposes its ID as `default_workspace_id`. When a new grant is created without an explicit `workspace_id`, Nylas first tries to auto-group it into a workspace that has `auto_group` enabled and a `domain` that matches the grant's email address domain. If no domain workspace matches, Nylas assigns the grant to the application's default workspace, if one exists. The default workspace is protected: you can update only its `policy_id` and `rule_ids` values (changes to `name` or `auto_group` return an error), and you can't delete it. A workspace's `domain` can't be changed after creation, on any workspace. ## Policies and rules Workspaces can carry a [policy](/docs/v3/agent-accounts/policies-rules-lists/) (`policy_id`) and [rules](/docs/v3/agent-accounts/policies-rules-lists/#rules) (`rule_ids`). Agent Accounts in a workspace use the policy attached to the workspace for limits and spam settings, and the rules attached to the workspace for mail filtering. ## Workspace limitations - Workspaces are designed to group grants by the top-level domain (TLD) of users' email addresses. Nylas allows you to manually assign grants to any workspace, but that workspace must have `auto_group` set to `false`. - When `auto_group` is set to `false`, Nylas doesn't automatically assign grants to that workspace. You'll need to manually assign grants to the workspace using the [Update Workspace Assignments endpoint](/docs/reference/api/workspaces/manually-assign-workspace/). - When `auto_group` is `true`, Nylas automatically assigns new grants to the workspace. You can move grants to a different workspace by making an [Update Workspace Assignments request](/docs/reference/api/workspaces/manually-assign-workspace/).

Operations 7

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v3/workspaces List all workspaces · Return all workspaces #
Ask an LLM
“What workspaces exist in my Nylas application?”
“Can I see every workspace my API key's app has?”
Tell an agent
List all workspaces in my application.
Show every workspace in this app.
POST /v3/workspaces Create a workspace for a domain · Create a workspace #
Ask an LLM
“How do I create a workspace for my company's email domain?”
“Can I attach a policy and rules to a new workspace?”
Tell an agent
Create a workspace named {name} for domain {domain}.
Create workspace {name} on {domain} with policy {policy_id} attached.
GET /v3/workspaces/{workspace_id} Get one workspace · Return a workspace #
Ask an LLM
“What policy and rules are attached to a particular workspace?”
“Can I look up a workspace by its ID?”
Tell an agent
Show workspace {workspace}.
Get the settings of workspace {workspace}.
PATCH /v3/workspaces/{workspace_id} Update a workspace's name, policy or rules · Update a workspace #
Ask an LLM
“Can I switch the policy attached to an existing workspace?”
“What can I change on the default workspace?”
Tell an agent
Rename workspace {workspace} to {name}.
Attach policy {policy_id} to workspace {workspace}.
DELETE /v3/workspaces/{workspace_id} Delete a workspace · Delete a workspace #
Ask an LLM
“What happens to a workspace's grants when I delete it?”
“Can I delete the default workspace?”
Tell an agent destructive · confirm first
Delete workspace {workspace}.
Remove workspace {workspace} and move its grants out.
POST /v3/workspaces/auto-group Auto-group grants into workspaces · Auto-group grants #
Ask an LLM
“How do I automatically sort grants into workspaces by email domain?”
“Can auto-grouping include invalid grants too?”
Tell an agent
Auto-group grants from domain {specific_domain} into their workspace.
Auto-group every grant created after {after_created_at}.
POST /v3/workspaces/{workspace_id}/manual-assign Assign or remove grants in a workspace · Update workspace assignments #
Ask an LLM
“Can I manually move specific grants into a workspace?”
“How many grants can I assign to a workspace in one request?”
Tell an agent
Assign grants {assign_grants} to workspace {workspace}.
Remove grants {remove_grants} from workspace {workspace}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nylas:nylas-workspaces-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nylas-workspaces-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nylas Workspaces API
  version: v3
  summary: The complete Nylas v3 API — Email, Calendar, Contacts, Notetaker, Scheduling, Administration, and Migration.
  description: The Nylas API is designed using the REST ideology to provide simple and predictable URIs to access and modify objects. Requests support standard HTTP methods like `GET`, `PUT`, `POST`, and `DELETE`, and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise. You can use the Nylas Postman collection to quickly start using the Nylas APIs. For more information, check out the Nylas Postman collection documentation.
  contact:
    url: https://www.nylas.com/
servers:
- url: https://api.us.nylas.com
  description: U.S.
- url: https://api.eu.nylas.com
  description: E.U.
security:
- ACCESS_TOKEN: []
- NYLAS_API_KEY: []
tags:
- name: Workspaces
  description: 'Workspaces group and organize grants in a Nylas application. A workspace can group grants by email domain (for example, `nylas.com`), or it can have no domain and hold whichever grants you assign to it. For how grants are assigned to workspaces, what the default workspace does, and how to move and filter grants, see How workspaces group grants.


    ## Assign grants to workspaces


    Nylas offers two endpoints to manage the grants a workspace contains:


    - **Automatically Group Grants into Workspaces**: Starts a background job that, based on your filters, processes existing grants in your application and automatically sorts them to existing workspaces. If necessary, Nylas automatically creates new workspaces.

    - **Update Workspace Assignments**: Manually specify a workspace ID and up to 500 grants to add or remove from that workspace.


    You can also move a single grant by passing a new `workspace_id` to the Update Grant endpoint.


    ## Default workspace


    An application can have a _default workspace_, which Nylas creates automatically when the application is created and manages on your behalf. Applications created before default workspaces were introduced might not have one. When you retrieve workspaces, Nylas identifies the default workspace with `"default": true`, and the application object exposes its ID as `default_workspace_id`.


    The default workspace is protected: you can update only its `policy_id` and `rule_ids` values (changes to `name` or `auto_group` return an error), and you can''t delete it.


    ## Policies and rules


    Workspaces can carry a policy (`policy_id`) and rules (`rule_ids`). Agent Accounts in a workspace use the policy attached to the workspace for limits and spam settings, and the rules attached to the workspace for mail filtering. These fields have no effect on grants from other providers.


    ## Workspace limitations


    - `domain` is optional. It''s only used for automatic grouping. Domain matching is an exact, case-sensitive comparison, and each domain can belong to only one workspace per application. You can''t add, change, or remove a workspace''s domain after you create it.

    - `auto_group` defaults to `false`. When it''s `false`, Nylas doesn''t automatically assign new grants to the workspace. Add grants to it with the Update Workspace Assignments endpoint or by passing its ID as the `workspace_id` in an Update Grant request.

    - When `auto_group` is `true`, Nylas automatically assigns new grants with a matching email domain to the workspace. You can still assign grants to an `auto_group` workspace manually, and later automatic grouping jobs don''t move grants you placed manually. Automatic grouping needs a domain, so you can''t enable `auto_group` on a workspace without one.

    - Manual assignment doesn''t check email domains. You can assign any grant in the application to any workspace, including grants from other domains and grants without an email address.

    - Removing a grant from a workspace with `remove_grants` clears the grant''s `workspace_id`. You can''t clear it with the Update Grant endpoint. The grant isn''t returned to the default workspace until you assign it somewhere or an automatic grouping job picks it up.'
paths:
  /v3/workspaces:
    get:
      summary: Return all workspaces
      tags:
      - Workspaces
      operationId: get-all-workspaces
      description: 'Returns all workspaces in your Nylas application. The application queried is determined based on

        the API key you use to authorize your request.'
      security:
      - NYLAS_API_KEY: []
      x-code-samples:
      - lang: bash
        label: cURL
        source: "curl --request GET \\\n  --url \"https://api.us.nylas.com/v3/workspaces\" \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer <NYLAS_API_KEY>' \\\n  --header 'Content-Type: application/json'"
      responses:
        '200':
          description: Success. Returns a list of Workspace objects.
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: The request ID.
                    example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/WorkspaceObject'
        '401':
          description: 'Error: Not authenticated'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: 'Error: Not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
    post:
      summary: Create a workspace
      tags:
      - Workspaces
      operationId: create-workspace
      description: 'Creates a workspace. Only `name` is required. Omit `domain` to create a workspace that holds

        only the grants you assign to it. Those grants can have any email domain.'
      security:
      - NYLAS_API_KEY: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                auto_group:
                  type: boolean
                  description: 'When `true`, specifies that newly created grants in the application are automatically

                    assigned to the workspace if their email address'' domain matches the `domain`. Automatic

                    grouping needs a `domain`, so leave this field `false` on a workspace without one.'
                  default: false
                  example: true
                domain:
                  type: string
                  description: 'The email domain associated with the workspace, such as `nylas.com`. Optional. Set it when

                    you want Nylas to group grants by domain automatically. Each domain can belong to only one

                    workspace per application, and Nylas returns a 400 error if the domain is already in use.

                    Domain matching for automatic grouping is exact and case-sensitive, so subdomains don''t

                    match their parent domain. You can''t add, change, or remove the domain after the workspace

                    is created.'
                  example: nylas.com
                name:
                  type: string
                  description: A short, descriptive name for the workspace.
                  example: The Nylas Workspace
                policy_id:
                  type: string
                  description: 'The ID of the [policy](/docs/v3/agent-accounts/policies-rules-lists/) to attach to the

                    workspace.'
                  example: 6dcc5d92-8a55-4ce8-85a8-2f4275f8f0a0
                rule_ids:
                  type: array
                  items:
                    type: string
                  description: 'The IDs of any [rules](/docs/v3/agent-accounts/policies-rules-lists/#rules) to attach to

                    the workspace.'
                  example:
                  - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
      x-code-samples:
      - lang: bash
        label: cURL
        source: "curl --request POST \\\n  --url \"https://api.us.nylas.com/v3/workspaces\" \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer <NYLAS_API_KEY>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"name\": \"The Nylas Workspace\",\n    \"domain\": \"nylas.com\",\n    \"auto_group\": true,\n    \"policy_id\": \"<POLICY_ID>\",\n    \"rule_ids\": [\"<RULE_ID>\"]\n  }'\n"
      responses:
        '200':
          description: Success. Returns new Workspace object.
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: The request ID.
                    example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
                  data:
                    $ref: '#/components/schemas/WorkspaceObject'
        '400':
          description: 'Error: Bad request. For example, the request body was invalid, or a workspace already exists

            for the application and domain.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400'
        '401':
          description: 'Error: Not authenticated'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: 'Error: Not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
  /v3/workspaces/{workspace_id}:
    parameters:
    - name: workspace_id
      in: path
      schema:
        type: string
      required: true
      description: ID of the workspace to access.
      example: 123e4567-e89b-12d3-a456-426614174000
    get:
      summary: Return a workspace
      tags:
      - Workspaces
      operationId: get-workspace
      description: Returns the specified workspace.
      security:
      - NYLAS_API_KEY: []
      x-code-samples:
      - lang: bash
        label: cURL
        source: "curl --request GET \\\n  --url \"https://api.us.nylas.com/v3/workspaces/<WORKSPACE_ID>\" \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer <NYLAS_API_KEY>' \\\n  --header 'Content-Type: application/json'"
      responses:
        '200':
          description: Success. Returns Workspace object.
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: The request ID.
                    example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
                  data:
                    $ref: '#/components/schemas/WorkspaceObject'
        '401':
          description: 'Error: Not authenticated'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: 'Error: Not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
    patch:
      summary: Update a workspace
      tags:
      - Workspaces
      operationId: update-workspace
      description: 'Updates the specified workspace. You can''t add, change, or remove a workspace''s `domain` after

        you create the workspace. You can set `auto_group` to `true` only on a workspace that has a `domain`.


        On the application''s default workspace, you can update only the `policy_id` and `rule_ids` values.'
      security:
      - NYLAS_API_KEY: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                auto_group:
                  type: boolean
                  description: 'When `true`, specifies that newly created grants in the application are automatically

                    assigned to the workspace if their email address'' domain matches the `domain`. Nylas

                    returns a 400 error if you set this to `true` on a workspace without a `domain`.'
                  example: true
                name:
                  type: string
                  description: A short, descriptive name for the workspace.
                  example: The Nylas Workspace
                policy_id:
                  type:
                  - string
                  - 'null'
                  description: '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.'
                  example: 6dcc5d92-8a55-4ce8-85a8-2f4275f8f0a0
                rule_ids:
                  type:
                  - array
                  - 'null'
                  items:
                    type: string
                  description: '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.'
                  example:
                  - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
      x-code-samples:
      - lang: bash
        label: cURL
        source: "curl --request PATCH \\\n  --url \"https://api.us.nylas.com/v3/workspaces/<WORKSPACE_ID>\" \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer <NYLAS_API_KEY>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"policy_id\": \"<POLICY_ID>\",\n    \"rule_ids\": [\"<RULE_ID>\"]\n  }'\n"
      responses:
        '200':
          description: Success. Returns updated Workspace object.
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: The request ID.
                    example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
                  data:
                    $ref: '#/components/schemas/WorkspaceObject'
        '400':
          description: 'Error: Bad request. Common causes:


            - The request tried to change the workspace''s `domain`.

            - The request set `auto_group` to `true` on a workspace without a `domain`.

            - The request changed a value other than `policy_id` or `rule_ids` on the default workspace.

            - The request set a `policy_id` or `rule_ids` value that doesn''t belong to the application.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400'
        '401':
          description: 'Error: Not authenticated'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: 'Error: Not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
    delete:
      summary: Delete a workspace
      tags:
      - Workspaces
      operationId: delete-workspace
      description: 'Deletes the specified workspace. You can''t delete the application''s default workspace. The workspace''s grants keep working and move to the default workspace, or become unassigned if there isn''t one.


        To learn what gets removed and when, see Deleting resources and data.'
      security:
      - NYLAS_API_KEY: []
      x-code-samples:
      - lang: bash
        label: cURL
        source: "curl --request DELETE \\\n  --url \"https://api.us.nylas.com/v3/workspaces/<WORKSPACE_ID>\" \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer <NYLAS_API_KEY>' \\\n  --header 'Content-Type: application/json'"
      responses:
        '200':
          $ref: '#/components/responses/200-delete'
        '400':
          description: 'Error: Bad request. The workspace is the application''s default workspace, which can''t be deleted.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/400'
        '401':
          description: 'Error: Not authenticated'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: 'Error: Not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
  /v3/workspaces/auto-group:
    post:
      summary: Auto-group grants
      tags:
      - Workspaces
      operationId: autogroup-workspace
      description: 'Starts a background job that sorts grants into workspaces by email domain, depending on the

        filters set. The job considers only grants that aren''t in a workspace yet. If you don''t set any

        filters, Nylas considers all unassigned grants in the application.


        If no workspace exists for a grant''s domain, the job creates one with `auto_group` set to `true`

        and a generated name.'
      security:
      - NYLAS_API_KEY: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                after_created_at:
                  type: number
                  description: 'Applies automatic grouping settings to grants created at or after the specified time,

                    in seconds using the Unix timestamp format.'
                  example: 1622548800
                invalid_also:
                  type: boolean
                  description: 'When `true`, applies automatic grouping settings to both invalid and valid grants. When

                    `false`, applies settings to valid grants only.'
                  default: false
                  example: false
                specific_domain:
                  type: string
                  description: Applies automatic grouping settings to grants with the specified email domain only.
                  example: nylas.com
      x-code-samples:
      - lang: bash
        label: cURL
        source: "curl --request POST \\\n  --url \"https://api.us.nylas.com/v3/workspaces/auto-group\" \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer <NYLAS_API_KEY>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"after_created_at\": 1725273600,\n    \"invalid_also\": true,\n    \"specific_domain\": \"nylas.com\"\n  }'"
      responses:
        '200':
          description: Success. Returns a information about automatic grouping job.
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: The request ID.
                    example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
                  data:
                    type: object
                    properties:
                      job_id:
                        type: string
                        description: The ID of the automatic grouping job.
                        example: 52e61713-ab00-4d70-8974-73cf541c5db9
                      message:
                        type: string
                        description: Information about the background automatic grouping job.
                        example: Auto-grouping started successfully under JobID '52e61713-ab00-4d70-8974-73cf541c5db9', please wait for the process to complete. It may take some time.
        '401':
          description: 'Error: Not authenticated'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: 'Error: Not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
  /v3/workspaces/{workspace_id}/manual-assign:
    parameters:
    - name: workspace_id
      in: path
      schema:
        type: string
      required: true
      description: ID of the workspace to access.
      example: 123e4567-e89b-12d3-a456-426614174000
    post:
      summary: Update workspace assignments
      tags:
      - Workspaces
      operationId: manually-assign-workspace
      description: '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.


        Manual assignment doesn''t check email domains. You can assign any grant in the application to any

        workspace, including a workspace without a `domain`. Assigning a

        grant that''s already in another workspace moves it.'
      security:
      - NYLAS_API_KEY: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                assign_grants:
                  type: array
                  items:
                    type: string
                  description: A list of grant IDs to be assigned to the workspace.
                  example:
                  - 123e4567-e89b-12d3-a456-426614174001
                remove_grants:
                  type: array
                  items:
                    type: string
                  description: 'A list of grant IDs to remove from the workspace. Nylas clears each grant''s `workspace_id`.

                    The grant isn''t moved to the application''s default workspace.'
                  example:
                  - 123e4567-e89b-12d3-a456-426614174001
      x-code-samples:
      - lang: bash
        label: cURL
        source: "curl --request POST \\\n  --url \"https://api.us.nylas.com/v3/workspaces/<WORKSPACE_ID>/manual-assign\" \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer <NYLAS_API_KEY>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n    \"assign_grants\": [\n      \"10726e7c-89c3-4a1d-9f4a-5f3f37f6f2d9\",\n      \"3b9f5c1a-21d4-46c1-b84f-0e8d1f9eaa42\"\n    ],\n    \"remove_grants\": [\n      \"5f1a2c9e-739b-4c66-9a3d-2c88a0c6d123\",\n      \"9c6e4b7d-2e4a-4ef0-a1b8-badf5a76a555\"\n    ]\n  }'"
      responses:
        '200':
          description: Success. Returns updated grant information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: The request ID.
                    example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
                  data:
                    type: object
                    properties:
                      application_id:
                        type: string
                        description: The ID of the Nylas application associated with the workspace.
                        example: 123e4567-e89b-12d3-a456-426614174000
                      domain:
                        type: string
                        description: 'The email domain associated with the workspace. This is an empty string if the

                          workspace has no domain.'
                        example: nylas.com
                      grants_assigned:
                        type: array
                        items:
                          type: string
                        description: A list of grant IDs assigned to the workspace.
                        example:
                        - 123e4567-e89b-12d3-a456-426614174001
                        - 123e4567-e89b-12d3-a456-426614174003
                      grants_removed:
                        type: array
                        items:
                          type: string
                        description: A list of grant IDs removed from the workspace.
                        example:
                        - 123e4567-e89b-12d3-a456-426614174002
                      workspace_id:
                        type: string
                        description: The ID of the workspace that was updated.
                        example: 123e4567-e89b-12d3-a456-426614174000
        '401':
          description: 'Error: Not authenticated'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/401'
        '404':
          description: 'Error: Not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/404'
components:
  schemas:
    WorkspaceObject:
      type: object
      properties:
        application_id:
          type: string
          description: The ID of the application the workspace is associated with.
          example: ad410018-d306-43f9-8361-fa5d7b2172e0
        auto_group:
          type: boolean
          description: 'When `true`, specifies that newly created grants in the application are automatically assigned

            to the workspace if their email address'' domain matches the `domain`.'
          example: true
        created_at:
          type: integer
          description: When the workspace was created, in seconds using the Unix timestamp format.
          example: 1756379932
        default:
          type: boolean
          description: '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/).'
          example: false
        domain:
          type:
          - string
          - 'null'
          description: 'The email domain associated with the workspace. This is `null` if the workspace was created

            without a domain.'
          example: nylas.com
        name:
          type: string
          description: The name of the workspace.
          example: The Nylas Workspace
        policy_id:
          type: string
          description: '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.'
          example: 6dcc5d92-8a55-4ce8-85a8-2f4275f8f0a0
        rule_ids:
          type: array
          items:
            type: string
          description: '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.'
          example:
          - 3f2504e0-4f89-41d3-9a0c-0305e82c3301
        updated_at:
          type: integer
          description: 'When the workspace was last updated, in seconds using the Unix timestamp format. Initially, this

            value is the same as `created_at`.'
          example: 1756379932
        workspace_id:
          type: string
          description: The workspace ID.
          example: abf6ff99-05ad-4c0a-aaf8-400aacf2470a
    '401':
      type: object
      required:
      - request_id
      - error
      additionalProperties: false
      properties:
        request_id:
          description: ID of the request
          type: string
          example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
        error:
          description: Error object
          type: object
          properties:
            type:
              type: string
              description: Type of error
              example: invalid_request_error
            message:
              description: Informative error message
              default: Authentication error
              type: string
              example: Authentication error
            provider_error:
              description: (OPTIONAL) informative error message from provider's side
              type: object
              example:
                error: invalid_grant
                provider_error: Bad Request
    '400':
      type: object
      required:
      - request_id
      - error
      additionalProperties: false
      properties:
        request_id:
          description: ID of the request
          type: string
          example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
        error:
          description: Error object
          type: object
          properties:
            type:
              type: string
              description: Type of error
              example: bad_request
            message:
              description: Informative error message
              default: Bad request
              type: string
              example: Bad request
            provider_error:
              description: (OPTIONAL) informative error message from provider's side
              type: object
              example:
                error: invalid_grant
                provider_error: Bad Request
    '404':
      type: object
      required:
      - request_id
      - error
      additionalProperties: false
      properties:
        request_id:
          description: ID of the request
          type: string
          example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
        error:
          description: Error object
          type: object
          properties:
            type:
              type: string
              description: Type of error
              example: xyz.not_found_error
            message:
              description: Informative error message
              default: Resource not found
              type: string
              example: Resource not found
            provider_error:
              description: (OPTIONAL) informative error message from provider's side
              type: object
              example:
                error: invalid_grant
                provider_error: Bad Request
  responses:
    200-delete:
      description: Delete Succeeded
      content:
        application/json:
          schema:
            type: object
            required:
            - request_id
            properties:
              request_id:
                type: string
                description: ID of the request.
                example: 5967ca40-a2d8-4ee0-a0e0-6f18ace39a90
  securitySchemes:
    IAM_API_KEY:
      type: http
      scheme: bearer
      bearerFormat: IAM API key
      description: An active, unexpired IAM credential of type `api_key` whose principal is active, has an Organization resource binding, and has the required IAM management permission. Use an existing IAM credential with these permissions, or [create your first management credential in the Dashboard](/docs/v3/auth/nylas-iam/manage-principals-with-api/#create-a-management-credential-in-the-dashboard). Application API keys (including legacy API keys) and provider OAuth tokens cannot authorize IAM management endpoints.
    ACCESS_TOKEN:
      scheme: bearer
      type: http
      bearerFormat: NYLAS_ACCESS_TOKEN
      description: 'The Nylas **access token** for a specific grant. Issued as part of OAuth 2.1 flow token

        exchange.'
    NYLAS_API_KEY:
      scheme: bearer
      type: http
      bearerFormat: NYLAS_API_KEY
      description: 'The Nylas **API key** provides application-level access to APIs and all grants. You can

        generate these from the Dashboard. Learn more about [authorizing requests](/docs/v3/auth/).'
    SCHEDULER_SESSION_TOKEN:
      scheme: bearer
      type: http
      bearerFormat: Session ID
      description: The Nylas Scheduler **session ID** that Scheduler UI Components use to authorize API requests.
x-provenance:
  method: harvested
  publisher: Nylas
  source: https://developer.nylas.com/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)