---
title: "Get Message IDs for Campaign"
description: "How to call Get Message IDs for Campaign (GET /api/campaigns/{id}/relationships/campaign-messages) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/v2026-07-15/reference/get_message_ids_for_campaign"
revision: "2026-07-15"
latestUrl: "https://developers.klaviyo.com/en/reference/get_message_ids_for_campaign"
operationId: "get_message_ids_for_campaign"
aliases: ["get_campaign_relationships_campaign_messages","get_campaign_relationships_messages"]
method: "GET"
endpoint: "https://a.klaviyo.com/api/campaigns/{id}/relationships/campaign-messages"
authentication: "privateKey"
scopes: ["campaigns:read"]
rateLimits: {"burst":"10/s","steady":"150/m"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
openApi: "https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/get_message_ids_for_campaign.json"
related: ["https://developers.klaviyo.com/en/v2026-07-15/reference/campaigns/llms.txt","https://developers.klaviyo.com/en/v2026-07-15/reference/get_campaigns.md","https://developers.klaviyo.com/en/v2026-07-15/reference/get_campaign.md","https://developers.klaviyo.com/en/v2026-07-15/reference/create_campaign.md","https://developers.klaviyo.com/en/v2026-07-15/reference/update_campaign.md","https://developers.klaviyo.com/en/v2026-07-15/reference/delete_campaign.md","https://developers.klaviyo.com/en/v2026-07-15/reference/get_campaign_recipient_estimation.md","https://developers.klaviyo.com/en/v2026-07-15/reference/create_campaign_clone.md","https://developers.klaviyo.com/en/v2026-07-15/reference/get_tags_for_campaign.md","https://developers.klaviyo.com/en/v2026-07-15/reference/get_tag_ids_for_campaign.md","https://developers.klaviyo.com/en/v2026-07-15/reference/get_messages_for_campaign.md"]
---

# Get Message IDs for Campaign

> This is the Markdown version of https://developers.klaviyo.com/en/v2026-07-15/reference/get_message_ids_for_campaign

```http
GET https://a.klaviyo.com/api/campaigns/{id}/relationships/campaign-messages
```

Returns the IDs of all messages associated with the given campaign.

- Revision header: `revision: 2026-07-15` (required)
- Scopes: `campaigns:read`
- Rate limits: Burst: `10/s`, Steady: `150/m`
- OpenAPI: [Download this endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-07-15/openapi/stable/apis/get_message_ids_for_campaign.json)

## Example request

```bash
curl --request GET \
     --url 'https://a.klaviyo.com/api/campaigns/id/relationships/campaign-messages' \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-07-15'
```

## Path parameters

- `id` (string, required)

## Headers

- `revision` (string, required): API endpoint revision (format: YYYY-MM-DD[.suffix]) Default: `2026-07-15`

## Responses

### 200: Success

Content type: `application/vnd.api+json`

- `data` (object[], required)
  - `type` (string, required): Allowed values: `campaign-message`
  - `id` (string, required): The message ID
- `links` (object)
  - `self` (string<uri>, required)
  - `prev` (string<uri>)
  - `next` (string<uri>)
- `meta` (object): Response-level metadata
  - `agent_hints` (object): Optional hints emitted by the API for agent callers
    - `next_steps` (string[]): Suggested follow-up actions for agents to take after this response

#### Example response body

```json
{
  "data": [
    {
      "type": "campaign-message",
      "id": "string"
    }
  ],
  "links": {
    "self": "https://www.example.com",
    "prev": "https://www.example.com",
    "next": "https://www.example.com"
  },
  "meta": {
    "agent_hints": {
      "next_steps": [
        "string"
      ]
    }
  }
}
```

### 4XX: Client Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```

### 5XX: Server Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```
