Create an export
Changed onQueues a one-time export and returns it with status set to pending. The server assigns the identifier.
The export runs asynchronously. A client reads it again with GET /v1/ai-cost-management/exports/{exportId} to follow its progress. Once it succeeds, the client requests a download URL for one file at a time with POST /v1/ai-cost-management/exports/{exportId}/downloads.
If the body is invalid, the request fails with 400, including when ends_at is later than the end of the day in progress in time_zone. That check on ends_at runs last: a body with other errors gets those errors first, and the corrected body then gets the error on ends_at.
If the organization already has 20 pending one-time exports, the request fails with 409. Exports that a schedule creates don't count toward that limit.
Request
- Base URLhttps://global.api.konghq.com
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Request body
The body of a request that creates a one-time export: the dataset, the file format and compression, the time range, and optional filters and labels. The labels can't change after creation.
The body of a request that creates a one-time export: the dataset, the file format and compression, the time range, and optional filters and labels. The labels can't change after creation.
Example request
{
"format": "csv",
"compression": "gzip",
"labels": {
"env": "test"
}
}Response
The queued export, with status set to pending.
An export copies the organization's stored usage events in a time range into files to download. It runs asynchronously: status follows its progress, and once it succeeds, files lists the data files, which can be downloaded until expires_at.
After creation, only an export's status and results change. A client creates a one-time export, and an export schedule creates one export of each of its periods.
An export copies the organization's stored usage events in a time range into files to download. It runs asynchronously: status follows its progress, and once it succeeds, files lists the data files, which can be downloaded until expires_at.
After creation, only an export's status and results change. A client creates a one-time export, and an export schedule creates one export of each of its periods.
Example response
{
"id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
"format": "csv",
"compression": "gzip",
"labels": {
"env": "test"
},
"created_at": "2022-11-04T20:10:06.927Z",
"updated_at": "2022-11-04T20:10:06.927Z",
"expires_at": "2022-11-04T20:10:06.927Z"
}Changes
- info
endpoint added
- info