Update agent variable
Creates or changes a variable with a fixed value (source is static) of an agent and returns it. The agent can use it as {{name}} in its texts. The value has 1 to 500 characters and the description up to 200; when you leave the description out, the current one is kept. An agent has at most 30 variables, and names starting with system__ are reserved. Variables that change at every call (source contact or call) are read-only here. Required scope: agents:operate. With a test key (vx_test_) it is simulated: nothing real happens and nothing is billed. Accepts an optional Idempotency-Key header. Retriable: when the operation itself fails with a 429, a 5xx or a temporary 409, the key is released and a retry with the same key runs the operation again; with no response at all, a retry with the same key returns the first outcome or runs the operation again. A 429 rate_limited from the request limit and 409 request_in_progress come before the operation and leave the key as it is: retry with the same key.
Authentication
Path parameters
Id of an agent of the organization, as returned by GET /agents.
Lowercase letters, digits and underscore, starting with a letter, up to 64 characters. Names used by the platform (system__*) are reserved.
Headers
API version for this request; defaults to the version the key is pinned to.
A unique value you generate for each new operation (16 to 64 letters, digits, hyphen or underscore; a UUID works). Repeating the same request with the same key within 24 hours returns the first response and does nothing again, when that response was a success or a 4xx error the same request would always get again (not 429, and not the temporary 409 codes request_in_progress, caller_has_active_call and caller_request_in_progress: for those, and for a 5xx, see the note on retrying in the operation); the same key with a different request is refused with idempotency_key_reused.
Request
The fixed value (1 to 500 characters).
What the variable is for (at most 200 characters). When omitted, the current description is kept.
Response
The variable already existed and was changed: created is false.
Always agent_variable.
Always static: only variables with a fixed value can be written here.
The description now stored: the one you sent, or the one the variable already had. Empty when there is none.
Always null: a variable with a fixed value has no fallback.
Whether the variable was created (201) or changed (200).
true when the request was made with a test key: every check ran but nothing was changed. false with a live key.