Skip to main content
POST
Create tool
Create one reusable HTTP endpoint, connected-app action, or named transfer. Required scope: tools:create. Send x-company-id for the active workspace and a fresh Idempotency-Key (16–128 letters, digits, _ or -). IDs and revision numbers are assigned by Yappr.

Two bodies, one endpoint — send workflow

This endpoint still accepts two different request bodies, and which one you send is decided by one key: Never send both. A body that puts http, app or transfer at the top level is refused with /workflow and told to move it, rather than being read as the legacy schema. One difference bites immediately: a legacy body’s name is normalised to camelCase, so critic-order-lookup is stored and returned as criticOrderLookup. A workflow body’s name is stored exactly as given, trimmed only. Brand-new legacy tools are still creatable today. That is deliberate, so an existing integration keeps working through the migration — it is not a recommendation. A tool created that way needs a contract revision added before any agent can use it, so sending the legacy body is a round trip you pay for once and then pay for again.

Tool names are not unique

Two tools in one workspace may carry the same name, and a create that reuses one is not refused — production workspaces already hold pairs that share a name, and refusing the second would break the integrations that made them. It is still worth knowing about, because an agent’s builder picks a tool by name: two tools called Order lookup are told apart only by an id nobody reads. So a create whose name is already taken answers 201 (or 202 while the tool is still being built) with the tool exactly as always, plus a warnings array:
warnings is absent when there is nothing to say, so treat it as optional and never as a refusal — the tool in the same response was created either way. Matching is on the trimmed name exactly as stored; archived tools are not counted. The array is capped at twenty named tools. Idempotency is the other half of this. A repeated Idempotency-Key returns the first tool rather than making a second one, so a retry after a timeout costs nothing. Two creates with different keys are two deliberate creates and make two tools, whatever they are called.

The workflow body

Reading a tool back never returns its URL in full. An HTTP tool’s saved configuration.url is projected as url_display (scheme, host and path) plus url_redacted and configured_query_names, and every read carries url_replacement_required: true — a constant that states the rule rather than a condition: changing the URL later means sending the whole URL again, query string included, and keeping it means omitting the field. See Get tool. Headers behave the same way: the names come back, the values never do. App discovery does not imply execution eligibility. An action must have supported, reviewed completion, effect and file semantics. Its full raw contract stays private; the model schema excludes fields fixed by the tool owner. Neither model arguments nor test input can replace the saved account, action, version or fixed values.

A transfer tool with its own transfer code

On a call that arrived through an extension endpoint, a transfer to an extension uses the transfer code set on the endpoint (register.pbx_feature_code), so a transfer tool needs nothing for it. Give a tool a code of its own only when this one transfer needs a different one:
  • The tool’s code and hang-up time replace the endpoint’s as a pair: leave out pbx_feature_code_hangup_after_secs and this tool waits for your phone system, whatever the endpoint sets.
  • destination must be a SIP address whose extension a keypad can dial: up to 32 digits, * or # before the @.
  • The rules are the endpoint’s: pbx_feature_code is 1 to 32 characters of 0-9, *, #, A-D and the pauses w and W, with at least one key and {extension} at most once; the hang-up time is a whole number from 1 to 10.
  • A fault is a 422 WORKFLOW_TOOL_REQUEST_INVALID with an issue at /workflow/<field>: transfer_method_invalid, pbx_feature_code_missing, pbx_feature_code_invalid, transfer_extension_not_dialable (at /workflow/destination), pbx_feature_code_hangup_after_secs_invalid or pbx_feature_code_hangup_after_secs_without_code.
  • A read shows them under workflow.current. "transfer_method": "auto" on an update removes them, so the endpoint’s code applies again (Update tool).
  • A transfer tool an agent brought with it when it moved to a workflow keeps the code it had, its hang-up time included.

Google Calendar and Gmail actions

Six actions run the way Yappr’s own calendar and email integrations did: Google Calendar’s Create event, List events, Find free slots, List calendars and Delete event, and Gmail’s Send email. They run on the version GET /tool-apps/{app} offers by default (20260902_00 for Google Calendar, 20260911_00 for Gmail); a tool on any other version of them is refused (parity_version_unpinned). Yappr fixes their provider settings: no video-meeting room and the organizer not added as a guest on a new event, one calendar searched, plain-text email. In fixed_inputs you may choose only the calendar (calendar_id; calendarId on List events; items: ["<calendar id>"] on Find free slots) and the time zone (timezone; timeZone on List events), an IANA name such as Asia/Jerusalem. Anything else is refused with configured_fields_invalid. Without a time zone, the tool takes your workspace’s time zone when it is saved. Times the model sends without an offset are read in that zone, and results come back as wall-clock times in it, labelled with timeZone. Each time is read at the offset its own date has in that zone, so a booking on the far side of a daylight-saving change keeps its hour. A time the clocks skip (02:30 on the night they go forward) is read as the moment it would have been, 03:30. A time the clocks repeat (01:30 on the night they go back) is its first occurrence in a search window; Create event refuses it with parity_datetime_ambiguous and books nothing, since either 01:30 could be meant. Reading the tool back shows every fixed value, the zone included, so saving it again keeps that zone; send "fixed_inputs": {} with PATCH /tools/{id} to take the workspace’s current zone instead.

When the body is wrong

A body Yappr can read but not accept answers 422 WORKFLOW_TOOL_REQUEST_INVALID with an issues[], one entry per field at fault, each with a JSON pointer:
No tool is created by a refusal of this kind, and every field at fault is in the one answer. An HTTP tool whose configuration.url is on localhost, a private network (10.x, 172.16–31.x, 192.168.x), a link-local, a cloud-metadata or another reserved address (IPv6 outside global unicast, 6to4 2002::/16, NAT64 64:ff9b::/96) is refused here too, with the issue code url_not_public at /workflow/configuration/url: our servers can never reach it. A hostname is read for what it resolves to as well as how it is written: a name whose DNS answers include such an address (127.0.0.1.nip.io) is refused with the same code. A rebinding name, one that answers a public address now and a private one later (…rbndr.us), is built when its answer is public; every call resolves it again and connects only to the public address it checked, so an answer that has turned private is refused there and nothing is sent — a test reads blocked, with outcome.error_code url_resolves_private. A host written as a shortened, octal or hexadecimal number (1.2.3, 01.2.3.4) is refused the same way with url_host_form: write it as a hostname or as four plain decimal numbers. A number that spells loopback or a private address in any of those forms (2130706433, 0177.0.0.1, 0x7f000001) is url_not_public. A request carrying some of those forms can be stopped by our network edge before it reaches the API, with an HTML 403 instead of this JSON answer; nothing is created either way. What can only be found while the tool is built — a connected-account action that is not eligible, a connection that is not ready, a schema the builder rejects — answers 422 WORKFLOW_TOOL_NOT_BUILT. The body is the tool’s own document, so its id is the tool to fix, with error saying what to do and issues[0] naming the field; issues[0].code is the same reason as workflow.error_code:
That answer used to carry only workflow.error_code, under the fallback code UNPROCESSABLE_REQUEST. An app tool whose metadata_id or connection_id names nothing — an id that is not an action from Get app action, or not one of this workspace’s connected accounts — is a mistake in the request, not a tool that failed. It answers 400 WORKFLOW_TOOL_REFERENCE_INVALID with an issues[] entry for each field at fault, and writes nothing:
A tool that did fail — the account was not connected yet, say — is not a dead end. Connect the account, then send the whole tool again with PATCH /tools/{id} to build it under the same id, or remove it with DELETE /tools/{id}. What the tool does always lives under workflow. A body that puts http, app or transfer at the top level is refused with /workflow and told to move it, rather than being read as the legacy type/config schema. workflow.input_schema must declare "type": "object" at its root, as this reference has always described it. A schema carrying only properties is now refused here, by name, instead of being accepted and failing later while the tool is built. 201 means the tool was built while the request waited and has a current revision: bind it now. Every create the build service takes answers 201, after waiting a few seconds at most for its build, so identical creates answer the same status. 202 means the create is queued and not built yet — the build service could not take it right now, or the build was still running when that wait ended. Poll GET /tools/{id} with the returned id until workflow.status is current (or failed). After a lost response, resend the identical body and key: Yappr returns the original identity, never a second tool. Changed content with the same key returns 409; invalid contracts may return 422 with a durable failed state. The accepted request is limited to 256 KiB. Schemas preserve nested types, required fields, defaults, combinators and exact JSON numbers. Use a lossless JSON client for integers outside JavaScript’s safe range. Saving does not make an HTTP/provider request.

The legacy type/config body

Supported during migration only — see the table at the top of this page for what you give up by sending it. Do not combine it with workflow, and do not use it to mutate or execute workflow-owned tools. Legacy webhook rules:
  • For webhook tools, description is required because it tells the model when the tool is appropriate.
  • config.url must be a final public HTTP(S) endpoint. Local and non-public targets are rejected at save time with 400, including a hostname whose DNS answers include one (127.0.0.1.nip.io); dispatch reads the DNS answers again and rejects non-public or mixed ones. Redirects are not followed.
  • config.method supports GET, POST, PUT, PATCH, and DELETE; timeout_seconds is 1–60 seconds and defaults to 30. On a live call the agent waits that long for the answer before the call treats the tool as failed.
  • Request headers must have non-empty names and string values, and a null value is refused here: nothing is stored yet for it to keep. The response never carries the values back — config.configured_header_names names them instead. Routing/framing headers such as Host, Content-Length, Transfer-Encoding, Connection, Expect, Keep-Alive, Proxy-*, TE, Trailer, and Upgrade are rejected. Authorization and custom content types remain supported.
  • The tool name is normalized to camelCase and stored that way. critic-ron-notify-noshow is created as criticRonNotifyNoshow, and a legacy body that renames a tool with PATCH /tools/{id} does the same. The response carries the stored name — read it back and use that, not the string you sent, when you look the tool up later or name it in a prompt. A name sent with the workflow variant is stored exactly as given, trimmed only.
  • Payload parameter names are normalized to camelCase. Extraction descriptions are required, and required defaults to true when omitted.
  • Webhook tools are dispatched once. retry_count is unsupported because automatically replaying an action could duplicate a non-idempotent operation.

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

Idempotency-Key
string

Required for the workflow variant. Preserve the same key and accepted body after a lost response.

Pattern: ^[A-Za-z0-9_-]{16,128}$
x-company-id
string<uuid>

Explicit active workspace. Optional; when sent it must be the API key's own workspace — any other value is refused with 403 WORKSPACE_MISMATCH.

Body

application/json
name
string
required

Stored verbatim for the workflow variant. A legacy type/config body has its name normalized to camelCase before it is stored - "critic-ron-notify-noshow" is created as "criticRonNotifyNoshow" - so read the stored name back from the response rather than assuming the one you sent.

Required string length: 1 - 200
Example:

"capture_lead"

workflow
object
required
description
string
required if type = webhook

Required and non-empty when type is webhook; optional for function tools.

Maximum string length: 10000
expected_head_revision_id
string<uuid>
expected_head_generation
integer
Required range: x >= 1
type
enum<string>
Available options:
webhook,
function
idempotency_key
string
config
object

Webhook configuration is validated as described below; function-tool configuration is stored as an arbitrary JSON object.

Response

Idempotent replay of an already-materialized tool.

id
string<uuid>
required
name
string
required
workflow_version
any
required
read-only
workflow
object
required
description
string | null
is_active
boolean
created_at
string<date-time>

When the tool was made. On a creation that has not built, when it was first asked for; a retry does not move it.

integration
object
read-only

Present only on a tool an integration runs one of its actions through: the tool made for a connected account's action when that account is given to an agent (POST /agents/{id}/integrations). It names the account and the action. Such a tool belongs to the integration and is shared by every agent the account is given to: PATCH /tools/{id} answers 409 INTEGRATION_ACTION_MANAGED, DELETE /tools/{id} does too while any agent still uses it, and GET /tools leaves it out. Change which actions an agent uses with PATCH /agents/{id}/integrations/{integration_id}.

warnings
object[]

Present only on a create that went through with something worth saying about it - today, only that another tool in this workspace already carries the same name. Never a refusal: the tool in the same response exists. Absent when there is nothing to say.