POST
/organization/projects/{project_id}/spend_limitCreate or replace a project spend limit
Creates or replaces a project's hard spend limit. Supply threshold_amount, currency, and interval to set the spending threshold and the period used to evaluate it. The response includes the resulting limit and its enforcement state.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
project_idstringrequired
The ID of the project whose hard spend limit to create or replace.
Parameters for the hard spend limit to create or replace. All three fields are required.
threshold_amountintegerrequired
The hard spend limit amount, in cents.
currencystringrequired
The currency for the threshold amount. Currently, only `USD` is supported.
intervalstringrequired
The time interval for evaluating spend against the threshold. Currently, only `month` is supported.
200Returns the project's hard spend limit, including its amount in cents, currency, evaluation interval, and enforcement state.
objectstringrequired
The object type, which is always `project.spend_limit`.
threshold_amountintegerrequired
The hard spend limit amount, in cents.
currencystringrequired
The currency for the threshold amount. Currently, only `USD` is supported.
intervalstringrequired
The time interval for evaluating spend against the threshold. Currently, only `month` is supported.
enforcementobjectrequired
The current enforcement state of the hard spend limit.
400Returned when the requested spend limit is invalid or cannot be applied.
errorobjectrequired
403Returned when the caller does not have permission to perform this operation.
errorobjectrequired
Details about the permission error.
404Returned when the project was not found.
errorobjectrequired
Error handling
A 400 is returned when the requested limit is invalid or cannot be applied; threshold_amount must be at least 1, currency must be USD, and interval must be month. A 403 is returned when the authenticated user does not have permission to manage the project's spend limit. A 404 is returned when the project_id path parameter does not identify an existing project.