{ "openapi": "3.0.2", "info": { "title": "Klaviyo API", "version": "2026-10-15", "description": "The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.", "contact": { "name": "Klaviyo Developer Experience Team", "email": "developers@klaviyo.com", "url": "https://developers.klaviyo.com" }, "termsOfService": "https://www.klaviyo.com/legal/api-terms", "license": { "name": "License", "url": "https://www.klaviyo.com/legal" } }, "servers": [ { "url": "https://a.klaviyo.com", "description": "Production" } ], "security": [ { "Klaviyo-API-Key": [] } ], "paths": { "/api/campaigns/{id}/campaign-messages": { "get": { "operationId": "get_messages_for_campaign", "summary": "Get Messages for Campaign", "description": "Get all messages for the given campaign.

*Rate limits*:
Burst: `10/s`
Steady: `150/m`\n\n**Scopes:**\n`campaigns:read`\n\n[OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_messages_for_campaign.json)", "parameters": [ { "name": "id", "in": "path", "description": "The campaign ID", "required": true, "schema": { "description": "The campaign ID", "type": "string" } }, { "name": "fields[campaign-message]", "in": "query", "description": "For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#sparse-fieldsets", "required": false, "schema": { "type": "array", "items": { "type": "string", "enum": [ "created", "definition", "definition.ab_test", "definition.ab_test.winner_metric", "definition.ab_test.winner_percentage", "definition.ab_test.winner_wait_hours", "definition.name", "definition.send_options", "definition.send_options.is_ignoring_unsubscribes", "definition.send_options.recipient_percentage", "definition.send_options.send_strategy", "definition.send_options.send_time", "definition.send_options.send_times", "definition.send_options.throttle_unit", "definition.send_options.throttling_type", "definition.status", "definition.tracking_options", "definition.tracking_options.is_add_utm", "definition.tracking_options.is_tracking_clicks", "definition.tracking_options.is_tracking_opens", "definition.tracking_options.tracking_params", "id", "updated" ] } }, "explode": false }, { "name": "fields[campaign]", "in": "query", "description": "For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#sparse-fieldsets", "required": false, "schema": { "type": "array", "items": { "type": "string", "enum": [ "created_at", "definition", "definition.archived", "definition.builder", "definition.color", "definition.description", "definition.name", "definition.send_settings", "definition.send_settings.exit_condition_conversion_metric_id", "definition.send_settings.exit_condition_enabled", "definition.send_settings.send_passed_rltz_immediately", "definition.send_settings.send_strategy", "definition.send_settings.send_timezone", "id", "updated_at" ] } }, "explode": false }, { "name": "include", "in": "query", "description": "For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#relationships", "schema": { "type": "array", "items": { "type": "string", "enum": [ "campaign" ] } }, "explode": false }, { "name": "page[cursor]", "in": "query", "description": "For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#pagination", "required": false, "schema": { "type": "string" } }, { "name": "revision", "in": "header", "description": "API endpoint revision (format: YYYY-MM-DD[.suffix])", "required": true, "schema": { "type": "string", "default": "2026-10-15" } } ], "responses": { "200": { "description": "Success", "content": { "application/vnd.api+json": { "schema": { "$ref": "#/components/schemas/GetMessageResponseCollectionCompoundDocument" } } } }, "4XX": { "$ref": "#/components/responses/ClientError" }, "5XX": { "$ref": "#/components/responses/ServerError" } }, "tags": [ "Campaigns" ], "x-klaviyo-operation-aliases": [ "get_campaign_campaign_messages" ], "x-klaviyo-pre-release": "None", "x-klaviyo-ratelimit": { "burst": "10/s", "steady": "150/m" }, "x-klaviyo-scopes": [ "campaigns:read" ], "x-klaviyo-subtag": "Messages" } } }, "components": { "responses": { "ClientError": { "description": "Client Error", "content": { "application/vnd.api+json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "id", "code", "title", "detail" ], "properties": { "id": { "type": "string" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object", "properties": { "pointer": { "type": "string" }, "parameter": { "type": "string" } } } } } } }, "required": [ "errors" ] } } } }, "ServerError": { "description": "Server Error", "content": { "application/vnd.api+json": { "schema": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "required": [ "id", "code", "title", "detail" ], "properties": { "id": { "type": "string" }, "code": { "type": "string" }, "title": { "type": "string" }, "detail": { "type": "string" }, "source": { "type": "object", "properties": { "pointer": { "type": "string" }, "parameter": { "type": "string" } } } } } } }, "required": [ "errors" ] } } } } }, "schemas": { "ABTestSettings": { "type": "object", "properties": { "winner_metric": { "description": "The metric used to pick the winning variation.", "type": "string", "enum": [ "clicks_unique", "opens_unique", "placed_orders_unique" ], "nullable": true }, "winner_percentage": { "description": "The percentage of the audience that receives the winning variation. The remainder is split evenly across the variations under test.", "type": "integer", "nullable": true }, "winner_wait_hours": { "description": "How long to collect results before picking a winner, in hours. New values may be at most 264 (11 days).", "type": "integer", "nullable": true } } }, "AgentHints": { "description": "Optional hints emitted by the API for agent callers", "type": "object", "properties": { "next_steps": { "description": "Suggested follow-up actions for agents to take after this response", "type": "array", "items": { "type": "string" } } } }, "CampaignAudienceEnum": { "type": "string", "enum": [ "campaign-audience" ] }, "CampaignDefinition": { "type": "object", "properties": { "name": { "description": "The campaign name", "type": "string", "nullable": true }, "builder": { "description": "Builder type: canvas or wizard", "type": "string", "example": "canvas", "nullable": true }, "archived": { "description": "Whether the campaign has been archived", "type": "boolean", "nullable": true }, "color": { "description": "Campaign display color as a hex string (e.g. 'ff5733')", "type": "string", "nullable": true }, "description": { "description": "A short description of the campaign", "type": "string", "nullable": true }, "send_settings": { "description": "Campaign-level send configuration", "$ref": "#/components/schemas/SendSettings", "nullable": true } } }, "CampaignEnum": { "type": "string", "enum": [ "campaign" ] }, "CampaignMessageEnum": { "type": "string", "enum": [ "campaign-message" ] }, "CampaignVariationEnum": { "type": "string", "enum": [ "campaign-variation" ] }, "CollectionLinks": { "type": "object", "properties": { "self": { "type": "string", "format": "uri" }, "prev": { "type": "string", "format": "uri" }, "next": { "type": "string", "format": "uri" } }, "required": [ "self" ] }, "DynamicMessageTrackingParam": { "type": "object", "properties": { "type": { "type": "string", "example": "dynamic", "default": "dynamic", "enum": [ "dynamic" ] }, "name": { "type": "string" }, "value": { "type": "string" } }, "required": [ "name", "value" ] }, "GetMessageResponseCollectionCompoundDocument": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/MessageResponseObjectResource" } }, "links": { "$ref": "#/components/schemas/CollectionLinks" }, "meta": { "$ref": "#/components/schemas/ResponseMeta" }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/OmniCampaignResponseObjectResource" } } }, "required": [ "data" ] }, "MessageDefinition": { "type": "object", "properties": { "name": { "description": "The name of the message", "type": "string", "nullable": true }, "status": { "description": "The status of the message", "type": "string", "enum": [ "cancelled", "draft", "scheduled", "sending", "sent" ], "nullable": true }, "tracking_options": { "description": "The tracking options for this message", "$ref": "#/components/schemas/MessageTrackingOptions", "nullable": true }, "send_options": { "description": "The send options for this message", "$ref": "#/components/schemas/MessageSendOptions", "nullable": true }, "ab_test": { "description": "A/B test settings. Returned for any message that runs an experiment, but only writable on content tests: a message with more than one variation that is not a send-time test.", "$ref": "#/components/schemas/ABTestSettings", "nullable": true } } }, "MessageResponseObjectResource": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/CampaignMessageEnum" }, "id": { "description": "The ID of the message", "type": "string" }, "attributes": { "type": "object", "properties": { "created": { "description": "The datetime when this message was created", "type": "string", "format": "date-time", "example": "2022-11-08T00:00:00+00:00" }, "updated": { "description": "The datetime when this message was updated", "type": "string", "format": "date-time", "example": "2022-11-08T00:00:00+00:00" }, "definition": { "description": "The definition of this message", "$ref": "#/components/schemas/MessageDefinition" } }, "required": [ "created", "updated", "definition" ] }, "relationships": { "type": "object", "properties": { "campaign": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/CampaignEnum" }, "id": { "description": "The parent campaign", "type": "string" } }, "required": [ "type", "id" ] }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } }, "campaign-audience": { "type": "object", "properties": { "data": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/CampaignAudienceEnum" }, "id": { "description": "The audience this message targets", "type": "string" } }, "required": [ "type", "id" ] }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } }, "campaign-variations": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "$ref": "#/components/schemas/CampaignVariationEnum" }, "id": { "description": "The content variations for this message", "type": "string" } } } }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } } } }, "links": { "$ref": "#/components/schemas/ObjectLinks" } }, "required": [ "type", "id", "attributes", "links" ] }, "MessageSendOptions": { "type": "object", "properties": { "send_time": { "description": "The UTC send time for this message", "type": "string", "format": "date-time", "example": "2022-11-08T00:00:00+00:00", "nullable": true }, "send_times": { "description": "Per-variation send times, keyed by variation ID. Populated for send-time optimization and AB send time test strategies.", "type": "object", "nullable": true }, "send_strategy": { "description": "The scheduling strategy for this message.", "type": "string", "enum": [ "ab_send_time_test", "content_variation", "content_variation_local_timezone", "local_timezone", "personalized_send_time_optimization", "send_time_optimization", "static", "throttled", "variation_per_second_throttled" ], "nullable": true }, "recipient_percentage": { "description": "The percentage of recipients to send this message to", "type": "integer", "nullable": true }, "throttling_type": { "description": "The throttling type for this message", "type": "string", "enum": [ "none", "throttle-for-campaigns", "throttle-for-campaigns-and-flows", "throttle-for-flows" ], "nullable": true }, "throttle_unit": { "description": "The time unit each batch of recipients is sent over for throttled sends.", "type": "string", "enum": [ "hour", "minute" ], "nullable": true }, "is_ignoring_unsubscribes": { "description": "Whether to ignore unsubscribes for this message", "type": "boolean", "nullable": true } } }, "MessageTrackingOptions": { "type": "object", "properties": { "is_add_utm": { "type": "boolean", "nullable": true }, "is_tracking_clicks": { "type": "boolean", "nullable": true }, "is_tracking_opens": { "type": "boolean", "nullable": true }, "tracking_params": { "type": "array", "items": { "oneOf": [ { "$ref": "#/components/schemas/StaticMessageTrackingParam" }, { "$ref": "#/components/schemas/DynamicMessageTrackingParam" } ] }, "nullable": true } } }, "ObjectLinks": { "type": "object", "properties": { "self": { "type": "string", "format": "uri" } }, "required": [ "self" ] }, "OmniCampaignResponseObjectResource": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/CampaignEnum" }, "id": { "description": "The campaign ID", "type": "string" }, "attributes": { "type": "object", "properties": { "created_at": { "description": "The datetime when the campaign was created", "type": "string", "format": "date-time", "example": "2022-11-08T00:00:00+00:00", "nullable": true }, "updated_at": { "description": "The datetime when the campaign was last updated", "type": "string", "format": "date-time", "example": "2022-11-08T00:00:00+00:00", "nullable": true }, "definition": { "description": "The campaign definition", "$ref": "#/components/schemas/CampaignDefinition" } }, "required": [ "definition" ] }, "relationships": { "type": "object", "properties": { "campaign-audiences": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "$ref": "#/components/schemas/CampaignAudienceEnum" }, "id": { "description": "The audiences associated with the campaign", "type": "string" } } } }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } }, "campaign-messages": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "$ref": "#/components/schemas/CampaignMessageEnum" }, "id": { "description": "The messages associated with the campaign", "type": "string" } } } }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } }, "tags": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "required": [ "type", "id" ], "properties": { "type": { "$ref": "#/components/schemas/TagEnum" }, "id": { "description": "The tags associated with the campaign", "type": "string" } } } }, "links": { "$ref": "#/components/schemas/RelationshipLinks" } } } } }, "links": { "$ref": "#/components/schemas/ObjectLinks" } }, "required": [ "type", "id", "attributes", "links" ] }, "RelationshipLinks": { "type": "object", "properties": { "self": { "type": "string", "format": "uri" }, "related": { "type": "string", "format": "uri" } }, "required": [ "self", "related" ] }, "ResponseMeta": { "description": "Response-level metadata", "type": "object", "properties": { "agent_hints": { "$ref": "#/components/schemas/AgentHints" } } }, "SendSettings": { "type": "object", "properties": { "send_timezone": { "description": "Timezone for send scheduling (IANA format). Must be 'UTC' when send_strategy is 'timezone', because each recipient's local timezone is used at send time.", "type": "string", "nullable": true }, "send_strategy": { "description": "Send strategy type. Writable values are 'timezone' and 'simple'; 'simple' requires send_timezone.", "type": "string", "enum": [ "content_variation", "content_variation_local_timezone", "personalized_send_time_optimization", "send_time_optimization", "simple", "throttled", "timezone", "variation", "variation_per_second_throttled", "variation_send_time" ], "nullable": true }, "send_passed_rltz_immediately": { "description": "Send to past-timezone recipients immediately", "type": "boolean", "nullable": true }, "exit_condition_enabled": { "description": "Whether exit conditions are enabled for this campaign", "type": "boolean", "nullable": true }, "exit_condition_conversion_metric_id": { "description": "The conversion metric ID used for exit conditions", "type": "string", "nullable": true } } }, "StaticMessageTrackingParam": { "type": "object", "properties": { "type": { "type": "string", "example": "static", "default": "static", "enum": [ "static" ] }, "name": { "type": "string" }, "value": { "type": "string" } }, "required": [ "name", "value" ] }, "TagEnum": { "type": "string", "enum": [ "tag" ] } }, "securitySchemes": { "Klaviyo-API-Key": { "type": "apiKey", "in": "header", "name": "Authorization", "description": "Private key authentication for /api/ endpoints is performed by setting the `Authorization` header to `Klaviyo-API-Key your-private-api-key`
For more information please visit https://developers.klaviyo.com/en/v2026-10-15/reference/api-overview#authentication", "x-default": "Klaviyo-API-Key your-private-api-key" } } }, "tags": [ { "name": "Campaigns", "description": "campaigns" } ] }