Skip to content

Put Budget

PUT /budgets/{workspace_id}

Create or replace the ceiling for one (workspace, period).

Invalidating the cache is the service’s job and it does it on the way out (§6.3): a limit that just changed must not be judged for another minute against a decision cached under the old one.

NameInTypeNotes
workspace_idpathstring (uuid)required—
FieldTypeNotes
periodmonth | dayoptionalDefault "month".
limit_amountnumber | string | null | nulloptional—
currencystringoptionalDefault "USD". min length 3 max length 3
is_enforcedbooleanoptionalDefault false.
alert_threshold_pctintegeroptionalDefault 80. min 1 max 100
period_startstring (date) | nulloptional—
StatusDescriptionBody
200Successful ResponseBudgetView
422Validation ErrorHTTPValidationError

The body shows the fields the schema always carries. Which combination is legal is a service rule the schema cannot express, so read the description above before copying this.

Terminal window
curl -X PUT https://your-deployment.example.com/budgets/{workspace_id} \
-H "Authorization: Bearer $COBRE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"period": "month",
"currency": "string",
"is_enforced": true,
"alert_threshold_pct": 0
}'
FieldTypeNotes
workspace_idstring (uuid)required—
periodmonth | dayrequired—
limit_amountstring | nulloptional—
currencystringoptionalDefault "USD".
is_enforcedbooleanoptionalDefault false.
alert_threshold_pctintegeroptionalDefault 80.
period_startstring (date)required—