curl --request POST \
--url https://api.goyappr.com/tools/attach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_order": 0,
"config_override": {}
}
'import requests
url = "https://api.goyappr.com/tools/attach"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_order": 0,
"config_override": {}
}
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({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tool_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
execution_order: 0,
config_override: {}
})
};
fetch('https://api.goyappr.com/tools/attach', 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/tools/attach",
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([
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tool_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'execution_order' => 0,
'config_override' => [
]
]),
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/tools/attach"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tool_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"execution_order\": 0,\n \"config_override\": {}\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/tools/attach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tool_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"execution_order\": 0,\n \"config_override\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tools/attach")
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 \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tool_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"execution_order\": 0,\n \"config_override\": {}\n}"
response = http.request(request)
puts response.read_body{
"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>"
}
]
}Attach Tool to Agent
curl --request POST \
--url https://api.goyappr.com/tools/attach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_order": 0,
"config_override": {}
}
'import requests
url = "https://api.goyappr.com/tools/attach"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"execution_order": 0,
"config_override": {}
}
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({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tool_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
execution_order: 0,
config_override: {}
})
};
fetch('https://api.goyappr.com/tools/attach', 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/tools/attach",
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([
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tool_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'execution_order' => 0,
'config_override' => [
]
]),
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/tools/attach"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tool_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"execution_order\": 0,\n \"config_override\": {}\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/tools/attach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tool_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"execution_order\": 0,\n \"config_override\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tools/attach")
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 \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tool_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"execution_order\": 0,\n \"config_override\": {}\n}"
response = http.request(request)
puts response.read_body{
"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>"
}
]
}POST /agents makes is a workflow
agent, and every tool POST /tools makes with a
workflow body is a workflow tool, so both sides are workflow-owned and this
endpoint answers 409 WORKFLOW_TOOL_OWNER_REQUIRED every time. Use
workflow bindings instead — it is four calls,
written out below.tools:update. It exists only for agents and tools that predate
workflow ownership and have not been migrated. Its refusals:
409 WORKFLOW_TOOL_OWNER_REQUIRED— the agent or the tool is a workflow one. Bind the tool withPUT /agents/{id}/workflowand publish withPOST /agents/{id}/workflow/publish; the message says so.409 WORKFLOW_AGENT_BUSY— the agent is being changed right now. Reload it and retry.409 WORKFLOW_BINDINGS_REQUIRED— the agent has moved to workflow tool selection. Edit the workflow instead.404— the agent (AGENT_NOT_FOUND) or the tool (WORKFLOW_NOT_FOUND, the answer every tool route gives) is not in this workspace.400 TOOL_ATTACHMENT_REQUEST_INVALID— the body carries a field other thanagent_id,tool_id,execution_orderandconfig_override(a misspeltexecutionOrderused to be dropped and the tool attached at position 0), or the address carries a query parameter;agent_idortool_idis missing;execution_orderis not a whole number of 0 or more. The message names it, and nothing was attached.
GET /tools?agent_id={id} is the read half of the
same retired mechanism: it lists legacy attachments, so a workflow agent with
tools actively bound and published answers {"data":[]}. That empty list is
not a broken read and not an agent without tools — read
GET /agents/{id}/workflow and look at
draft.document.bindings.
The way that works: bindings
A workflow agent names its tools in its own document. A binding is one entry indocument.bindings saying which tool revision to call and where each of its
arguments comes from; a step or a conversation node then names that binding’s
id.
1. Pick the tool revision. For a tool you know — one you just made, or one
GET /tools?name= found — read
GET /tools/{id}: workflow.current.revision_id is
the tool_revision_id a binding points at, beside the input_schema whose
field names the binding must map and the allowed_channels / allowed_phases
saying where it may sit. POST /tools answers
the same object, so a tool you created is already in hand. To browse instead,
GET /tools/workflow-catalog?limit=20 returns current revisions with the same
fields — in tool-id order, not newest first, so a new tool can be on any page.
2. Read the draft and its version.
curl 'https://api.goyappr.com/agents/AGENT_ID/workflow' \
-H 'Authorization: Bearer YOUR_API_KEY' -H 'x-company-id: COMPANY_ID'
draft.version is the expected_version of the next save, and
draft.document is the document to edit and send back whole.
3. Add the binding and name it from a step. The complete minimal document
is in Save workflow draft
— two edits to the draft you just read: one entry in bindings, and that
entry’s id in the conversation node’s available_binding_ids.
4. Check, then publish.
curl -X POST 'https://api.goyappr.com/agents/AGENT_ID/workflow/validate' \
-H 'Authorization: Bearer YOUR_API_KEY' -H 'x-company-id: COMPANY_ID' \
-H 'Content-Type: application/json' --data '{"expected_version":2}'
{"valid":true,…} means the binding is wired correctly. Publish the same
version with POST /agents/{id}/workflow/publish; nothing reaches a live call
until you do.
See Error Codes.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).
Body
Response
Tool attached