Email messages have content fields: subject, preview_text, from_email, from_label, reply_to_email
SMS messages have content fields: body
Including 'template' provides the HTML/text content of the email
4. Manage Campaign Tags
When to use
User wants to view tags associated with campaigns for organization
Tool sequence
:
KLAVIYO_GET_CAMPAIGN_RELATIONSHIPS_TAGS
- Get tag IDs for a campaign [Required]
Key parameters
:
id
Campaign ID string
Pitfalls
:
Returns only tag IDs, not tag names/details
Tag IDs can be used with Klaviyo's tag endpoints for full details
Rate limit: 3/s burst, 60/m steady (stricter than other endpoints)
5. Monitor Campaign Send Jobs
When to use
User wants to check the status of a campaign send operation
Tool sequence
:
KLAVIYO_GET_CAMPAIGN_SEND_JOB
- Check send job status [Required]
Key parameters
:
id
Send job ID
Pitfalls
:
Send job IDs are returned when a campaign send is initiated
Job statuses indicate whether the send is queued, in progress, complete, or failed
Rate limit: 10/s burst, 150/m steady
Common Patterns
Campaign Discovery Pattern
1. Call KLAVIYO_GET_CAMPAIGNS with channel='email'
2. Paginate through all results via page_cursor
3. Filter by status client-side for accuracy
4. Extract campaign IDs for detailed inspection
Sparse Fieldset Pattern
Klaviyo supports sparse fieldsets to reduce response size:
fields__campaign__message=['content.subject', 'content.from_email', 'send_times']
fields__campaign=['name', 'status', 'send_time']
fields__template=['name', 'html', 'text']
Pagination
Klaviyo uses cursor-based pagination
Check response for
page_cursor
in the pagination metadata
Pass cursor as
page_cursor
in next request
Default page size is ~10 campaigns
Continue until no more cursor is returned
Filter Syntax
- equals(status,"draft") - Campaigns in draft status
- equals(name,"Newsletter") - Campaign named "Newsletter"
- greater-than(created_at,"2024-01-01T00:00:00Z") - Created after date
Known Pitfalls
API Version
:
Klaviyo API uses versioned endpoints (e.g., v2024-07-15)
Response schemas may change between API versions
Tool responses follow the version configured in the Composio integration
Response Nesting
:
Data is nested:
response.data.data[].attributes
Campaign status at
data[].attributes.status
Mis-parsing the nesting yields empty or incorrect results
Always navigate through the full path defensively
Rate Limits
:
Burst: 10/s (3/s for tag endpoints)
Steady: 150/m (60/m for tag endpoints)
Required scope: campaigns:read
Implement backoff on 429 responses
Status Values
:
Status strings are case-sensitive
Compound statuses exist (e.g., 'Cancelled: No Recipients')
Server-side filtering may return mixed statuses; always validate client-side
Quick Reference
Task
Tool Slug
Key Params
List campaigns
KLAVIYO_GET_CAMPAIGNS
channel, filter, sort, page_cursor
Get campaign details
KLAVIYO_GET_CAMPAIGN
campaign_id, include_messages, include_tags
Get campaign message
KLAVIYO_GET_CAMPAIGN_MESSAGE
id, fields__campaign__message
Get campaign tags
KLAVIYO_GET_CAMPAIGN_RELATIONSHIPS_TAGS
id
Get send job status
KLAVIYO_GET_CAMPAIGN_SEND_JOB
id
Powered by
Composio