{
"openapi": "3.0.2",
"info": {
"title": "Klaviyo API",
"version": "2026-04-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-messages/{id}/campaign": {
"get": {
"operationId": "get_campaign_for_campaign_message",
"summary": "Get Campaign for Campaign Message",
"description": "Return the related 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_campaign_for_campaign_message.json)",
"parameters": [
{
"name": "id",
"in": "path",
"description": "",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "fields[campaign]",
"in": "query",
"description": "For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets",
"required": false,
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"archived",
"audiences",
"audiences.excluded",
"audiences.included",
"created_at",
"id",
"name",
"scheduled_at",
"send_options",
"send_options.use_smart_sending",
"send_strategy",
"send_strategy.date",
"send_strategy.datetime",
"send_strategy.method",
"send_strategy.options",
"send_strategy.options.is_local",
"send_strategy.options.send_past_recipients_immediately",
"send_strategy.throttle_percentage",
"send_time",
"status",
"tracking_options",
"tracking_options.add_tracking_params",
"tracking_options.custom_tracking_params",
"tracking_options.is_tracking_clicks",
"tracking_options.is_tracking_opens",
"updated_at"
]
}
},
"explode": false
},
{
"name": "revision",
"in": "header",
"description": "API endpoint revision (format: YYYY-MM-DD[.suffix])",
"required": true,
"schema": {
"type": "string",
"default": "2026-04-15"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/vnd.api+json": {
"schema": {
"$ref": "#/components/schemas/GetCampaignResponse"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/ClientError"
},
"5XX": {
"$ref": "#/components/responses/ServerError"
}
},
"tags": [
"Campaigns"
],
"x-klaviyo-operation-aliases": [
"get_campaign_message_campaign"
],
"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": {
"ABTestSendStrategy": {
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"ab_test_campaign"
]
}
},
"required": [
"method"
]
},
"Audiences": {
"type": "object",
"properties": {
"included": {
"description": "A list of included audiences",
"type": "array",
"items": {
"type": "string"
},
"example": [
"Y6nRLr"
]
},
"excluded": {
"description": "An optional list of excluded audiences",
"type": "array",
"items": {
"type": "string"
},
"example": [
"UTd5ui"
],
"nullable": true
}
},
"required": [
"included"
]
},
"CampaignEnum": {
"type": "string",
"enum": [
"campaign"
]
},
"CampaignMessageEnum": {
"type": "string",
"enum": [
"campaign-message"
]
},
"CampaignResponseObjectResource": {
"type": "object",
"properties": {
"type": {
"$ref": "#/components/schemas/CampaignEnum"
},
"id": {
"description": "The campaign ID",
"type": "string"
},
"attributes": {
"type": "object",
"properties": {
"name": {
"description": "The campaign name",
"type": "string"
},
"status": {
"description": "The current status of the campaign",
"type": "string",
"enum": [
"Adding Recipients",
"Cancelled",
"Cancelled: Account Disabled",
"Cancelled: Billing Limit",
"Cancelled: Internal Error",
"Cancelled: Misconfigured",
"Cancelled: No Recipients",
"Cancelled: Smart Sending",
"Draft",
"Preparing to schedule",
"Preparing to send",
"Queued without Recipients",
"Scheduled",
"Sending",
"Sending Segments",
"Sent",
"Unknown",
"Variations Sent"
]
},
"archived": {
"description": "Whether the campaign has been archived or not",
"type": "boolean"
},
"audiences": {
"description": "The audiences to be included and/or excluded from the campaign",
"$ref": "#/components/schemas/Audiences"
},
"send_options": {
"description": "Options to use when sending a campaign",
"oneOf": [
{
"$ref": "#/components/schemas/EmailSendOptions"
},
{
"$ref": "#/components/schemas/SMSSendOptions"
},
{
"$ref": "#/components/schemas/PushSendOptions"
}
]
},
"tracking_options": {
"description": "The tracking options associated with the campaign",
"nullable": true,
"oneOf": [
{
"$ref": "#/components/schemas/CampaignsEmailTrackingOptions"
},
{
"$ref": "#/components/schemas/CampaignsSMSTrackingOptions"
}
]
},
"send_strategy": {
"description": "The send strategy the campaign will send with",
"oneOf": [
{
"$ref": "#/components/schemas/StaticSendStrategy"
},
{
"$ref": "#/components/schemas/SmartSendTimeStrategy"
},
{
"$ref": "#/components/schemas/ThrottledSendStrategy"
},
{
"$ref": "#/components/schemas/ImmediateSendStrategy"
},
{
"$ref": "#/components/schemas/ABTestSendStrategy"
},
{
"$ref": "#/components/schemas/UnsupportedSendStrategy"
}
]
},
"created_at": {
"description": "The datetime when the campaign was created",
"type": "string",
"format": "date-time",
"example": "2022-11-08T00:00:00+00:00"
},
"scheduled_at": {
"description": "The datetime when the campaign was scheduled for future sending",
"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 by a user or the system",
"type": "string",
"format": "date-time",
"example": "2022-11-08T00:00:00+00:00"
},
"send_time": {
"description": "The datetime when the campaign will be / was sent or None if not yet scheduled by a send_job.",
"type": "string",
"format": "date-time",
"example": "2022-11-08T00:00:00+00:00",
"nullable": true
}
},
"required": [
"name",
"status",
"archived",
"audiences",
"send_options",
"send_strategy",
"created_at",
"updated_at"
]
},
"relationships": {
"type": "object",
"properties": {
"campaign-messages": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"id"
],
"properties": {
"type": {
"$ref": "#/components/schemas/CampaignMessageEnum"
},
"id": {
"description": "The message(s) 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": {
"type": "string"
}
}
}
},
"links": {
"$ref": "#/components/schemas/RelationshipLinks"
}
}
}
}
},
"links": {
"$ref": "#/components/schemas/ObjectLinks"
}
},
"required": [
"type",
"id",
"attributes",
"links"
]
},
"CampaignsEmailTrackingOptions": {
"type": "object",
"properties": {
"add_tracking_params": {
"description": "Whether the campaign needs custom tracking parameters. If set to False, tracking params will not be used.",
"type": "boolean",
"nullable": true
},
"custom_tracking_params": {
"description": "A list of custom tracking parameters. If an empty list is given and add_tracking_params is True, uses company defaults.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/DynamicTrackingParam"
},
{
"$ref": "#/components/schemas/StaticTrackingParam"
}
]
},
"nullable": true
},
"is_tracking_clicks": {
"description": "Whether the campaign is tracking click events. If not specified, uses company defaults.",
"type": "boolean",
"nullable": true
},
"is_tracking_opens": {
"description": "Whether the campaign is tracking open events. If not specified, uses company defaults.",
"type": "boolean",
"nullable": true
}
}
},
"CampaignsSMSTrackingOptions": {
"type": "object",
"properties": {
"add_tracking_params": {
"description": "Whether the campaign needs custom tracking parameters. If set to False, tracking params will not be used.",
"type": "boolean",
"nullable": true
},
"custom_tracking_params": {
"description": "A list of custom tracking parameters. If an empty list is given and add_tracking_params is True, uses company defaults.",
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/DynamicTrackingParam"
},
{
"$ref": "#/components/schemas/StaticTrackingParam"
}
]
},
"nullable": true
}
}
},
"DynamicTrackingParam": {
"type": "object",
"properties": {
"type": {
"description": "The type of the tracking parameter",
"type": "string",
"enum": [
"dynamic"
]
},
"value": {
"description": "The value of the tracking parameter",
"type": "string",
"enum": [
"campaign_id",
"campaign_name",
"campaign_name_id",
"campaign_name_send_day",
"email_subject",
"group_id",
"group_name",
"group_name_id",
"link_alt_text",
"message_type",
"profile_external_id",
"profile_id"
]
},
"name": {
"description": "Name of the tracking param",
"type": "string",
"example": "utm_medium"
}
},
"required": [
"type",
"value",
"name"
]
},
"EmailSendOptions": {
"type": "object",
"properties": {
"use_smart_sending": {
"description": "Use smart sending.",
"type": "boolean",
"example": true,
"default": true,
"nullable": true
}
}
},
"GetCampaignResponse": {
"type": "object",
"properties": {
"data": {
"allOf": [
{
"$ref": "#/components/schemas/CampaignResponseObjectResource"
}
],
"nullable": true
},
"links": {
"$ref": "#/components/schemas/ObjectLinks"
}
},
"required": [
"data"
]
},
"ImmediateSendStrategy": {
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"immediate"
]
}
},
"required": [
"method"
]
},
"LocalStaticSend": {
"type": "object",
"properties": {
"is_local": {
"description": "Whether the campaign should be sent with local recipient timezone send (requires UTC time) or statically sent at the given time.",
"type": "boolean",
"enum": [
true
]
},
"send_past_recipients_immediately": {
"description": "Determines if we should send to local recipient timezone if the given time has passed. Only applicable to local sends.",
"type": "boolean",
"default": false
}
},
"required": [
"is_local"
]
},
"NonLocalStaticSend": {
"type": "object",
"properties": {
"is_local": {
"description": "Whether the campaign should be sent with local recipient timezone send (requires UTC time) or statically sent at the given time.",
"type": "boolean",
"enum": [
false
]
}
},
"required": [
"is_local"
]
},
"ObjectLinks": {
"type": "object",
"properties": {
"self": {
"type": "string",
"format": "uri"
}
},
"required": [
"self"
]
},
"PushSendOptions": {
"type": "object",
"properties": {
"use_smart_sending": {
"description": "Use smart sending.",
"type": "boolean",
"example": true,
"default": true,
"nullable": true
}
}
},
"RelationshipLinks": {
"type": "object",
"properties": {
"self": {
"type": "string",
"format": "uri"
},
"related": {
"type": "string",
"format": "uri"
}
},
"required": [
"self",
"related"
]
},
"SMSSendOptions": {
"type": "object",
"properties": {
"use_smart_sending": {
"description": "Use smart sending.",
"type": "boolean",
"example": true,
"default": true,
"nullable": true
}
}
},
"SmartSendTimeStrategy": {
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"smart_send_time"
]
},
"date": {
"description": "The day to send on",
"type": "string",
"format": "date"
}
},
"required": [
"method",
"date"
]
},
"StaticSendStrategy": {
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"static"
]
},
"datetime": {
"description": "The time to send at",
"type": "string",
"format": "date-time",
"example": "2022-11-08T00:00:00+00:00"
},
"options": {
"description": "If the campaign should be sent with local recipient timezone send (requires UTC time) or statically sent at the given time.",
"nullable": true,
"oneOf": [
{
"$ref": "#/components/schemas/LocalStaticSend"
},
{
"$ref": "#/components/schemas/NonLocalStaticSend"
}
]
}
},
"required": [
"method",
"datetime"
]
},
"StaticTrackingParam": {
"type": "object",
"properties": {
"type": {
"description": "The type of the tracking parameter",
"type": "string",
"enum": [
"static"
]
},
"value": {
"description": "The value of the tracking parameter",
"type": "string"
},
"name": {
"description": "Name of the tracking param",
"type": "string",
"example": "utm_medium"
}
},
"required": [
"type",
"value",
"name"
]
},
"TagEnum": {
"type": "string",
"enum": [
"tag"
]
},
"ThrottledSendStrategy": {
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"throttled"
]
},
"datetime": {
"description": "The time to send at",
"type": "string",
"format": "date-time"
},
"throttle_percentage": {
"description": "The percentage of recipients per hour to send to.",
"type": "integer",
"enum": [
10,
11,
13,
14,
17,
20,
25,
33,
50
]
}
},
"required": [
"method",
"datetime",
"throttle_percentage"
]
},
"UnsupportedSendStrategy": {
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"unsupported"
]
}
},
"required": [
"method"
]
}
},
"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-04-15/reference/api-overview#authentication",
"x-default": "Klaviyo-API-Key your-private-api-key"
}
}
},
"tags": [
{
"name": "Campaigns",
"description": "campaigns"
}
]
}