# Return all workspaces

> **GET** `https://api.us.nylas.com/v3/workspaces`

Source: https://developer.nylas.com/docs/reference/api/workspaces/get-all-workspaces/

Returns all workspaces in your Nylas application. The application queried is determined based on
the API key you use to authorize your request.

**Authentication:** NYLAS_API_KEY

## Responses

### 200 - Success. Returns a list of Workspace objects.

- `request_id` (string) - The request ID.
- `data` (array)
  - `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` (array) - 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.

### 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 GET \
  --url "https://api.us.nylas.com/v3/workspaces" \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --header 'Content-Type: application/json'
```
