curl --request POST \
--url https://api.goyappr.com/tools/{id}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "11111111-1111-1111-1111-111111111111",
"arguments": {
"callerName": "Test Caller"
},
"context": {
"call_direction": "outbound",
"caller_number": "+972500000000",
"callee_number": "+972500000001",
"call_metadata": {
"contact_id": "test-contact"
},
"call_variables": {
"LeadName": "Test Caller"
}
}
}
'import requests
url = "https://api.goyappr.com/tools/{id}/test"
payload = {
"agent_id": "11111111-1111-1111-1111-111111111111",
"arguments": { "callerName": "Test Caller" },
"context": {
"call_direction": "outbound",
"caller_number": "+972500000000",
"callee_number": "+972500000001",
"call_metadata": { "contact_id": "test-contact" },
"call_variables": { "LeadName": "Test Caller" }
}
}
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: '11111111-1111-1111-1111-111111111111',
arguments: {callerName: 'Test Caller'},
context: {
call_direction: 'outbound',
caller_number: '+972500000000',
callee_number: '+972500000001',
call_metadata: {contact_id: 'test-contact'},
call_variables: {LeadName: 'Test Caller'}
}
})
};
fetch('https://api.goyappr.com/tools/{id}/test', 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/{id}/test",
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' => '11111111-1111-1111-1111-111111111111',
'arguments' => [
'callerName' => 'Test Caller'
],
'context' => [
'call_direction' => 'outbound',
'caller_number' => '+972500000000',
'callee_number' => '+972500000001',
'call_metadata' => [
'contact_id' => 'test-contact'
],
'call_variables' => [
'LeadName' => 'Test Caller'
]
]
]),
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/{id}/test"
payload := strings.NewReader("{\n \"agent_id\": \"11111111-1111-1111-1111-111111111111\",\n \"arguments\": {\n \"callerName\": \"Test Caller\"\n },\n \"context\": {\n \"call_direction\": \"outbound\",\n \"caller_number\": \"+972500000000\",\n \"callee_number\": \"+972500000001\",\n \"call_metadata\": {\n \"contact_id\": \"test-contact\"\n },\n \"call_variables\": {\n \"LeadName\": \"Test Caller\"\n }\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/tools/{id}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"11111111-1111-1111-1111-111111111111\",\n \"arguments\": {\n \"callerName\": \"Test Caller\"\n },\n \"context\": {\n \"call_direction\": \"outbound\",\n \"caller_number\": \"+972500000000\",\n \"callee_number\": \"+972500000001\",\n \"call_metadata\": {\n \"contact_id\": \"test-contact\"\n },\n \"call_variables\": {\n \"LeadName\": \"Test Caller\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tools/{id}/test")
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\": \"11111111-1111-1111-1111-111111111111\",\n \"arguments\": {\n \"callerName\": \"Test Caller\"\n },\n \"context\": {\n \"call_direction\": \"outbound\",\n \"caller_number\": \"+972500000000\",\n \"callee_number\": \"+972500000001\",\n \"call_metadata\": {\n \"contact_id\": \"test-contact\"\n },\n \"call_variables\": {\n \"LeadName\": \"Test Caller\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status_code": 123,
"response_body": "<string>",
"payload_sent": {},
"delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"test_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phase": "before",
"channel": "phone",
"policy": "mock",
"status": "accepted",
"redaction": {
"version": "execution-outcome-v1",
"redacted": true,
"truncated": true
},
"created_at": "2023-11-07T05:31:56Z",
"deadline_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"error_code": "<string>",
"invocation_id": "<string>",
"attempt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"receipt_id": "<string>",
"receipt_settled_test": true,
"resolution": "manual_reconciliation_required",
"replayed": true,
"delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": {
"status": "succeeded",
"effect_status": "not_dispatched",
"output": "<unknown>",
"error_code": "<string>",
"http_status": 123,
"retryable": false,
"output_fields": [
{
"name": "<string>",
"problem": "missing"
}
],
"output_trimmed": [
{
"path": "<string>",
"kept": 2,
"of": 3
}
]
}
}{
"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>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "Webhook delivery failed",
"code": "DOWNSTREAM_HTTP_ERROR",
"details": "<string>",
"status_code": 123,
"downstream_response": "<string>",
"payload_sent": {},
"delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "Webhook delivery failed",
"code": "DOWNSTREAM_HTTP_ERROR",
"details": "<string>",
"status_code": 123,
"downstream_response": "<string>",
"payload_sent": {},
"delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Test Saved Tool
Requires tools:update. Workflow-owned tools accept a WorkflowToolTestRequest
and mandatory Idempotency-Key, returning 202. The request freezes one exact
revision, inputs, policy and original author in the shared execution journal.
Mock is the default; only policy=allowlist with allowed_binding_ids=[“test_tool”]
permits the fixed binding’s real effect. test_tool is a fixed sentinel, not
one of your workflow’s binding ids: a saved-tool test has exactly one binding
and that is its name. Any other value is refused 422 WORKFLOW_TOOL_TEST_INVALID
with issues[0].path “/allowed_binding_ids”, and so is an empty allowlist, which
grants nothing. Unless revision_id pins another revision, inputs and mock_output
are read against the tool’s current schemas before the test is accepted: a
missing required input, an unknown field, a wrong type or a value outside its
enum is 422 WORKFLOW_TOOL_TEST_INVALID with issues[0].path at that value
(/inputs/order_id), not a 202 that settles failed as tool_test_validation_failed.
A field a test does not take, a missing or unknown phase or channel, inputs that is
missing or not an object, and a revision_id that is not an id are 422
WORKFLOW_TOOL_TEST_INVALID with issues[0].path naming it (/colour, /phase, /channel,
/inputs, /revision_id).
Standalone transfers are mock-only.
No fake call/agent is created. Poll the exact Tools-scoped test endpoint.
A lost response must be retried with the same body/key; changed content is 409.
Replaying that key as a different original user/API key returns 404 without
revealing the existing test. Other currently authorized workspace members
may read or cancel with the appropriate Tools scope.
An unknown outcome requires reconciliation, never automatic redispatch.
These tests require a configured local/testing environment; other environments
currently fail closed with 503.
A tool whose creation failed has no revision to test: 409 WORKFLOW_TOOL_NOT_READY,
with the failure named in error. Fix it with PATCH /tools/ first.
Temporary legacy webhook migration boundary only: sends one request to the saved tool’s
configured webhook and returns the exact payload plus a sanitized preview
of the downstream response. The test follows the same payload contract
and HTTP semantics as a live call, including the configured method and
timeout_seconds.
Omitted extraction arguments receive <test_name> placeholders. Supplied
arguments may contain only names declared in the tool’s effective
payload_config.extraction_parameters. When agent_id is supplied, that
agent must belong to the API key’s company and supplies the standard
agent_id / agent_name fields.
Production tool-webhook payload shape (this is what your webhook URL receives when the agent actually invokes the tool during a call, when config.payload_config.include_standard_metadata is true, the default):
{
"company_id": "uuid",
"agent_id": "uuid",
"agent_name": "string",
"call_id": "uuid",
"call_direction": "outbound" | "inbound" | "web_call",
"caller_number": "+972...",
"callee_number": "+972...",
"call_metadata": { "...": "exactly what you passed at POST /calls body.metadata" },
"call_variables": { "LeadName": "...", "AppointmentDate": "..." },
"<your_extraction_param>": "<what the AI extracted>"
}
call_metadata— the object you passed at call creation. Use this to carry CRM IDs (appointment_id, contact_id, calendar_id, etc.) that tool receivers need to route updates back to the right record. The agent never sees these keys (they’re not injected into the prompt).call_variables— the{{VariableName}}values substituted into the system prompt. Useful for echoing context (e.g. Slack alerts: “Noa booked an appointment for ”).- Both are forwarded in real-time — your webhook doesn’t need a follow-up
GET /calls/{id}fetch.
Setting include_standard_metadata: false strips the 9 standard-envelope
fields and sends only static + extraction params. For POST, PUT,
PATCH, and DELETE, the flat payload is sent as JSON. For GET, the
same fields are encoded as query parameters (objects/arrays are compact
JSON strings) and no request body is sent.
curl --request POST \
--url https://api.goyappr.com/tools/{id}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "11111111-1111-1111-1111-111111111111",
"arguments": {
"callerName": "Test Caller"
},
"context": {
"call_direction": "outbound",
"caller_number": "+972500000000",
"callee_number": "+972500000001",
"call_metadata": {
"contact_id": "test-contact"
},
"call_variables": {
"LeadName": "Test Caller"
}
}
}
'import requests
url = "https://api.goyappr.com/tools/{id}/test"
payload = {
"agent_id": "11111111-1111-1111-1111-111111111111",
"arguments": { "callerName": "Test Caller" },
"context": {
"call_direction": "outbound",
"caller_number": "+972500000000",
"callee_number": "+972500000001",
"call_metadata": { "contact_id": "test-contact" },
"call_variables": { "LeadName": "Test Caller" }
}
}
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: '11111111-1111-1111-1111-111111111111',
arguments: {callerName: 'Test Caller'},
context: {
call_direction: 'outbound',
caller_number: '+972500000000',
callee_number: '+972500000001',
call_metadata: {contact_id: 'test-contact'},
call_variables: {LeadName: 'Test Caller'}
}
})
};
fetch('https://api.goyappr.com/tools/{id}/test', 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/{id}/test",
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' => '11111111-1111-1111-1111-111111111111',
'arguments' => [
'callerName' => 'Test Caller'
],
'context' => [
'call_direction' => 'outbound',
'caller_number' => '+972500000000',
'callee_number' => '+972500000001',
'call_metadata' => [
'contact_id' => 'test-contact'
],
'call_variables' => [
'LeadName' => 'Test Caller'
]
]
]),
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/{id}/test"
payload := strings.NewReader("{\n \"agent_id\": \"11111111-1111-1111-1111-111111111111\",\n \"arguments\": {\n \"callerName\": \"Test Caller\"\n },\n \"context\": {\n \"call_direction\": \"outbound\",\n \"caller_number\": \"+972500000000\",\n \"callee_number\": \"+972500000001\",\n \"call_metadata\": {\n \"contact_id\": \"test-contact\"\n },\n \"call_variables\": {\n \"LeadName\": \"Test Caller\"\n }\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/tools/{id}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"11111111-1111-1111-1111-111111111111\",\n \"arguments\": {\n \"callerName\": \"Test Caller\"\n },\n \"context\": {\n \"call_direction\": \"outbound\",\n \"caller_number\": \"+972500000000\",\n \"callee_number\": \"+972500000001\",\n \"call_metadata\": {\n \"contact_id\": \"test-contact\"\n },\n \"call_variables\": {\n \"LeadName\": \"Test Caller\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tools/{id}/test")
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\": \"11111111-1111-1111-1111-111111111111\",\n \"arguments\": {\n \"callerName\": \"Test Caller\"\n },\n \"context\": {\n \"call_direction\": \"outbound\",\n \"caller_number\": \"+972500000000\",\n \"callee_number\": \"+972500000001\",\n \"call_metadata\": {\n \"contact_id\": \"test-contact\"\n },\n \"call_variables\": {\n \"LeadName\": \"Test Caller\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status_code": 123,
"response_body": "<string>",
"payload_sent": {},
"delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"test_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phase": "before",
"channel": "phone",
"policy": "mock",
"status": "accepted",
"redaction": {
"version": "execution-outcome-v1",
"redacted": true,
"truncated": true
},
"created_at": "2023-11-07T05:31:56Z",
"deadline_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"error_code": "<string>",
"invocation_id": "<string>",
"attempt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"receipt_id": "<string>",
"receipt_settled_test": true,
"resolution": "manual_reconciliation_required",
"replayed": true,
"delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": {
"status": "succeeded",
"effect_status": "not_dispatched",
"output": "<unknown>",
"error_code": "<string>",
"http_status": 123,
"retryable": false,
"output_fields": [
{
"name": "<string>",
"problem": "missing"
}
],
"output_trimmed": [
{
"path": "<string>",
"kept": 2,
"of": 3
}
]
}
}{
"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>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "Webhook delivery failed",
"code": "DOWNSTREAM_HTTP_ERROR",
"details": "<string>",
"status_code": 123,
"downstream_response": "<string>",
"payload_sent": {},
"delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "Webhook delivery failed",
"code": "DOWNSTREAM_HTTP_ERROR",
"details": "<string>",
"status_code": 123,
"downstream_response": "<string>",
"payload_sent": {},
"delivery_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}| Your tool | Contract | Answers |
|---|---|---|
Workflow-owned (workflow_version: "workflow_v1" on Get tool) | Asynchronous. Accepts the test and hands you an id to poll. Mock by default — no HTTP request leaves the platform unless you ask for one. | 202 with test_id, then Get saved test |
A legacy webhook tool (type/config, no workflow member) | Synchronous. Delivers the webhook there and then and returns the outcome inline. | 200 with payload_sent, or 502 / 504 |
payload_sent.Workflow-owned tools
Workflow-owned tools use one standalone test in the shared execution journal, with the same preparation, claim and receipt path as workflow actions. This creates no fake agent or phone/web call. Required scope:tools:update.
curl -X POST https://api.goyappr.com/tools/TOOL_ID/test \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-company-id: COMPANY_ID" \
-H "Idempotency-Key: saved-tool-test-001" \
-H "Content-Type: application/json" \
-d '{"phase":"before","channel":"phone","inputs":{"order_id":"example-order"},"mock_output":{"found":true},"policy":"mock","allowed_binding_ids":[]}'
409 WORKFLOW_TOOL_NOT_READY, and error names the failure (for example connection_unavailable). Fix it with PATCH /tools/{id} first.
The 202 response includes local test_id, run_id, tool_id, and frozen revision_id. Poll Get saved test. The optional revision_id pins a specific revision of this tool; otherwise the current head is frozen at acceptance. Same-key replay retains the original revision even after the head changes. Altering the accepted body returns 409; replay under a different original user/API key returns 404 without revealing the existing test.
Mock is the default and makes no HTTP/app request. It validates typed input and mock output against the frozen schemas. Unless revision_id pins another revision, inputs and mock_output are also read against the tool’s current schemas before the test is accepted: a missing required input, a field the schema does not have, a value of the wrong type or outside its enum answers 422 WORKFLOW_TOOL_TEST_INVALID with issues[0].path at that value — /inputs/order_id, /mock_output/found — instead of 202 and a test that later settles failed. The body itself is read first: a field a test does not take, a missing or unknown phase or channel, inputs that is missing or not an object (send {} when the tool takes none) and a revision_id that is not an id each answer 422 WORKFLOW_TOOL_TEST_INVALID with issues[0].path naming it. policy: "allowlist" with allowed_binding_ids: ["test_tool"] is explicit permission for this exact binding’s effect through the shared executor; an empty allowlist does not grant effects. Never use real here. Fixed account, action, version, URL/destination and fixed inputs cannot be overridden.
"test_tool" is the whole of allowed_binding_ids. A saved-tool test runs the
tool on its own, outside any workflow, so it has exactly one binding and
test_tool is that binding’s id — it is a fixed word, not a binding id copied
out of your published workflow. The field accepts only [] or ["test_tool"],
and only ["test_tool"] grants the effect:policy | allowed_binding_ids | What happens |
|---|---|---|
"mock" (default) | [] (default) | Nothing leaves the platform. Inputs and mock_output are checked against the frozen schemas. With no mock_output, the mock answers the Output schema’s minimal value — {} for {"type": "object"} — and the test settles succeeded. When the Output schema has required members, send mock_output with them: leaving it out answers 400 WORKFLOW_TOOL_TEST_INVALID, issues[0] field_required at /mock_output, naming them, and nothing is started. |
"allowlist" | [] | 422 WORKFLOW_TOOL_TEST_INVALID at /allowed_binding_ids. An empty allowlist grants nothing, so the test could only be blocked; use "mock". |
"allowlist" | ["test_tool"] | The one real request or app action is performed. |
| anything else | any binding id of your own | 422 WORKFLOW_TOOL_TEST_INVALID, with issues[0].path naming /policy or /allowed_binding_ids. |
policy: "real" is not a value this endpoint takes.phase and channel are validation placement, not live-call authority. Standalone transfer tests require during/phone and are mock-only. A real transfer requires an actual live phone assignment.
| Boundary | Behavior |
|---|---|
| Request | At most 512 KiB; inputs and mock_output are each at most 256 KiB. Preserve exact JSON types/numbers. |
| Concurrency | Up to eight unexpired active tests per workspace; excess admission returns 429. |
| Authorization | Start/replay binds the original author. Poll/cancel rechecks the current member’s workspace tools scope and exact tool/test identity; another authorized member may read or cancel. A run ID does not grant call-history access. |
| Cancellation | Stops new dispatch, not an effect already started. History and receipts remain. |
| Refused | An endpoint that answered with an error (4xx or 5xx) refused the request: the test settles failed with the answer’s http_status, and names its delivery in delivery_id. No automatic retry; the delivery can be sent again with POST /deliveries/{id}/retry. |
| Answered, but unusable | An endpoint that answered 2xx with a body the tool could not use — one that does not match the tool’s Outputs (output_schema_invalid), is not JSON (invalid_json_response) or is too large for Yappr to hold (response_too_large: over 256 KB, or more values than it holds that no cut can fit) — got the request and acted on it: the test settles failed with that error_code and the answer’s http_status (and, on output_schema_invalid, outcome.output_fields naming the Output fields it left out or did not match), and its delivery reads failed with the same reason. Fix the tool’s Outputs (or what the endpoint answers) and run a new test; the delivery is not sent again, since the endpoint already accepted it. |
| Answer larger than Yappr holds | A tool answer is held to 4,096 values, and a list to 256 items. When the agent calls a tool during the conversation (a test with phase: "during" shows it) and the answer is over that, it is not refused: the first items of its largest list are kept, the rest of the answer is untouched, and outcome.output_trimmed names each cut list (path, kept, of). kept is what the agent receives; the output a test displays is shortened separately for display (a list shows at most 64 items). The agent is told the list is partial, and a rule or a later step never reads a cut list, or an item past the cut, as if it were whole. Not cut, and refused as before (response_too_large for an HTTP tool, broker_output_contract_invalid for a connected app): an answer over 256 KB; an object with more than 256 members, nesting deeper than 32 levels, one item that is itself too large, or more than ten lists to cut; an answer to a step before or after the call (a test with phase: "before" or "after") or inside a sequence; and the calendar availability check (its list is the busy periods, and a free slot is the absence of one). To fix it, return fewer items, put a long list in a field of its own, page it, or narrow the request (a shorter window). |
| Unknown | Only when no answer came back: the test reads unknown with resolution: "manual_reconciliation_required" and error_code http_timeout (nothing within the tool’s timeout_ms; a test settled before October 2026 that read dispatch_timeout reads http_timeout too) or http_network_error (the connection dropped before an answer), and its delivery reads unknown too. Your endpoint may or may not have acted on it, so check there first; POST /deliveries/{id}/retry sends it again only with {"acknowledge_unknown": true}. No automatic retry. A late receipt can be displayed without rewriting settled status. |
| Blocked | Nothing was sent: the request never left (a host that resolved to a private address, a deadline that passed before sending, an allowlist the binding is not on). There is no delivery. |
| Availability | The current isolated test control/worker supports local/testing environments; unconfigured/unsupported environments return 503. |
call member a real call sends (see
Add a tool contract revision), with "test": true
inside it. That member is the one reliable way for your endpoint to tell a rehearsal from a
call; a real call never carries it. A test’s call.call_id and call.agent_id are null —
it serves no call and no agent.
An empty answer (a 204, or a 200 with no body) is {} for a tool whose Outputs declare no
fields, so it passes; a tool that declares Outputs reads it as an answer without them.
A real test of a webhook (http) tool — policy: "allowlist" with ["test_tool"] — is
recorded in the delivery log once the request has actually gone out and settled:
List Deliveries returns it with call_id: null,
source: "test" and the tool’s tool_id, exactly like a legacy test, and the test’s
delivery_id names that row (see Get saved test): one request,
one verdict on both — delivered and succeeded, failed and failed, unknown and unknown. A mock test sends nothing, and a connected-app action is not a webhook, so
neither writes a row there and delivery_id stays null.
Outcome output is a bounded, redacted preview—not raw vendor evidence, a receipt replacement, or a new execution input. Check redaction, receipt_settled_test, and resolution; generic success does not imply asynchronous remote work finished.
Legacy webhook tools only
Everything below this line is the synchronous contract, and it applies only to existing legacy webhook tools — the ones saved withtype and config
rather than workflow. A workflow-owned tool never answers this way: it
answers 202 and is polled. This half of the page is a migration boundary and
will be retired with the tools it describes.
The following contract applies only to existing legacy webhook tools. It cannot execute a workflow-owned tool or use a workflow-owned agent as override authority. Send one request with the existing webhook payload contract. The tool must belong to the API key’s company.
Required scope: tools:update.
Legacy: basic test
With no request body, Yappr generates a<test_name> value for every configured extraction parameter:
curl -X POST "https://api.goyappr.com/tools/TOOL_ID/test" \
-H "Authorization: Bearer $YAPPR_API_KEY"
include_standard_metadata, and timeout_seconds (default 30 seconds; allowed range 1–60).
The attempt is recorded in the delivery log like any other. It happens on no call, so
List Deliveries returns it with call_id: null and
source: "test" — ?source=test&tool_id=TOOL_ID is every rehearsal you have run for this
tool, and ?source=live leaves them out of a delivery-health report.
Configured headers may include authorization and custom content types, but request-routing/framing headers (Host, Content-Length, Transfer-Encoding, Connection, Expect, Keep-Alive, Proxy-*, TE, Trailer, Upgrade) are rejected when the tool is saved.
Webhook targets must be final public HTTP(S) endpoints. Localhost, cloud-metadata hosts, non-global literal or DNS-resolved addresses, mixed public/private DNS answers, and redirects are rejected. Configure the final destination URL directly; redirects are not followed.
Legacy: supply representative values
Use an optional JSON body when the receiver needs realistic argument or call-context samples:curl -X POST "https://api.goyappr.com/tools/TOOL_ID/test" \
-H "Authorization: Bearer $YAPPR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "11111111-1111-1111-1111-111111111111",
"arguments": {
"callerName": "Test Caller",
"requestedDate": "next Tuesday"
},
"context": {
"call_id": null,
"call_direction": "outbound",
"caller_number": "+972500000000",
"callee_number": "+972500000001",
"call_metadata": { "contact_id": "test-contact" },
"call_variables": { "LeadName": "Test Caller" }
}
}'
| Field | Required | Notes |
|---|---|---|
agent_id | no | Must identify an agent in the API key’s company. Supplies agent_id and agent_name in standard metadata. |
arguments | no | Flat string values keyed only by names in config.payload_config.extraction_parameters. Nested/object values are rejected. Omitted configured names receive <test_name> placeholders. |
context.call_id | no | UUID or null. |
context.call_direction | no | inbound, outbound, web_call, or null; defaults to outbound. |
context.caller_number | no | String or null. |
context.callee_number | no | String or null. |
context.call_metadata | no | Object matching the metadata your call creation request would supply. |
context.call_variables | no | Object matching the variables your call creation request would supply. |
Legacy: production parity
Wheninclude_standard_metadata is true (the default), payload_sent includes the real company id, the supplied agent context (or null agent fields), call context, configured static parameters, and extraction arguments. With it set to false, only static and extraction parameters are sent.
POST,PUT,PATCH, andDELETEtools receive the flat payload as JSON.GETtools receive the same fields as query parameters and no request body. Object and array values are compact JSON strings.- Configured request headers are used for delivery but are never echoed in the API response.
Legacy: success response
Any downstream HTTP2xx status returns 200 from this endpoint. Redirects and every other non-2xx status are delivery failures:
{
"success": true,
"status_code": 200,
"response_body": "{\"ok\":true}",
"payload_sent": {
"company_id": "22222222-2222-2222-2222-222222222222",
"agent_id": "11111111-1111-1111-1111-111111111111",
"agent_name": "Scheduling Agent",
"call_id": null,
"call_direction": "outbound",
"caller_number": "+972500000000",
"callee_number": "+972500000001",
"call_metadata": { "contact_id": "test-contact" },
"call_variables": { "LeadName": "Test Caller" },
"callerName": "Test Caller",
"requestedDate": "next Tuesday"
},
"delivery_id": "33333333-3333-3333-3333-333333333333"
}
payload_sent is the exact flat object delivered. delivery_id can be null if delivery logging failed; logging failure does not turn a successful downstream request into a failure.
Legacy: delivery failure
A downstream HTTP or network failure returns502; a timeout returns 504:
{
"error": "Webhook delivery failed",
"code": "DOWNSTREAM_HTTP_ERROR",
"details": "Webhook returned HTTP 500",
"status_code": 500,
"downstream_response": "{\"error\":\"temporary failure\"}",
"payload_sent": { "callerName": "Test Caller" },
"delivery_id": "33333333-3333-3333-3333-333333333333"
}
code is one of DOWNSTREAM_HTTP_ERROR, WEBHOOK_NETWORK_ERROR, or WEBHOOK_TIMEOUT. Downstream body previews are sanitized and length-capped. A host that resolves to a loopback, private or link-local address — when the test starts or when the request connects (a name that rebinds) — is not a delivery: nothing is sent and the test answers 400 with error “Webhook URL’s hostname resolves to a loopback, private or link-local address; use a public address”.
Legacy: errors
| HTTP | When |
|---|---|
400 | Invalid JSON/body shape, unknown argument/context field, invalid saved configuration, a local/non-public literal webhook target, or a host that resolves to a non-public address (checked again when the request connects; nothing is sent). |
401 | MISSING_KEY, INVALID_KEY or EXPIRED_KEY — the key was not accepted. |
403 | INSUFFICIENT_SCOPE — the key does not hold tools:update, and the message names it. |
404 | Tool not found, or the optional agent does not belong to the company. |
404 WORKFLOW_TOOL_ARCHIVED | The tool is archived, so it cannot be tested. Answered before the body is read. Restore it with POST /tools/{id}/restore, then test it; GET /tools?workflow=true&status=archived lists the archived tools. |
502 | Downstream endpoint returned a redirect/other non-2xx status, or could not be reached. Redirects are not followed; configure the final public destination directly. |
504 | Downstream endpoint exceeded the configured timeout. |
500 | The internal test-delivery service returned an invalid response. |
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).
Headers
Body
- Option 1
- Option 2
The one binding a saved-tool test has, whose id is always the literal test_tool - a binding id out of a workflow is refused. ["test_tool"] with policy allowlist permits that binding's single real effect; [] (the default, and the only value a mock test may send) keeps the test mocked; [] with policy allowlist grants nothing and is refused 422 at /allowed_binding_ids. Transfer effects are always forbidden in saved-tool tests.
1Response
Downstream endpoint returned an HTTP 2xx status