Operations 26
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Ask an LLM
“How do I list all my email campaigns in Klaviyo?”
“Why do I have to filter by channel before I can list campaigns?”
Tell an agent
List my campaigns matching {filter}.
Show SMS campaigns using filter {filter}, sorted by {sort}.
Ask an LLM
“What do I need to set up a new email campaign from scratch?”
“Can I define the audience and send strategy when creating a campaign?”
Tell an agent
Create a campaign with these settings: {campaign}.
Set up a new draft campaign targeting the audiences in {campaign}.
Ask an LLM
“How can I see the status and settings of a single campaign?”
“Can I include the campaign's messages and tags when fetching it?”
Tell an agent
Get campaign {campaign_id}.
Show campaign {campaign_id} with its related {include}.
Ask an LLM
“Can I change the name or audience of a campaign that already exists?”
“How do I reschedule a campaign's send strategy after creating it?”
Tell an agent
Update campaign {campaign_id} with {changes}.
Rename campaign {campaign_id} and change its audiences to {changes}.
Ask an LLM
“How do I permanently remove a campaign I no longer need?”
“Is deleting a campaign by ID reversible?”
Tell an agent destructive · confirm first
Delete campaign {campaign_id}.
Remove the old campaign {campaign_id} from my account.
Ask an LLM
“How do I see the subject line and content settings of a campaign message?”
“Can I fetch a single campaign message by its own ID?”
Tell an agent
Get campaign message {message_id}.
Show campaign message {message_id} including its {include}.
Ask an LLM
“Can I change the subject line or preview text on a campaign message?”
“What's the way to edit a message's content settings before it sends?”
Tell an agent
Update campaign message {message_id} with {changes}.
Change the subject and preview text of message {message_id} to {changes}.
Ask an LLM
“Has my campaign actually finished sending?”
“Where do I check the status of a campaign send I triggered?”
Tell an agent
Get campaign send job {send_job_id}.
Check whether send job {send_job_id} is still in progress.
Ask an LLM
“Can I stop a campaign that's currently sending?”
“Is it possible to put a sending campaign back into draft instead of canceling it?”
Tell an agent destructive · confirm first
Cancel the send for campaign job {send_job_id}.
Revert send job {send_job_id} to draft using {action}.
GET
/api/campaign-recipient-estimation-jobs/{id}
Check a recipient estimation job · Get Campaign Recipient Estimation Job
#
Ask an LLM
“Has the job refreshing my campaign's recipient count finished?”
“Where can I see the status of a recipient estimation job?”
Tell an agent
Get recipient estimation job {job_id}.
Check if estimation job {job_id} is done running.
GET
/api/campaign-recipient-estimations/{id}
Get a campaign's estimated recipients · Get Campaign Recipient Estimation
#
Ask an LLM
“About how many people will receive this campaign?”
“What is the current estimated audience size for a campaign?”
Tell an agent
Get the estimated recipient count for campaign {campaign_id}.
Tell me how many people campaign {campaign_id} is expected to reach.
Ask an LLM
“Can I duplicate a past campaign as the starting point for a new one?”
“Does a cloned campaign get its own new ID and name?”
Tell an agent
Clone the campaign described in {clone_request}.
Duplicate a campaign under a new name: {clone_request}.
POST
/api/campaign-message-assign-template
Assign a template to a campaign message · Assign Template to Campaign Message
#
Ask an LLM
“How do I apply one of my email templates to a campaign message?”
“Does assigning a template to a message change the original template?”
Tell an agent
Assign the template to the campaign message as described in {assignment}.
Use template and message IDs {assignment} to set the message's design.
Ask an LLM
“How do I trigger a campaign to go out now?”
“Is sending a campaign synchronous, or does it run as a background job?”
Tell an agent
Send campaign {campaign}.
Start the send job for campaign {campaign} right away.
POST
/api/campaign-recipient-estimation-jobs
Refresh a campaign's recipient estimate · Refresh Campaign Recipient Estimation
#
Ask an LLM
“My audience changed; how do I recalculate how many people a campaign will reach?”
“Can I kick off a fresh recipient count for a campaign?”
Tell an agent
Refresh the recipient estimate for campaign {campaign}.
Start a new recipient estimation job for {campaign}.
GET
/api/campaign-messages/{id}/campaign
Get the campaign a message belongs to · Get Campaign for Campaign Message
#
Ask an LLM
“Which campaign does this campaign message belong to?”
“Can I get the full parent campaign from a message ID?”
Tell an agent
Get the campaign that message {message_id} belongs to.
Show the full parent campaign for message {message_id}.
GET
/api/campaign-messages/{id}/relationships/campaign
Get the campaign ID for a message · Get Campaign ID for Campaign Message
#
Ask an LLM
“Can I fetch only the parent campaign ID for a campaign message?”
“What's the campaign relationship on a given message?”
Tell an agent
Get just the campaign ID for message {message_id}.
Return the campaign relationship of message {message_id}.
GET
/api/campaign-messages/{id}/template
Get the template used by a campaign message · Get Template for Campaign Message
#
Ask an LLM
“Which template is a campaign message using right now?”
“Can I see the full HTML template assigned to a message?”
Tell an agent
Get the template assigned to campaign message {message_id}.
Show the full template content for message {message_id}.
GET
/api/campaign-messages/{id}/relationships/template
Get the template ID for a campaign message · Get Template ID for Campaign Message
#
Ask an LLM
“Can I get only the template ID a campaign message points to?”
“What's the template relationship on a message?”
Tell an agent
Look up which template ID campaign message {message_id} points to.
Return the template relationship of message {message_id}.
GET
/api/campaign-messages/{id}/image
Get the image on a campaign message · Get Image for Campaign Message
#
Ask an LLM
“Which image is attached to a campaign message?”
“Can I see the full image record used by a push or SMS message?”
Tell an agent
Get the image attached to campaign message {message_id}.
Show image details for message {message_id}.
GET
/api/campaign-messages/{id}/relationships/image
Get the image ID for a campaign message · Get Image ID for Campaign Message
#
Ask an LLM
“Can I get only the image ID a campaign message references?”
“What's the image relationship on a message?”
Tell an agent
Look up the image ID referenced by campaign message {message_id}.
Return the image relationship of message {message_id}.
PATCH
/api/campaign-messages/{id}/relationships/image
Change the image on a campaign message · Update Image for Campaign Message
#
Ask an LLM
“How do I swap the image used in a campaign message?”
“Can I point a message at a different uploaded image?”
Tell an agent
Set the image on campaign message {message_id} to {image}.
Replace message {message_id}'s image with {image}.
Ask an LLM
“Can I fetch only the tag IDs on a campaign?”
“What tag relationships does a campaign have?”
Tell an agent
Get just the tag IDs for campaign {campaign_id}.
Return tag relationships of campaign {campaign_id}.
Ask an LLM
“What messages make up a given campaign?”
“Can I see the full content settings of every message in a campaign?”
Tell an agent
List the messages in campaign {campaign_id}.
Show every message of campaign {campaign_id} with its {include}.
GET
/api/campaigns/{id}/relationships/campaign-messages
Get message IDs for a campaign · Get Message IDs for Campaign
#
Ask an LLM
“Can I get only the message IDs that belong to a campaign?”
“What message relationships does a campaign carry?”
Tell an agent
Get just the message IDs for campaign {campaign_id}.
Return message relationships of campaign {campaign_id}.
Documentation
Documentation
https://developers.klaviyo.com/
Authentication
https://developers.klaviyo.com/en/docs/authenticate_
RateLimits
https://developers.klaviyo.com/en/docs/rate_limits_and_error_handling
Specifications
OpenAPI
https://artifacts.apis.io/klaviyo/openapi/klaviyo-campaigns-api-openapi.yml
AsyncAPI
https://artifacts.apis.io/klaviyo/asyncapi/klaviyo-webhooks-asyncapi.yaml
Other Resources
Reference
https://developers.klaviyo.com/en/reference/api_overview
Versioning
https://developers.klaviyo.com/en/docs/api_versioning_and_deprecation_policy
ChangeLog
https://developers.klaviyo.com/en/docs/changelog_
SDKs
https://developers.klaviyo.com/en/docs/sdk_overview
GitHub
https://github.com/klaviyo/openapi
Overlay
https://artifacts.apis.io/klaviyo/overlays/klaviyo-campaigns-api-overlay.yaml