Start a log export
/v1/logs/exportStart a log export.
Starts exporting the organization's logs that match the filters, newest first, as CSV or JSON, and returns 202 with the job at once. Poll the job until its status is DONE, then download the file. At most max_rows rows are exported (default 10,000, at most 50,000). A job and its file are kept for one hour.
Requires an organization owner or admin, or an organization-scoped va_ key with the admin role. Fails with 400 when max_rows is over 50,000.
Authorization
AuthorizationBearer va_A platform API key (
va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.
Request body application/json
formatenum<string>csv(default) orjson. CSV has one header row and a fixed set of columns; JSON is an array of log rows as the search returns them.One of
"csv","json"max_rowsinteger<int32>The most logs to export: default 10,000, at most 50,000.
providerstringOnly requests to this provider, as stored: upper case with underscores, e.g.
OPENAI.modelstringOnly requests for this model id.
organizationstringThe slug of the organization whose logs to export. Required.
user_idstringOnly requests attributed to this end user.
virtual_key_slugstringOnly requests made with this virtual key (
vk-...).statusenum<string>success(status below 400) orerror(400 and above).One of
"success","error"cache_statusenum<string>Only requests with this cache result:
HIT,SEMANTIC_HIT,MISS,BYPASS,REFRESHorDISABLED.One of
"HIT","SEMANTIC_HIT","MISS","BYPASS","REFRESH","DISABLED"start_timestring<date-time>Only requests at or after this time (ISO 8601 date-time with offset).
end_timestring<date-time>Only requests before this time (ISO 8601 date-time with offset).
Responses
job_idstringThe job's id. Use it to check progress and download the file.
statusenum<string>PENDING,RUNNING,DONEorFAILED.One of
"PENDING","RUNNING","DONE","FAILED"formatenum<string>The file format:
csvorjson.One of
"csv","json"row_countinteger<int32>How many logs were exported; 0 until the job is done.
error_messagestringWhy the job failed; null unless the status is
FAILED.created_atstring<date-time>When the job was started (ISO 8601 date-time). The job and its file are kept for one hour from then.
completed_atstring<date-time>When the job finished or failed (ISO 8601 date-time); null while it runs.