Skip to main content
POST
Point bindings at other tools
Requires agents:update. Rebinding changes the draft only; the agent keeps serving its published revision until you publish again.
string
required
Local agent UUID.
integer
required
The exact draft version from Read workflow. There is always a draft to rebind, so null is not accepted here.
object
required
Each key is a bindings[].id already in the draft; each value is the UUID of the tool that binding should use from now on. One to 64 entries.
The response is the authoring state, exactly as a save returns it. Each named binding now points at that tool’s current revision; its inputs, its steps and the rest of the document are untouched. A binding that already uses that tool is left alone, and if none of them moved the draft version does not change.

Which call you actually need

Tool revisions are immutable and a binding names one, but by default a binding follows its tool: tool_revision_policy is follow_current unless you pinned it. That decides the shape of the change you are making.

Reselling one agent to a second client

The usual reason to rebind: Duplicate agent copies the bindings as they are, so the copy calls the original’s tool. Changing that tool’s URL would repoint both clients. Give the copy its own:
  1. POST /tools with the new client’s endpoint. Poll GET /tools/{id} until workflow.status is current — a tool with no head revision yet answers 409 WORKFLOW_TOOL_NOT_READY here.
  2. GET /agents/{copy}/workflow for draft.version and the binding ids.
  3. POST /agents/{copy}/workflow/rebind with those ids and the new tool.
  4. POST …/workflow/validate, then POST …/workflow/publish.
Both tools must describe the same arguments for step 4 to pass. A binding’s inputs are not rewritten by a rebind, so a tool whose input_schema asks for something the binding does not map is a missing_input_source issue from Check — the copy of a tool, which is the usual case here, never is.

Errors

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Headers

x-company-id
string<uuid>

Path Parameters

id
string<uuid>
required

Body

application/json
expected_version
integer
required

The exact draft version from GET /agents/{id}/workflow. Null is not accepted; a rebind always has a draft.

Required range: x >= 1
bindings
object
required

Each key is a bindings[].id already in the draft; each value is the id of the tool that binding should use.

Example:

Response

The authoring state, as a save returns it.

agent_id
string<uuid>
required
execution_version
enum<string>
required
read-only
Available options:
legacy,
workflow_v1
draft
null | object
required
published
null | object
required