Generate Customer Agent Response
POSThttps://a.klaviyo.com/api/customer-agent-responses
Sends one or more messages to Customer Agent and returns every public event it emits in response, including structured data such as orders and products.
Multiple messages can be attached, if the user has sent multiple or another agent's response should be included. The response is non-streaming; the entire event list is returned at once.
Images the customer sent can be attached to the final message as https:// URLs or base64 data URIs for the agent to take into account.
Requires an open conversation, created via POST /api/customer-agent-conversations. Conversations can only be interacted with that were created via the API. A closed or unknown conversation is also rejected. A hard or silent handoff moves the conversation to routed-to-team, after which it no longer accepts responses.
- Revision header
revision: 2026-10-15.prerequired- Scopes
agents:write- Rate limits
- Burst:
10/sSteady:150/m
Query parameters
For more information please visit API overview
Headers
API endpoint revision (format: YYYY-MM-DD[.suffix])
2026-10-15.pre
Request body
Content type: application/vnd.api+jsonrequired
Show 3 fields
Show 3 fields
Deprecated: ignored. The conversation's mode is used.
Deprecated: ignored. The conversation's channel is used.
Conversation history for this turn. The final message must have
role: user, and is the only message that can includeimages.Show 3 fields
Message text.
Author of a message in a Customer Agent conversation.
Images the customer sent with this message, up to 4. Only allowed on the final message.
Show 1 field
An
https://URL to fetch the image from. Alternatively, a base64-encoded data URI (data:image/...;base64,...). Supported image formats: png, jpeg, gif, webp. Maximum image size: 5MB.
Show 1 field
Show 1 field
Responses
201Success
Content type: application/vnd.api+json
Show 5 fields
Opaque identifier for this Customer Agent response.
Show 1 field
Events from this turn, in the order they were emitted. Alongside message and handoff events, can include structured data:
order-tracking,edit-order,order-return,product,subscriptions,discounts-coupons, andloyalty-card. Ignore event types you don't recognize.Option 3:
CustomerAgentResponseRequireAuthenticationEventOption 5:
CustomerAgentResponseOrderTrackingEventOrders being tracked.
Show 7 fields
Order ID.
Order name shown to the customer, e.g.
#1001.Order status, e.g.
PLACED,IN_TRANSIT,DELIVERED.Number of items in the order.
Image URL of the order's first item.
Channel the order was placed through, e.g.
web,pos.Tracking URLs for the order's shipments.
Option 8:
CustomerAgentResponseProductEventThe recommended product.
Show 7 fields
Product ID.
Product name.
Product page URL.
Featured image URL.
Variant ID, if a variant applies.
ID of the recommendation request that returned this product.
Recommendation provider, e.g.
shopify.
Option 9:
CustomerAgentResponseSubscriptionsEventSubscriptions.
Show 5 fields
Subscription ID.
Subscription status, e.g.
active,paused,cancelled.Date of the next charge and shipment.
Billing interval:
day,week, ormonth.Products in the subscription.
Option 10:
CustomerAgentResponseDiscountsCouponsEventAvailable discount codes.
Show 12 fields
Coupon ID.
Integration that issued the coupon, e.g.
shopify.Discount code to enter at checkout.
Coupon name.
Coupon status, e.g.
active.Numeric code for
status.Coupon description.
Discount value.
Numeric discount type code.
Minimum purchase amount.
Start of the validity period.
Expiration time.
Option 11:
CustomerAgentResponseLoyaltyCardEventPoints balance and rewards.
Show 9 fields
Current points balance.
Most valuable reward the customer can redeem now.
Points cost of
best_reward_name.Least expensive reward the customer can't redeem yet.
Points cost of
next_reward_name.Points still needed for
next_reward_name.Progress toward
next_reward_name, from0.0to1.0.Rewards the customer can redeem now.
Loyalty program page URL.
Show 1 field
4XXClient Error
Content type: application/vnd.api+json
5XXServer Error
Content type: application/vnd.api+json