Skip to guide

Developer documentation

Update an agent (name / scopes / budgets)

PATCH/api/control/v1/agents/{id}

Request

Update an agent (name / scopes / budgets)

Authenticate with Authorization: Bearer and a control API key with write scope. Set GATEWAY to your deployment origin and ID to the resource ID where needed. Replace sample values before sending a mutation.

Generated curl examples use GATEWAY for the deployment origin and ID for a path identifier. Set those shell variables before running the request. JSON examples show the request shape; replace each sample value with your own input.

Parameters

NameInTypeRequiredDescription
idpathstringYesFormat: uuid.
Idempotency-KeyheaderstringNoRetrying with the same key will not re-apply the mutation.
fallbacksbodyarrayNoOrdered failover targets. An empty array disables failover. Write-only; GET does not return this field.
namebodystringNo—
scopesbodyarrayNo—
budget_tokensbodyinteger | nullNo—
budget_centsbodyinteger | nullNo—
budget_periodbodystring | nullNoCalendar UTC period of a periodic spend limit. Send together with budget_period_cents; both null removes the limit. A call counts toward the period in which it finishes. Write-only here, like fallbacks: GET does not return it, so the list endpoint cannot depend on migration 0073. Values: day, month, .
budget_period_centsbodyinteger | nullNoMost this agent may spend per budget_period, in cents. Send together with budget_period.
pause_percentbodyinteger | nullNoSoft pause line (migration 0087): once the agent has used this share of any of its limits, the gateway refuses its calls with 402 blocked_budget_pause until the owner lets it go on for an hour from the dashboard. null removes the line. The limits themselves still apply.
pause_switchbodyobject | nullNoWhat happens at the pause line (migration 0088). null pauses, as above. An object sends the agent's calls to that provider to one cheaper model instead, for the rest of the period or until the owner lets it go on. The model must already be in the agent's scope (422 otherwise), and the agent needs a pause line. Calls to any other provider past the line pause. The scope, policy and limits apply to the model sent. A switched call's response carries `x-passcontrol-model-switched: <asked> -> <sent>` and never fails over. The cheaper model can refuse a request the usual one accepts (a longer context, a beta feature); the agent gets that provider's error, and the call is not retried on the usual model. Write-only here, like budget_period.

Request schema

The JSON body follows this schema. Nested required fields are listed inside each object.

Responses

Illustrative response bodies are generated from the schema. Sample IDs, dates, numbers and strings are placeholders. The schema below each status is the response contract.

StatusDescriptionMedia type
200OK.application/json
400Error.application/json
401Error.application/json
403Error.application/json
404Error.application/json
409Error.application/json
413Error.application/json
415Error.application/json
422Error.application/json
429Shared control-key or IP request limit reached. Decision traces also have a workspace limit.application/json
500Error.application/json

Errors

400: Error. 401: Error. 403: Error. 404: Error. 409: Error. 413: Error. 415: Error. 422: Error. 429: Shared control-key or IP request limit reached. Decision traces also have a workspace limit. 500: Error.

A successful HTTP response is not permission. Check the returned status or decision and apply your service's access rule.

Rate limit

120 requests per control key per 60 seconds, using the shared total request count. Reads and writes increment the same counter; prior reads count toward the 120-request write ceiling. The pre-authentication IP guard is shared across operator endpoints: 1,000 requests per 60 seconds by default.

On 429, wait for Retry-After before retrying. An unavailable check must never be treated as a successful identity or mandate decision.

Update an agent (name / scopes / budgets) · Developers · PassControl