# workspaces

Query

List all workspaces that the current API user has access to.

Available to agents as MCP tool `getWorkspaces` — see [Read tools](/api/v2/docs/mcp/read-tools#get-workspaces).

## Arguments

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `after` | `String` | No | `null` | Cursor for fetching the next page of results. |
| `first` | `Int` | No | `20` | Number of workspaces to return (page size). |

## Returns

A paginated connection of [`Workspace`](/api/v2/docs/types/workspace) nodes. See [Pagination](/api/v2/docs/types/pagination) for the connection shape.

## Examples

### List workspaces

Paginate all workspaces the current API user can access.

```graphql
query WorkspacesDefault($first: Int, $after: String) {
  workspaces(first: $first, after: $after) {
    totalCount
    edges {
      node {
        id
        name
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
```

Variables:

```json
{
  "first": 10
}
```

Response — HTTP 200:

```json
{
  "data": {
    "workspaces": {
      "totalCount": 1,
      "edges": [
        {
          "node": {
            "id": "6ccefa76-e8ba-5ab0-9c60-e48a9e235a4a",
            "name": "Northwind Botanicals"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "Z2lkOi8vYXJjaGl2ZS9Xb3Jrc3BhY2UvOTkwMTAx"
      }
    }
  }
}
```
