curl --request POST \
--url https://api.goyappr.com/agents/{id}/workflow/rebind \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 2,
"bindings": {
"notify": "33333333-3333-4333-8333-333333333333"
}
}
'import requests
url = "https://api.goyappr.com/agents/{id}/workflow/rebind"
payload = {
"expected_version": 2,
"bindings": { "notify": "33333333-3333-4333-8333-333333333333" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 2,
bindings: {notify: '33333333-3333-4333-8333-333333333333'}
})
};
fetch('https://api.goyappr.com/agents/{id}/workflow/rebind', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/agents/{id}/workflow/rebind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 2,
'bindings' => [
'notify' => '33333333-3333-4333-8333-333333333333'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/agents/{id}/workflow/rebind"
payload := strings.NewReader("{\n \"expected_version\": 2,\n \"bindings\": {\n \"notify\": \"33333333-3333-4333-8333-333333333333\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goyappr.com/agents/{id}/workflow/rebind")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 2,\n \"bindings\": {\n \"notify\": \"33333333-3333-4333-8333-333333333333\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/agents/{id}/workflow/rebind")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 2,\n \"bindings\": {\n \"notify\": \"33333333-3333-4333-8333-333333333333\"\n }\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_version": "legacy",
"draft": {
"version": 2,
"document": {
"id": "<string>",
"name": "<string>",
"conversation": {
"entry_node_id": "<string>",
"nodes": [
{
"id": "<string>",
"label": "<string>",
"type": "conversation",
"instructions": "<string>",
"available_binding_ids": [
"<string>"
],
"binding_overrides": {}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"kind": "conversation",
"condition": "<string>"
}
],
"global_edges": [
{
"id": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"schema_version": "1",
"strict_mode": false,
"global_instructions": "",
"channels": [
"phone"
],
"request_schema": {},
"stored_schema": {},
"bindings": [
{
"id": "<string>",
"tool_revision_id": "<string>",
"tool_revision_policy": "follow_current",
"inputs": {}
}
],
"before": {
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"on_failure": "stop_admission"
},
"after": [
{
"id": "<string>",
"event": "call.answered",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
}
}
],
"sequences": [
{
"id": "<string>",
"name": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"description": "",
"input_schema": {},
"output_schema": {},
"output_mapping": {}
}
],
"editor": {
"positions": {}
},
"integrations": [
{
"id": "<string>",
"connection_id": "<string>",
"app": "<string>",
"actions": [
{
"action": "<string>",
"binding_id": "<string>"
}
]
}
]
},
"updated_at": "2023-11-07T05:31:56Z"
},
"published": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 2,
"content_hash": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"environment": "local"
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Point bindings at other tools
Move one binding to another saved tool without rewriting the workflow document.
curl --request POST \
--url https://api.goyappr.com/agents/{id}/workflow/rebind \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_version": 2,
"bindings": {
"notify": "33333333-3333-4333-8333-333333333333"
}
}
'import requests
url = "https://api.goyappr.com/agents/{id}/workflow/rebind"
payload = {
"expected_version": 2,
"bindings": { "notify": "33333333-3333-4333-8333-333333333333" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_version: 2,
bindings: {notify: '33333333-3333-4333-8333-333333333333'}
})
};
fetch('https://api.goyappr.com/agents/{id}/workflow/rebind', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.goyappr.com/agents/{id}/workflow/rebind",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'expected_version' => 2,
'bindings' => [
'notify' => '33333333-3333-4333-8333-333333333333'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.goyappr.com/agents/{id}/workflow/rebind"
payload := strings.NewReader("{\n \"expected_version\": 2,\n \"bindings\": {\n \"notify\": \"33333333-3333-4333-8333-333333333333\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.goyappr.com/agents/{id}/workflow/rebind")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_version\": 2,\n \"bindings\": {\n \"notify\": \"33333333-3333-4333-8333-333333333333\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/agents/{id}/workflow/rebind")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_version\": 2,\n \"bindings\": {\n \"notify\": \"33333333-3333-4333-8333-333333333333\"\n }\n}"
response = http.request(request)
puts response.read_body{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_version": "legacy",
"draft": {
"version": 2,
"document": {
"id": "<string>",
"name": "<string>",
"conversation": {
"entry_node_id": "<string>",
"nodes": [
{
"id": "<string>",
"label": "<string>",
"type": "conversation",
"instructions": "<string>",
"available_binding_ids": [
"<string>"
],
"binding_overrides": {}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"kind": "conversation",
"condition": "<string>"
}
],
"global_edges": [
{
"id": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"schema_version": "1",
"strict_mode": false,
"global_instructions": "",
"channels": [
"phone"
],
"request_schema": {},
"stored_schema": {},
"bindings": [
{
"id": "<string>",
"tool_revision_id": "<string>",
"tool_revision_policy": "follow_current",
"inputs": {}
}
],
"before": {
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"on_failure": "stop_admission"
},
"after": [
{
"id": "<string>",
"event": "call.answered",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
}
}
],
"sequences": [
{
"id": "<string>",
"name": "<string>",
"steps": [
{
"id": "<string>",
"label": "<string>",
"binding_id": "<string>",
"depends_on": [
"<string>"
],
"requires": [
"transcript"
],
"on_failure": "stop",
"when": {
"kind": "compare",
"source": {
"kind": "literal",
"value": true
},
"op": "exists",
"value": {
"kind": "literal",
"value": true
}
},
"on_succeeded": "<string>",
"on_failed": "<string>"
}
],
"description": "",
"input_schema": {},
"output_schema": {},
"output_mapping": {}
}
],
"editor": {
"positions": {}
},
"integrations": [
{
"id": "<string>",
"connection_id": "<string>",
"app": "<string>",
"actions": [
{
"action": "<string>",
"binding_id": "<string>"
}
]
}
]
},
"updated_at": "2023-11-07T05:31:56Z"
},
"published": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 2,
"content_hash": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"environment": "local"
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}agents:update. Rebinding changes the draft only; the agent keeps
serving its published revision until you publish again.
null is not accepted here.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.curl -X POST 'https://api.goyappr.com/agents/AGENT_ID/workflow/rebind' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-company-id: COMPANY_ID' \
-H 'Content-Type: application/json' \
-d '{"expected_version":7,"bindings":{"notify":"TOOL_ID"}}'
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.
| What you want | What to call |
|---|---|
| Every agent using this tool should call a new URL | Update tool — one PATCH /tools/{id} with the new configuration.url. The new revision is promoted to head and following bindings move with it. No workflow edit at all. |
| This one agent should call a different endpoint from the others | Create tool for its own endpoint, then this call. Then Check and Publish. |
| This binding should stay on an older revision forever | Save workflow draft with tool_revision_policy: "pinned" on that binding. Pinning is deliberate, so it stays a whole-document save. |
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:POST /toolswith the new client’s endpoint. PollGET /tools/{id}untilworkflow.statusiscurrent— a tool with no head revision yet answers409 WORKFLOW_TOOL_NOT_READYhere.GET /agents/{copy}/workflowfordraft.versionand the binding ids.POST /agents/{copy}/workflow/rebindwith those ids and the new tool.POST …/workflow/validate, thenPOST …/workflow/publish.
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
| Status | Code | Meaning |
|---|---|---|
| 400 | WORKFLOW_REQUEST_INVALID | expected_version is missing or not a positive whole number, bindings is empty or over 64 entries, or a value is not a tool UUID. issues[] names each by path: /expected_version, /bindings, or /bindings/<binding id>. |
| 404 | AGENT_NOT_FOUND | The agent is not in this workspace, or is archived. |
| 404 | WORKFLOW_NOT_FOUND | A tool you named is not in this workspace. The message names the tool and the binding that pointed at it, and issues[] carries one entry per such binding, with code tool_not_found and path /bindings/<binding id>. |
| 409 | WORKFLOW_CONFLICT | The draft moved on. Re-read it and send its version; nothing was written. |
| 409 | WORKFLOW_TOOL_NOT_READY | That tool has no current revision yet. Poll GET /tools/{id}. |
| 422 | WORKFLOW_BINDING_NOT_FOUND | The draft has no binding with that id; the message names it. |
| 422 | WORKFLOW_DOCUMENT_INVALID | This agent has no workflow draft yet. Save one with Save workflow draft first. |
Authorizations
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).