Ask Analytics Question
POSThttps://a.klaviyo.com/api/ksql-ask
Ask a question about your account data in plain language and get a plain-language answer.
K-SQL turns your question into read-only queries over your account's data, runs them, and summarizes the results. The result sets behind the answer are included so you can see how it was reached.
If the question is too ambiguous to answer, status is clarification and answer contains a question for you. Ask again with more detail.
An answer can only draw on data that your API key or OAuth token has scopes for. Each request uses Composer AI Credits. This API is available to accounts that have been enabled for it.
Answers can take several seconds, so allow for this in your client's request timeout.
- Revision header
revision: 2026-10-15.prerequired- Scopes
agents:readcampaigns:readcatalogs:readevents:readlists:readmetrics:readprofiles:readsegments:read- Rate limits
- Burst:
1/sSteady:15/m
Steady: 15/m
Optional Scopes:
agents:read
campaigns:read
catalogs:read
events:read
lists:read
metrics:read
profiles:read
segments:read
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
Responses
200Success
Content type: application/vnd.api+json
Show 4 fields
Identifier for this ask, for joining logs across services.
Show 4 fields
Whether this ask was answered or needs more input.
Plain-language answer when
statusissuccess, or the clarifying question back to the caller whenstatusisclarification.The executed queries' typed result sets supporting
answer. Always empty whenstatusisclarification; may also be empty onsuccesswhen the answer required no query execution.Show 8 fields
The result set's columns, in the order their values appear in each row.
The result rows. Each row is a list of values in the same order as
columns. A value is a boolean forbooleancolumns, a number forlonganddoublecolumns, and a string for every other type. A missing value isnull.The number of rows in the query's result.
The number of rows included in
rows. This is lower thanrow_countwhen row data was left out by a cap.Whether the QUERY's result was complete -- it says nothing about this payload.
samplemeans the query's row count equalled its ownLIMIT, so the underlying result may be larger;truncatedmeans it hit K-SQL's own result cap. Comparerows_returnedtorow_countfor payload elision, which is separate:completewithrows_returnedbelowrow_countis a full query result only partially included here.A short plain-language description of what this result set contains.
The K-SQL query that produced this result set, so you can see how the numbers were derived. Read-only and for explanation only: it is not a stable interface while K-SQL is in alpha -- do not parse it or store it. To run a K-SQL query yourself, see
POST /api/ksql-query.Caveats about this result set, in plain language and safe to show an end user as sent. The same sentences also appear in the response-level
warnings; read them here when you need to know which result set a caveat applies to.
Caveats that change how
answerandresult_setsshould be read -- a sampled result set, row data elided by a cap, a table withheld from this ask. Several conditions are reported nowhere else, so surface these alongside the answer rather than discarding them.
Show 1 field
4XXClient Error
Content type: application/vnd.api+json
5XXServer Error
Content type: application/vnd.api+json