Cost estimates
Apply cost estimate
Records that the change an estimate was posted for was applied, today in the workspace's time zone, naming the estimate by the reference it was posted under, so CI needs no read access. Each created or replaced resource names the one to three ids it got; an address the estimate does not name as created or replaced is ignored. The same apply again answers the estimate unchanged. The 30 days before the apply date and the 30 from it are measured once cost data covers them. The answer names the estimate, its state and the apply date only, never its figures. The body is at most 5 MiB.
Needs a token with submitCostEstimates on the workspace.
Apply cost estimate › Request Body
workspaceId^wsp_[A-Za-z0-9_-]{2… · requiredrepositorypullRequestplanApply cost estimate › Responses
Success
id^est_[A-Za-z0-9_-]{2… · requiredstateappliedOnGet cost estimate
Returns one estimate with each resource's planned and, once reconciled, measured monthly cost and whether the reconciliation found it.
Needs a token with viewCosts on the workspace.
path Parameters
estimateId^est_[A-Za-z0-9_-]{2… · requiredGet cost estimate › Responses
Success
id^est_[A-Za-z0-9_-]{2… · requiredworkspaceId^wsp_[A-Za-z0-9_-]{2… · requiredsourcecurrency^[A-Z]{3}$ · requiredstateresourceCountcreatedAtrepositorypullRequestplansourceVersioncommiturlappliedOnupdatedAtclosedAtList cost estimates
Returns the workspace's estimates newest first, each with its planned and measured totals and without its resources.
Needs a token with viewCosts on the workspace.
query Parameters
workspaceId^wsp_[A-Za-z0-9_-]{2… · requiredstaterepositorypullRequestplanpageThe page to return, counted from 1. A page below 1 reads page 1; one past the last returns no items.
limitItems per page, from 1 to 100. A larger value is clamped to 100, a smaller one to 1.
List cost estimates › Responses
Success
Post cost estimate
Posts a planned change's monthly cost estimate for a pull request of a repository, or a named plan, as CI does on every push. The first post for a reference creates the estimate (201); a later one replaces it whole (200) until the change is applied, after which a post answers 409. Costfluent stores the figures as posted and prices nothing itself; a null monthly cost is one the estimator could not price, never zero. The answer names the estimate and its state only: the token CI posts with may hold submitCostEstimates alone and read no cost, and a token that may view costs reads the estimate by its id. A workspace holds at most 1,000 proposed or applied estimates. The body is at most 5 MiB.
Needs a token with submitCostEstimates on the workspace.
Headers
Idempotency-KeyA 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.
Post cost estimate › Request Body
workspaceId^wsp_[A-Za-z0-9_-]{2… · requiredsourcecurrency^[A-Z]{3}$ · requiredrepositorypullRequestplansourceVersioncommiturlPost cost estimate › Responses
The estimate posted earlier for the same reference, replaced
id^est_[A-Za-z0-9_-]{2… · requiredstateappliedOn