{ "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/campaign-variations/{id}/campaign-message": { "get": { "operationId": "get_message_for_campaign_variation", "summary": "Get Message for Campaign Variation", "description": "Get the campaign message for the given campaign variation ID.

*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_message_for_campaign_variation.json)", "parameters": [ { "name": "id", "in": "path", "description": "The ID of the variation", "required": true, "schema": { "description": "The ID of the variation", "type": "string", "example": "925e385b52fb405715f3616c337cc65c" } }, { "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": "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/GetMessageResponse" } } } }, "4XX": { "$ref": "#/components/responses/ClientError" }, "5XX": { "$ref": "#/components/responses/ServerError" } }, "tags": [ "Campaigns" ], "x-klaviyo-operation-aliases": [ "get_campaign_variation_message" ], "x-klaviyo-pre-release": "None", "x-klaviyo-ratelimit": { "burst": "10/s", "steady": "150/m" }, "x-klaviyo-scopes": [ "campaigns:read" ], "x-klaviyo-subtag": "Variations" } } }, "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). Returned as null when no wait is set or the saved wait is outside 1-720 hours.", "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" ] }, "CampaignEnum": { "type": "string", "enum": [ "campaign" ] }, "CampaignMessageEnum": { "type": "string", "enum": [ "campaign-message" ] }, "CampaignVariationEnum": { "type": "string", "enum": [ "campaign-variation" ] }, "DynamicMessageTrackingParam": { "type": "object", "properties": { "type": { "type": "string", "example": "dynamic", "default": "dynamic", "enum": [ "dynamic" ] }, "name": { "type": "string" }, "value": { "type": "string" } }, "required": [ "name", "value" ] }, "GetMessageResponse": { "type": "object", "properties": { "data": { "allOf": [ { "$ref": "#/components/schemas/MessageResponseObjectResource" } ], "nullable": true }, "links": { "$ref": "#/components/schemas/ObjectLinks" }, "meta": { "$ref": "#/components/schemas/ResponseMeta" } }, "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" ] }, "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" } } }, "StaticMessageTrackingParam": { "type": "object", "properties": { "type": { "type": "string", "example": "static", "default": "static", "enum": [ "static" ] }, "name": { "type": "string" }, "value": { "type": "string" } }, "required": [ "name", "value" ] } }, "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" } ] }