Costfluent Public API

List workspace providers

GET
https://api.costfluent.com
/v1/workspace-providers
Bearer (API token)

Returns the connections enabled in a workspace and the accounts it reads of each.

Needs a token with viewWorkspace on the workspace.

List workspace providers › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
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 workspace providers › Responses

Success

​PaginationLinks · required
​WorkspaceProviderResponse[] · required

Create workspace provider

POST
https://api.costfluent.com
/v1/workspace-providers
Bearer (API token)

Enables a connection in a workspace, for all its accounts or for the accounts listed. One connection can be enabled in several workspaces, each for its own accounts. Which accounts a workspace reads is the organization's to decide, so a workspace token cannot enable one.

Needs an organization token with addWorkspaceProvider and manageProviders.

Create workspace provider › 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.

Create workspace provider › Request Body

workspaceId
​WorkspacePublicId · minLength: 1 · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
providerId
​ProviderPublicId · minLength: 1 · pattern: ^prv_[A-Za-z0-9_-]{2… · required
accountIds
​array | null

Create workspace provider › Responses

Created

id
​WorkspaceProviderPublicId · pattern: ^wpr_[A-Za-z0-9_-]{2… · required
workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
providerId
​ProviderPublicId · pattern: ^prv_[A-Za-z0-9_-]{2… · required
providerName
​string · required
isEnabled
​boolean · required
accountIds
​string[] · required
addedAt
​string · date-time · required
​

Get workspace provider

GET
https://api.costfluent.com
/v1/workspace-providers/{workspaceProviderId}
Bearer (API token)

Returns one connection enabled in a workspace and the accounts it reads.

Needs a token with viewWorkspace on the workspace.

Get workspace provider › path Parameters

workspaceProviderId
​WorkspaceProviderPublicId · pattern: ^wpr_[A-Za-z0-9_-]{2… · required

Get workspace provider › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required

Get workspace provider › Responses

Success

id
​WorkspaceProviderPublicId · pattern: ^wpr_[A-Za-z0-9_-]{2… · required
workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
providerId
​ProviderPublicId · pattern: ^prv_[A-Za-z0-9_-]{2… · required
providerName
​string · required
isEnabled
​boolean · required
accountIds
​string[] · required
addedAt
​string · date-time · required
​

Update workspace provider

PUT
https://api.costfluent.com
/v1/workspace-providers/{workspaceProviderId}
Bearer (API token)

Turns a connection on or off in a workspace, or replaces the accounts it reads. Which accounts a workspace reads is the organization's to decide, so a workspace token can only turn the link on or off.

Needs a token with addWorkspaceProvider on the workspace unless the request only turns the link off, and removeWorkspaceProvider to turn it off. It also needs an organization token with manageProviders to send accountIds.

Update workspace provider › path Parameters

workspaceProviderId
​WorkspaceProviderPublicId · pattern: ^wpr_[A-Za-z0-9_-]{2… · required

Update workspace provider › Request Body

workspaceId
​WorkspacePublicId · minLength: 1 · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
isEnabled
​boolean | null
accountIds
​array | null

Update workspace provider › Responses

Success

id
​WorkspaceProviderPublicId · pattern: ^wpr_[A-Za-z0-9_-]{2… · required
workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required
providerId
​ProviderPublicId · pattern: ^prv_[A-Za-z0-9_-]{2… · required
providerName
​string · required
isEnabled
​boolean · required
accountIds
​string[] · required
addedAt
​string · date-time · required
​

Delete workspace provider

DELETE
https://api.costfluent.com
/v1/workspace-providers/{workspaceProviderId}
Bearer (API token)

Stops a workspace reading a connection. The connection and its cost stay; other workspaces that enable it are unaffected.

Needs a token with removeWorkspaceProvider on the workspace.

Delete workspace provider › path Parameters

workspaceProviderId
​WorkspaceProviderPublicId · pattern: ^wpr_[A-Za-z0-9_-]{2… · required

Delete workspace provider › query Parameters

workspaceId
​WorkspacePublicId · pattern: ^wsp_[A-Za-z0-9_-]{2… · required

Delete workspace provider › Responses

No Content

No data returned