curl --request POST \
--url https://api.goyappr.com/tools/{id}/workflow-revisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_revision": 2,
"contract": {
"input_schema": {},
"output_schema": {},
"allowed_phases": [],
"allowed_channels": [],
"timeout_ms": 123,
"effect": "<string>",
"replay_safe": true,
"include_call_context": true
}
}
'import requests
url = "https://api.goyappr.com/tools/{id}/workflow-revisions"
payload = {
"expected_revision": 2,
"contract": {
"input_schema": {},
"output_schema": {},
"allowed_phases": [],
"allowed_channels": [],
"timeout_ms": 123,
"effect": "<string>",
"replay_safe": True,
"include_call_context": True
}
}
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_revision: 2,
contract: {
input_schema: {},
output_schema: {},
allowed_phases: [],
allowed_channels: [],
timeout_ms: 123,
effect: '<string>',
replay_safe: true,
include_call_context: true
}
})
};
fetch('https://api.goyappr.com/tools/{id}/workflow-revisions', 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}/workflow-revisions",
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_revision' => 2,
'contract' => [
'input_schema' => [
],
'output_schema' => [
],
'allowed_phases' => [
],
'allowed_channels' => [
],
'timeout_ms' => 123,
'effect' => '<string>',
'replay_safe' => true,
'include_call_context' => true
]
]),
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}/workflow-revisions"
payload := strings.NewReader("{\n \"expected_revision\": 2,\n \"contract\": {\n \"input_schema\": {},\n \"output_schema\": {},\n \"allowed_phases\": [],\n \"allowed_channels\": [],\n \"timeout_ms\": 123,\n \"effect\": \"<string>\",\n \"replay_safe\": true,\n \"include_call_context\": true\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}/workflow-revisions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision\": 2,\n \"contract\": {\n \"input_schema\": {},\n \"output_schema\": {},\n \"allowed_phases\": [],\n \"allowed_channels\": [],\n \"timeout_ms\": 123,\n \"effect\": \"<string>\",\n \"replay_safe\": true,\n \"include_call_context\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tools/{id}/workflow-revisions")
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_revision\": 2,\n \"contract\": {\n \"input_schema\": {},\n \"output_schema\": {},\n \"allowed_phases\": [],\n \"allowed_channels\": [],\n \"timeout_ms\": 123,\n \"effect\": \"<string>\",\n \"replay_safe\": true,\n \"include_call_context\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 2,
"name": "<string>",
"kind": "http",
"input_schema": {},
"output_schema": {},
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"allowed_phases": [
"before"
],
"allowed_channels": [
"phone"
],
"timeout_ms": 30000,
"effect": "<string>",
"replay_safe": false,
"include_call_context": true
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<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>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}Add a Tool Contract Revision
Requires tools:update. Adds one immutable revision to a saved tool that was created through the earlier tool endpoints, so it can be used inside a workflow. Send the revision number you last read as expected_revision (null when the tool has none yet); if another writer has added a revision since, nothing is written. Name, description and private endpoint configuration come from the saved tool and are refused if sent. Transfer tools always come back restricted to a live call on a phone, whatever the request asked for. Previously published workflows keep the exact revision they pinned.
curl --request POST \
--url https://api.goyappr.com/tools/{id}/workflow-revisions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_revision": 2,
"contract": {
"input_schema": {},
"output_schema": {},
"allowed_phases": [],
"allowed_channels": [],
"timeout_ms": 123,
"effect": "<string>",
"replay_safe": true,
"include_call_context": true
}
}
'import requests
url = "https://api.goyappr.com/tools/{id}/workflow-revisions"
payload = {
"expected_revision": 2,
"contract": {
"input_schema": {},
"output_schema": {},
"allowed_phases": [],
"allowed_channels": [],
"timeout_ms": 123,
"effect": "<string>",
"replay_safe": True,
"include_call_context": True
}
}
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_revision: 2,
contract: {
input_schema: {},
output_schema: {},
allowed_phases: [],
allowed_channels: [],
timeout_ms: 123,
effect: '<string>',
replay_safe: true,
include_call_context: true
}
})
};
fetch('https://api.goyappr.com/tools/{id}/workflow-revisions', 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}/workflow-revisions",
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_revision' => 2,
'contract' => [
'input_schema' => [
],
'output_schema' => [
],
'allowed_phases' => [
],
'allowed_channels' => [
],
'timeout_ms' => 123,
'effect' => '<string>',
'replay_safe' => true,
'include_call_context' => true
]
]),
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}/workflow-revisions"
payload := strings.NewReader("{\n \"expected_revision\": 2,\n \"contract\": {\n \"input_schema\": {},\n \"output_schema\": {},\n \"allowed_phases\": [],\n \"allowed_channels\": [],\n \"timeout_ms\": 123,\n \"effect\": \"<string>\",\n \"replay_safe\": true,\n \"include_call_context\": true\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}/workflow-revisions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision\": 2,\n \"contract\": {\n \"input_schema\": {},\n \"output_schema\": {},\n \"allowed_phases\": [],\n \"allowed_channels\": [],\n \"timeout_ms\": 123,\n \"effect\": \"<string>\",\n \"replay_safe\": true,\n \"include_call_context\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/tools/{id}/workflow-revisions")
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_revision\": 2,\n \"contract\": {\n \"input_schema\": {},\n \"output_schema\": {},\n \"allowed_phases\": [],\n \"allowed_channels\": [],\n \"timeout_ms\": 123,\n \"effect\": \"<string>\",\n \"replay_safe\": true,\n \"include_call_context\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tool_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": 2,
"name": "<string>",
"kind": "http",
"input_schema": {},
"output_schema": {},
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"allowed_phases": [
"before"
],
"allowed_channels": [
"phone"
],
"timeout_ms": 30000,
"effect": "<string>",
"replay_safe": false,
"include_call_context": true
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<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>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
],
"warnings": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"node_id": "<string>",
"label": "<string>",
"tool_name": "<string>",
"field": "<string>"
}
]
}tools:update. Adds one immutable contract revision to a tool that was created through the earlier tool endpoints, so a workflow can use it. Only tools that call your own endpoint, or transfer a call, can take one — anything else returns 422 WORKFLOW_TOOL_IMPORT_REQUIRED.
curl -X POST https://api.goyappr.com/tools/TOOL_ID/workflow-revisions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-company-id: COMPANY_ID" \
-H "Content-Type: application/json" \
-d '{
"expected_revision": 3,
"contract": {
"input_schema": { "type": "object", "properties": { "order_id": { "type": "string" } }, "required": ["order_id"] },
"output_schema": { "type": "object", "properties": { "status": { "type": "string" } } },
"allowed_phases": ["during"],
"allowed_channels": ["phone", "web"],
"timeout_ms": 20000
}
}'
| Field | Required | Notes |
|---|---|---|
expected_revision | yes | The highest revision you last read, or null when the tool has none yet. If another writer added a revision in the meantime, nothing is written and you get 409 WORKFLOW_CONFLICT. |
contract.input_schema | yes | Must be an object. |
contract.output_schema | yes | Must be an object. |
contract.allowed_phases | no | Any of before, during, after. Defaults to all three. |
contract.allowed_channels | no | phone, web, or both. Defaults to both. |
contract.timeout_ms | no | Defaults to 30000. |
contract.effect | no | Defaults to write. |
contract.replay_safe | no | Defaults to false. |
contract.include_call_context | no | Defaults to true. Send false to stop this tool’s requests carrying call. Anything other than true or false is 400 WORKFLOW_REQUEST_INVALID, and sending true records nothing — the revision comes back without the field, exactly as it did before the field existed. |
400 WORKFLOW_REQUEST_INVALID, with the key in issues[0].path (/name); so is a missing contract (/contract) or a bad expected_revision (/expected_revision). Name, description and the private endpoint configuration come from the saved tool and cannot be set here.
Transfer tools always come back restricted to a live call on a phone, and marked as ending the call, whatever the request asked for. Revisions are immutable and additive: workflows that already pinned an earlier revision keep it until they are published again.
What your endpoint receives
A request Yappr makes to this tool’s endpoint carries the call it is serving, as onecall
member alongside your declared inputs:
{
"order_id": "A-1042",
"call": {
"version": "1",
"phase": "during",
"company_id": "6c0f…",
"agent_id": "efb4…",
"agent_name": "Reception",
"call_id": "9a71…",
"call_direction": "inbound",
"caller_number": "+972500000001",
"callee_number": "+972500000002",
"call_metadata": { "source": "ads" },
"call_variables": { "first_name": "Dana" },
"channel": "phone",
"started_at": "2026-09-16T08:00:00Z"
}
}
{{call.field}} in what you
configured, so there is still one definition to learn.
Turn it off for one tool with "include_call_context": false in the contract. Your mapped
inputs are unaffected: a fixed input that quotes {{call.caller_number}} still arrives filled
in, because that is a value you asked for rather than the whole call.
Read phase first. The package is graded by what that moment can know, and a member the
phase cannot know is absent rather than null — so a missing call_id means there is no call
yet, while "caller_number": "" means the call had no number to give (a browser call, or the
preview gap above).
| Phase | What it adds |
|---|---|
before | The workspace, the agent, the direction, both numbers, the request’s call_metadata and call_variables, and the channel. No call_id: the call does not exist yet, so nothing that lives on the call row — including phone_number_id, lead_id and status — is present either. |
during | call_id, started_at, status (the call’s live state — e.g. "ringing", "in_progress" — not the signal it has stopped), and phone_number_id / lead_id when the call has them. |
after | ended_at, duration_seconds, ended_by, close_reason, and each result as it becomes ready: transcript, analysis, recording_url, lead, disposition, billing. |
company_id, agent_id,
agent_name, call_id, call_direction, caller_number, callee_number, call_metadata
and call_variables — keep their names and their empty-string and empty-object convention
inside call, so an endpoint written against that payload keeps parsing. A declared input of
your own named call wins over the package.
A tool test sends the same shape with "test": true inside call, so your endpoint can tell
a rehearsal from a call. A real call never carries that member. A test serves no call and no
agent, so its call_id (from the during phase on) and agent_id are null, not "".
The full field list is the CallPackage schema in the OpenAPI document.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
Exactly these two properties are accepted; any other property is rejected. Identity, description and private endpoint configuration are read from the saved tool and cannot be supplied here.
Response
The new revision.
One immutable contract revision of a saved tool. Private endpoint configuration (URL, header values, transfer destination) is never included: it stays on the tool itself and is supplied by Yappr at call time.
Whether every request this tool makes carries the call under call (see CallPackage). Returned only when it is false, because true is what every tool does unless you say otherwise. Turn it off for an endpoint that wants nothing but the inputs you mapped; the inputs themselves still read the call through {{call.field}} either way.