Skip to main content
POST
A SIP endpoint lets your own phone system (a PBX, a contact-center platform or a SIP provider) send calls to a Yappr agent without a Yappr phone number. Use one when you already have a business line and want unanswered, after-hours or escalated calls to land on an agent instead of voicemail. Choose the kind with auth_mode:
  • register: register as an extension. For a hosted phone system that gives you only an extension account (a server, a username and a password) and no way to add a trunk. Yappr registers to it like a softphone, and the agent answers the calls your system routes to that extension. See Register as an extension.
  • credentials: username and password (recommended). Yappr issues a SIP username and password. Your phone system sends calls to sip.telnyx.eu or sip.telnyx.com with them, dialling any number or extension, and the agent answers every call. A call with a wrong username or password is refused before it reaches Yappr. A trunk only brings calls in: it can’t place calls. An agent can still hand a trunk caller back to your phone system with a SIP-address transfer. Any agent can answer, including one that runs a workflow (below).
  • uri: SIP address only (the default). Your phone system dials one SIP address, with no username or password. The address is the secret: anyone who has it can call the agent. It works with any agent.
Requires sip_endpoints:manage. A workspace can make 20 create attempts in 24 hours, all three kinds together. The 24 hours run from the first attempt, and the limit counts attempts, not endpoints created. The setup guide covers the phone system side, and which platforms can send calls to a username-and-password trunk.

Username-and-password trunk

In the dashboard, only workspace owners and admins can create one. Check GET /sip-endpoints/status first: while credentials_available is false, nothing is created, and this answers 403 SIP_TRUNKS_NOT_ENABLED (username-and-password trunks aren’t switched on for your workspace: ask Yappr support) or 409 VOICE_NOT_READY (Yappr can’t take trunk calls right now: try again in a few minutes). Any agent in the workspace can answer, including one that runs a workflow: its calls run the agent’s published workflow. Publish the workflow first (Create agent): calls to an agent that is switched off, or whose workflow has never been published, are refused with SIP 603 Decline, and the create doesn’t check this.
sip_password is in this response only. Store it now: neither the API nor the dashboard can show it again. If it is lost, issue a new one.

Creating trunks from a script

Read sip_password from the response and put it straight where it is used: your phone system’s own API, or a secret store (a vault or your cloud’s secret manager) that the phone system’s setup reads from. Never write it to a file, a log, a ticket or a chat, and never print it in a CI job’s output. Keep only the trunk’s id and sip_username in your own records.
  • Send an Idempotency-Key with every create, so a timeout can be retried without making a second trunk.
  • If the password could not be stored (the store was down, the script crashed after the create), don’t look for it again: no read returns it, and a replay doesn’t either. Issue a new one and store that.
  • To hand a trunk over to someone else, give them the password through the same secret store, never in the open.
What to enter in the phone system: If the same phone system or IP address also sends calls to another Telnyx trunk, add the header X-Telnyx-Username: <sip_username> to this trunk’s calls. The setup guide has the settings for 3CX, FreePBX, Cisco CUBE, Twilio and other platforms. Transfers on trunk calls use a SIP address as the destination (for example sip:reception@pbx.example.com): your phone system places the new call, and it must accept the transfer request. A phone-number destination isn’t dialled from a trunk call; the caller stays with the agent and the call’s events record a transfer_failed with error_code UNAVAILABLE_ON_SIP_TRUNK. When a trunk already has max_concurrent_calls calls ringing or in progress, the next call is refused with SIP 486 Busy Here, so your phone system can retry or try another route. (This describes username-and-password trunks. On an extension endpoint the call is refused too, and the code your phone system sees isn’t specified.) Leave it out and the trunk takes 2 calls at once; the most it can take is 8. Yappr’s own limit on simultaneous calls applies too, and is answered the same way.

Register as an extension

For a hosted phone system that only gives you an extension account. Use a username-and-password trunk instead whenever your system can add a SIP trunk. In the dashboard, only workspace owners and admins can create one. Check GET /sip-endpoints/status first: while register_available is false, nothing is created, and this answers 403 SIP_REGISTER_NOT_ENABLED (extension endpoints aren’t switched on for your workspace: ask Yappr support) or 409 VOICE_NOT_READY (try again in a few minutes).
Yappr does not keep the password: it doesn’t store it, return it or log it. It is passed to Yappr’s carrier, which holds it to keep the extension registered (it re-registers about every hour) and to place transfers through the extension. If it changes on your phone system, send the new one with PATCH /sip-endpoints/{id} (register.password): until you do, the registration can still read registered while transfers fail. Registration takes a few minutes. register.status starts as pending; read it with GET /sip-endpoints/{id} until it is registered or failed. registered means your phone system accepted the registration. It does not prove that calls and transfers work: send a test call, and a test transfer if the agent transfers. On your phone system:
  1. Allow the address in register.allow_list.sip_ip for SIP (ports 5060 and 5061) and for media (RTP, UDP ports 16384 to 32768), in both directions.
  2. Use a dedicated extension that receives calls and can dial only your internal transfer destinations: no outbound, phone-network or international calls. Anyone who learns the endpoint’s internal address could place calls as that extension.
  3. The extension username is 2 to 128 characters: letters, digits, +, - and _ (a dot, @ or space cannot be registered; a 3-digit extension such as 101 works). It must be unique across Yappr, first come first served. A username another endpoint already registers is refused with 409 SIP_REGISTER_EXTENSION_IN_USE; with a short extension a clash is likely, so create a dedicated extension on your phone system with a distinctive name and register that one. A name can also stay taken after you delete its endpoint (see changing or removing an extension endpoint).
  4. Send the calls you want answered to the extension.
Yappr re-registers on a one-hour interval, and there is no setting for it. UDP is the transport that was tested end to end; tcp and tls are accepted. A workspace can hold 5 extension endpoints; Yappr support can raise that for a workspace. A transfer on an extension call is a new call that Yappr places through your extension (no SIP REFER), to a SIP address such as sip:reception@pbx.example.com (only the part before the @ is used). It uses two channels on your phone system. If that call fails or isn’t answered within about 25 seconds, the call ends: the agent doesn’t take the caller back. Set your phone system’s transfer code once, and transfers go through your phone system instead. Most hosted phone systems move a call when the extension on it presses a transfer code, such as ## and then the extension. Put that code in register.pbx_feature_code (on create, or later with PATCH /sip-endpoints/{id}) and every transfer to an extension on this endpoint’s calls, on every agent, presses it: your phone system moves the caller, the person who answers sees the caller’s own number, and Yappr leaves the call, with no second channel and no transfer minutes. There is nothing to set on each transfer. If your code starts an attended transfer, one your phone system completes only when the extension that pressed it hangs up, also set register.pbx_feature_code_hangup_after_secs (4 is a good start): Yappr then hangs up itself, that hang-up completes the transfer, and there is no fallback, so test it once. Only without it (the dashboard’s attended transfer switch off), if your phone system doesn’t take the code within about 12 seconds, Yappr places the new call above instead. The setup guide covers both. The setup guide explains what the endpoint can and can’t do, how a transfer works and how to delete one safely.

SIP address endpoint

Leave out auth_mode (or send "uri"). Yappr generates the address: a readable prefix (the slug you send, or one derived from name), a hyphen and 24 random characters, about 120 bits that cannot be guessed. The response carries the full address in sip_uri. Hand it to whoever runs the phone system; they paste it into their PBX or CPaaS as the destination for the relevant route.
On the phone system side:
  1. Destination: the sip_uri.
  2. Authentication: none. Set it to “none” or “anonymous”; there is no username or password.
  3. Transport: UDP or TCP on port 5060, or TLS on port 5061. Over UDP or TCP the address crosses the network in clear text, so use TLS where your system supports it.
  4. Codecs: G.711 (µ-law or A-law) or G.722.

What protects a SIP address

The address is the endpoint’s only credential. Read this before you hand it out.
  • Anyone who has the address can call the agent. There is no username or password, and the call is billed to your workspace. The address reaches this one agent only: it cannot place calls or reach your phone system.
  • Over UDP or TCP the address travels in clear text. It can be read on the network path between your phone system and Yappr, so send over TLS where you can. Whatever the transport, it sits in your phone system’s configuration, logs and SIP traces.
  • Calls are not filtered by where they come from. allowed_source_ips is stored with the endpoint for your records, but no call is checked against it: a call to the address is answered wherever it comes from.
  • The calls API does not return the address, but it is not hidden everywhere. A call that arrives on the endpoint reads to: null and sip_endpoint_id on GET /calls and GET /calls/{id}, and its To is empty in the export. The dashboard’s call logs still show it as the number called, and the call details your agent’s tools and webhooks receive carry it as the called number (callee_number), so anyone who can read those can read the address. Don’t log or forward callee_number from these calls (what tools and webhooks receive).
  • Treat the address like an API key. Limit who can read the phone system’s configuration, switch the endpoint off with is_active: false while it is not in use, and replace it whenever it may have been seen by someone who should not have it.
  • The address cannot be changed. To move to a new one, create a new endpoint, point your phone system at its sip_uri, then delete the old one, in that order, so no call is dropped in between. Calls to a deleted address are refused before they are answered (SIP 603 Decline).

Retrying a create

Send an Idempotency-Key header (16 to 128 letters, digits, underscores or hyphens) and a create can be retried safely, for example after a timeout, when you can’t tell whether it went through:
  • The same key and the same body within 24 hours answer 200 with the endpoint the first request created and "replayed": true beside data. Nothing new is created, and the create limit is not spent. A trunk’s sip_password is never in a replay: it was returned once, to the first answer. If that answer was lost, issue a new password.
  • The same key with a different body is refused with 409 IDEMPOTENCY_KEY_REUSED, and nothing is created. Use a new key for a new endpoint.
  • After 24 hours the key is free again, and a create with it makes a new endpoint.
  • Without a key, every create makes a new endpoint, as before.
The key is your workspace’s own: another workspace’s same key is a different request. Names are not unique, so two endpoints can share one; to find yours by name, list with GET /sip-endpoints?name=.

Caller ID

On every kind, the caller’s number comes from your phone system, so Yappr does not use it to recognize returning callers (lead memory). There is no setting to change this, in the API or the dashboard.

What the body may carry

Anything else is refused with 400 SIP_ENDPOINT_REQUEST_INVALID, by name, rather than dropped, and so is a value for a field of the other kind of endpoint (slug or allowed_source_ips on a username-and-password trunk or an extension endpoint, max_concurrent_calls on a SIP address endpoint, register on any other kind). That includes sip_username and sip_password: on a username-and-password trunk Yappr issues both, and a SIP address endpoint and an extension endpoint have neither (an extension’s login goes inside register). A top-level transport is not a setting either: a SIP address takes UDP, TCP or TLS, a trunk lists its transports in sip_connection, and an extension’s is register.transport. A slug or an address that does not fit is refused the same way, never rewritten, and nothing is created. Every fault is named in one answer, so a script can fix them all before it sends the request again. error is the first, in one sentence, and says how many more there are; issues[] holds each one, with path the field as a pointer and code what is wrong with it:
field_unknown is a field this call does not take, field_required one it needs, and field_invalid a value it can’t take, or a field of the other kind of endpoint. An allowed_source_ips entry is named at its index. A register.pbx_feature_code_hangup_after_secs sent without a code is field_required at /register/pbx_feature_code. An Idempotency-Key that can’t be one (too short, a character it can’t hold, or the header sent twice) is refused the same way, as header_invalid at Idempotency-Key.

Errors

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

Makes a retry safe. The same key and the same accepted body within 24 hours answer 200 with the endpoint the first request created and replayed: true, never a trunk's password (issue a new one with rotate-password); the same key with another body is 409 IDEMPOTENCY_KEY_REUSED. Scoped to this workspace. After 24 hours the key makes a new endpoint. Without it, every create makes a new endpoint.

Pattern: ^[A-Za-z0-9_-]{16,128}$

Body

application/json
name
string
required

A label, shown in the dashboard.

Required string length: 1 - 200
Example:

"Main office PBX"

inbound_agent_id
string<uuid>
required

An agent in this workspace. It answers every call on the endpoint. Any agent can answer, a workflow agent included; publish its workflow first (an agent that is switched off, or whose workflow has never been published, can't take calls, and a trunk refuses them with SIP 603 Decline).

auth_mode
enum<string>
default:uri

credentials: a username-and-password trunk. uri: a SIP address endpoint. register: an extension endpoint, with register. Any kind answers with any agent. Without auth_mode you get uri, exactly as before username-and-password trunks existed.

Available options:
credentials,
uri,
register
max_concurrent_calls
integer
default:2

Username-and-password trunks and extension endpoints only. The most calls the endpoint takes at once (ringing and in progress), 1 to 8; the next one is refused (a trunk answers SIP 486 Busy Here). Omit it for 2. null is refused: every endpoint has a limit.

Required range: 1 <= x <= 8
Example:

5

register
object

Extension endpoints only: the extension account your phone system gave you. Yappr does not store the password or return it. It is passed to Yappr's carrier, which holds it to keep the extension registered and to place transfers.

slug
string

SIP address endpoints only. An optional readable start for the address: 2 to 12 letters, digits and single hyphens, starting and ending with a letter or digit. Yappr lowercases it and adds a hyphen and 24 random characters after it. It can't be a reserved word, or start with one followed by a hyphen: yappr, admin, internal, system, api, sip, telnyx, trunk, root, test, sudo, support. Derived from name when omitted. A prefix that does not fit is refused, never rewritten.

Required string length: 2 - 12
Pattern: ^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$
Example:

"after-hours"

allowed_source_ips
string[] | null
deprecated

SIP address endpoints only. Source addresses to record with the endpoint: IPv4 or IPv6 addresses, each optionally with a /prefix. Recorded only — calls are not checked against them. [] and null both mean none is recorded. An entry that is not an address is refused.

Maximum array length: 50

Response

A retry with the same Idempotency-Key and body, within 24 hours: the endpoint the first request created, with replayed: true. Nothing new was created. A trunk's sip_password is not in it.

data
object
required

A SIP endpoint lets your own phone system (a PBX, a contact-center platform or a SIP provider) send calls to a Yappr agent, without a Yappr phone number. It comes in three kinds, set by auth_mode when you create it:

  • credentials: username and password. Yappr issues a SIP username and password. Your phone system sends calls to sip.telnyx.eu or sip.telnyx.com with them, dialling any number or extension, and the endpoint's agent answers every call. A call with a wrong username or password is refused before it reaches Yappr. The password is returned only once: by create and by rotate-password. Any agent of the workspace can answer, including one that runs a workflow: see inbound_agent_id.
  • uri: SIP address only. Your phone system dials the endpoint's sip_uri, with no username or password. It works with any agent, including one that runs a workflow. The address is the secret: anyone who has it can call the agent, on your workspace's minutes, so treat it like an API key. Calls are not filtered by source address. To replace it, create a new endpoint, point your phone system at it, then delete the old one; calls to a deleted or switched-off endpoint are refused before they are answered.
  • register: register as an extension. For a hosted phone system that only gives you an extension account (server, username, password). Yappr registers to it like a softphone and the agent answers the calls the system routes to that extension. Yappr does not keep or return the extension's password. You send it to create the endpoint and again whenever it changes on your phone system, because Yappr's carrier holds it to keep the extension registered and to place transfers. The register object carries the settings and the registration status. See Register as an extension.

sip_username and sip_connection appear on username-and-password trunks only, max_concurrent_calls on trunks and extension endpoints, register on extension endpoints only, and allowed_source_ips on SIP address endpoints only. List, get and update never return a password. A SIP address endpoint's slug and sip_uri are its credential, and a trunk's sip_username is half of its, so list and get return them only to a key that also holds sip_endpoints:manage; with sip_endpoints:read alone (the Read-only preset) they are null. The setup guide covers the phone system side.

replayed
enum<boolean>
required
Available options:
true