# campaigns

Query

List and paginate campaigns for the current workspace, ordered newest first. Workflow-type rows are excluded to match the in-app CRM listing.

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

## Arguments

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

## Returns

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

## Examples

### List campaigns

Paginate the workspace's campaigns, newest first.

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

Variables:

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

Response — HTTP 200:

```json
{
  "data": {
    "campaigns": {
      "totalCount": 3,
      "edges": [
        {
          "node": {
            "id": "115d4e8e-2e30-5d2b-acb8-78cf3d81eab1",
            "name": "Fall Refresh",
            "createdAt": "2024-12-31T00:00:00Z"
          }
        },
        {
          "node": {
            "id": "5ff72fbc-0217-540f-bf25-a83d049772b8",
            "name": "Summer Gifting",
            "createdAt": "2024-12-30T00:00:00Z"
          }
        },
        {
          "node": {
            "id": "422fac58-557c-5cd4-8986-84ac3db4b133",
            "name": "Spring Launch",
            "createdAt": "2024-12-29T00:00:00Z"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "Z2lkOi8vYXJjaGl2ZS9DYW1wYWlnbi8yMDI0LTEyLTI5VDAwOjAwOjAwLjAwMDAwMFp8NDIyZmFjNTgtNTU3Yy01Y2Q0LTg5ODYtODRhYzNkYjRiMTMz"
      }
    }
  }
}
```
