Replace a budget's updatable fields
Changed onReplaces a budget's name, labels, priority, and scope, with limit, window, and posture on a limit budget or validity on an exemption, and returns the result. The request carries the full budget. The budget keeps its identifier, notification rule, and recorded firings.
- An omitted labels, managed_by, priority, or posture resets to its default.
- effect can't change. If the request changes it, it fails with 400 naming effect.
- A changed limit, scope, or window applies to the whole current budget window.
- Removing scope.each while the notification rule's message uses {{entity.field}} or {{entity.value}} fails with 400 naming scope.each. Change the message first.
- Every replacement evaluates the budget's notification rule against the stored budget. A threshold that spend in the current budget window has reached fires at once, unless it already fired for that window and limit. A changed limit, or a changed window that moves the current window's start, therefore lets the thresholds fire again. A changed scope doesn't, but a changed each can fire for derived values new to the window. The evaluation runs after the budget is stored, so if it fails, retrying the same request completes it.
- A caller whose access covers only particular principals or groups replaces a budget that lies within its groups alone, or one within its principals and groups that it created. Replacing any other budget it can see fails with 403. The replacement's scope must keep the budget replaceable by the caller, or the request fails with 400 naming scope.
- The server assigns identifiers, so if the organization has no budget with this identifier that the caller can see, or the identifier isn't a valid UUID, the request fails with 404 and doesn't create one.
Request
- Base URLhttps://global.api.konghq.com
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Path parameters
The id of the budget.
Request body
The body of a request that creates or replaces a limit budget.
The body of a request that creates or replaces an exemption.
Example request
{
"labels": {
"env": "test"
},
"managed_by": {
"owner": "terraform"
}
}Response
The budget after the replacement.
A budget sets a spending limit, or declares an exemption from limits, for part of the organization's AI usage. scope selects the usage it covers.
effect tells the two kinds apart. A limit budget carries its settings in limit, window, and posture, and an exemption carries the period it covers in validity. The fields of the other kind are null.
A limit budget sets a spending limit on the usage in its scope for each budget window. It has a balance, and it can have a notification rule that alerts as spend reaches shares of the limit.
An exemption declares that the usage in its scope is exempt from limits for a limited time. It sets no limit. The service stores and lists exemptions, but they change no balance or notification.
Example response
{
"id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
"labels": {
"env": "test"
},
"managed_by": {
"owner": "terraform"
},
"created_at": "2022-11-04T20:10:06.927Z",
"updated_at": "2022-11-04T20:10:06.927Z"
}Changes
- info
endpoint added
- info