---
title: "Get Message IDs for Campaign Audience"
description: "How to call Get Message IDs for Campaign Audience (GET /api/campaign-audiences/{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/reference/get_message_ids_for_campaign_audience"
revision: "2026-10-15"
operationId: "get_message_ids_for_campaign_audience"
aliases: ["get_campaign_audience_relationships_messages"]
method: "GET"
endpoint: "https://a.klaviyo.com/api/campaign-audiences/{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-10-15/openapi/stable/apis/get_message_ids_for_campaign_audience.json"
jsonApi: {"pagination":{"style":"cursor"}}
related: ["https://developers.klaviyo.com/en/reference/campaigns/llms.txt","https://developers.klaviyo.com/en/reference/get_campaign_audience.md","https://developers.klaviyo.com/en/reference/create_campaign_audience.md","https://developers.klaviyo.com/en/reference/update_campaign_audience.md","https://developers.klaviyo.com/en/reference/delete_campaign_audience.md","https://developers.klaviyo.com/en/reference/clone_campaign_audience.md","https://developers.klaviyo.com/en/reference/get_campaign_audiences_for_campaign.md","https://developers.klaviyo.com/en/reference/get_audience_ids_for_campaign.md","https://developers.klaviyo.com/en/reference/get_campaign_for_campaign_audience.md","https://developers.klaviyo.com/en/reference/get_campaign_id_for_campaign_audience.md","https://developers.klaviyo.com/en/reference/get_campaign_messages_for_campaign_audience.md"]
---

# Get Message IDs for Campaign Audience

> This is the Markdown version of https://developers.klaviyo.com/en/reference/get_message_ids_for_campaign_audience

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

Get all campaign messages [relationships](https://developers.klaviyo.com/en/reference.md) for the given campaign audience ID.

- Revision header: `revision: 2026-10-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-10-15/openapi/stable/apis/get_message_ids_for_campaign_audience.json)

## Example request

### curl

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

### CLI

```bash
klaviyo campaigns get-message-ids-for-campaign-audience 925e385b52fb405715f3616c337cc65c
```

Sign in first with `klaviyo auth login`. [Install the Klaviyo CLI](https://developers.klaviyo.com/en/docs/klaviyo_cli.md)

### Python

```python
from klaviyo_api import KlaviyoAPI

klaviyo = KlaviyoAPI("your-private-api-key")

response = klaviyo.Campaigns.get_message_ids_for_campaign_audience("925e385b52fb405715f3616c337cc65c")
```

Install it with `pip install klaviyo-api`. [The Python SDK on GitHub](https://github.com/klaviyo/klaviyo-api-python)

### Node.js

```javascript
import { ApiKeySession, CampaignsApi } from 'klaviyo-api'

const session = new ApiKeySession('your-private-api-key')
const campaignsApi = new CampaignsApi(session)

const response = await campaignsApi.getMessageIdsForCampaignAudience('925e385b52fb405715f3616c337cc65c')
```

Install it with `npm install klaviyo-api`. [The Node.js SDK on GitHub](https://github.com/klaviyo/klaviyo-api-node)

### Ruby

```ruby
require 'klaviyo-api-sdk'

KlaviyoAPI.configure do |config|
  config.api_key['Klaviyo-API-Key'] = 'Klaviyo-API-Key your-private-api-key'
end

response = KlaviyoAPI::Campaigns.get_message_ids_for_campaign_audience('925e385b52fb405715f3616c337cc65c')
```

Install it with `gem install klaviyo-api-sdk`. [The Ruby SDK on GitHub](https://github.com/klaviyo/klaviyo-api-ruby)

### PHP

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');

use KlaviyoAPI\KlaviyoAPI;

$klaviyo = new KlaviyoAPI('your-private-api-key');

$response = $klaviyo->Campaigns->getMessageIdsForCampaignAudience('925e385b52fb405715f3616c337cc65c');
```

Install it with `composer require klaviyo/api`. [The PHP SDK on GitHub](https://github.com/klaviyo/klaviyo-api-php)

## Path parameters

- `id` (string, required): The ID of the audience Example: `925e385b52fb405715f3616c337cc65c`

## Query parameters

- `page[cursor]` (string): For more information please visit [API overview](https://developers.klaviyo.com/en/reference.md)

## Headers

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

## Responses

### 200: Success

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

- `data` (object[], required)
  - `type` (string, required): Allowed values: `campaign-message`
  - `id` (string, required): The ID of the message
- `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"
      }
    }
  ]
}
```
