Costfluent Public API

List uploads

GET
https://api.costfluent.com
/v1/custom-providers/{providerId}/uploads
Bearer (API token)

Returns a custom provider's uploads, newest first, each with the days it covers and what it billed.

Needs an organization token with viewProviders.

List uploads › path Parameters

providerId
​ProviderPublicId · pattern: ^prv_[A-Za-z0-9_-]{2… · required

List uploads › query Parameters

page
​integer · int32

The page to return, counted from 1. A page below 1 reads page 1; one past the last returns no items.

Default: 1
limit
​integer · int32

Items per page, from 1 to 100. A larger value is clamped to 100, a smaller one to 1.

Default: 20

List uploads › Responses

Success


Upload cost files

POST
https://api.costfluent.com
/v1/custom-providers/{providerId}/uploads
Bearer (API token)

Uploads one run of a FOCUS cost export to a custom provider: every file of the run in a repeated multipart field file, each .csv or .csv.gz with the same header, up to 90 MB together. The upload is accepted as pending and processed in the background; if any row is invalid nothing is committed and the upload fails with its errors. A completed upload replaces the provider's cost for every day from its first charge to its last. Its rows count toward the organization's monthly volume, one row for each day a cost is spread over, and the upload is checked whole before any day is committed: one that would pass a monthly volume limit set for the organization, or is processed while ingestion is paused, fails and commits nothing.

Needs an organization token with manageProviders.

Upload cost files › path Parameters

providerId
​ProviderPublicId · pattern: ^prv_[A-Za-z0-9_-]{2… · required

Upload cost files › Request Body

file
​array | null

Upload cost files › Responses

Accepted

id
​CustomCostUploadPublicId · pattern: ^upl_[A-Za-z0-9_-]{2… · required
status
​UploadStatus · required
fileName
​string · required
fileSizeBytes
​integer · int64 · required
totalRows
​integer · int32 · required
successRows
​integer · int32 · required
errorRows
​integer · int32 · required
uploadedAt
​string · date-time · required
coveredFrom
​string | null · date
coveredTo
​string | null · date
​object | null
processedAt
​string | null · date-time
​array | null

Get upload

GET
https://api.costfluent.com
/v1/custom-providers/{providerId}/uploads/{uploadId}
Bearer (API token)

Returns one upload with its status and, when it failed, the first errors of its report.

Needs an organization token with viewProviders.

Get upload › path Parameters

providerId
​ProviderPublicId · pattern: ^prv_[A-Za-z0-9_-]{2… · required
uploadId
​CustomCostUploadPublicId · pattern: ^upl_[A-Za-z0-9_-]{2… · required

Get upload › Responses

Success

id
​CustomCostUploadPublicId · pattern: ^upl_[A-Za-z0-9_-]{2… · required
status
​UploadStatus · required
fileName
​string · required
fileSizeBytes
​integer · int64 · required
totalRows
​integer · int32 · required
successRows
​integer · int32 · required
errorRows
​integer · int32 · required
uploadedAt
​string · date-time · required
coveredFrom
​string | null · date
coveredTo
​string | null · date
​object | null
processedAt
​string | null · date-time
​array | null

Delete upload

DELETE
https://api.costfluent.com
/v1/custom-providers/{providerId}/uploads/{uploadId}
Bearer (API token)

Deletes an upload and removes the cost it still contributes. Days a later upload replaced keep that upload's cost.

Needs an organization token with manageProviders.

Delete upload › path Parameters

providerId
​ProviderPublicId · pattern: ^prv_[A-Za-z0-9_-]{2… · required
uploadId
​CustomCostUploadPublicId · pattern: ^upl_[A-Za-z0-9_-]{2… · required

Delete upload › Responses

No Content

No data returned

Submit costs batch

POST
https://api.costfluent.com
/v1/custom-providers/{providerId}/costs
Bearer (API token)

Submits a batch of cost records to a custom provider. A batch that another submission or upload for the same provider overtook while it ran answers 409 concurrency_conflict and commits nothing; send it again. Submitted costs count toward the organization's monthly volume, one row for each day a cost is spread over, and the batch is checked whole: one that would pass a monthly volume limit set for the organization commits nothing. Each entry becomes one daily record per day of its charge period; a request may become at most 37,500 records and, counting a spread entry once per day, 48 MiB of entries, and is refused with 400 otherwise.

Needs an organization token with syncProviders for every request, and manageProviders as well when it replaces lines (replaceLines: true), which removes their earlier days.

Submit costs batch › path Parameters

providerId
​ProviderPublicId · pattern: ^prv_[A-Za-z0-9_-]{2… · required

Submit costs batch › Headers

Idempotency-Key
​string · minLength: 1 · maxLength: 255

A unique value, at most 255 printable ASCII characters, such as a UUID, that makes retrying this create safe. A retry with the same key and the same request within 24 hours answers the first response again, marked Idempotent-Replayed: true, and creates nothing; the same key with another request answers 422 idempotency_key_reused. A key is kept only for a create that succeeded. Without it, every request creates.

Submit costs batch › Request Body

​CostEntry[] · minLength: 1 · required
replaceLines
​boolean

Submit costs batch › Responses

Success

batchId
​CustomCostBatchPublicId · pattern: ^cbt_[A-Za-z0-9_-]{2… · required
totalRows
​integer · int32 · required
acceptedRows
​integer · int32 · required
rejectedRows
​integer · int32 · required
​array | null