Skip to main content
PATCH
Update SIP endpoint
Change what an endpoint does without changing how your phone system reaches it. Send at least one field; name, inbound_agent_id, max_concurrent_calls and allowed_source_ips take the same values as on create. Requires sip_endpoints:manage; in the dashboard, only workspace owners and admins can change a username-and-password trunk or an extension endpoint. A value for a field of the other kind of endpoint is refused, and nothing is saved.
The response is the updated endpoint, without a password.

Changing an extension

Yappr doesn’t keep the extension’s password, so a change that depends on it needs it again:
  • register.username or register.auth_username needs register.password in the same request. Without it the answer is 400 SIP_REGISTER_PASSWORD_REQUIRED and nothing changes.
  • register.password on its own is a password change: send it when the password changed on your phone system.
  • register.server, register.transport and register.region don’t need the password.
Yappr’s carrier holds the password it was last given: it uses it to keep the extension registered (about every hour) and on every transfer through the extension. So send the new password whenever it changes on your phone system. Until you do, transfers fail, and Yappr’s registration status can keep reading registered for a long time. The same happens after a wrong password was saved: after any password change, send a test call and a test transfer. If the carrier fails to apply a change, the endpoint keeps its old settings and the call answers a retriable error.

Setting the transfer code

register.pbx_feature_code is your phone system’s in-call transfer code, set once for the endpoint: every transfer to an extension on its calls, on every agent, presses it and then the extension, and your phone system moves the caller (how it works). Add register.pbx_feature_code_hangup_after_secs when the code starts an attended transfer that your phone system completes when Yappr hangs up:
  • These two stay in Yappr. Changing them needs no password, isn’t sent to the carrier (the registration isn’t touched), doesn’t count toward the 30 changes an hour, and works while the endpoint is switched off.
  • A field you leave out keeps its value. null or "" as the code removes it, and the hang-up time with it. null as the hang-up time removes only that.
  • The hang-up time needs a code: the one in the same request, or the one already stored. Without either it is refused with field_required at /register/pbx_feature_code.
  • The 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. Anything else is refused with field_invalid at its pointer, and nothing is saved.

Calling out through the extension

register.outbound switches the agent’s calls out through your phone system on or off (what to set on your phone system):
  • Yappr’s own setting, like the transfer code: no password, nothing sent to the carrier, not one of the 30 changes an hour.
  • Switching the endpoint off (is_active: false) stops its calls out too, and switching it back on resumes them, unless you switched outbound off yourself.
  • Paused. After three refusals in a row by your phone system, register.outbound.paused is set and campaigns calling from the number pause. Send {"enabled": true} once the phone system is fixed.
  • Switching it on is refused with 403 SIP_REGISTER_OUTBOUND_NOT_ENABLED where it isn’t enabled for the workspace, and with 409 VOICE_NOT_READY while Yappr can’t place these calls yet; switching it off always works.
  • Each field is checked at its place (/register/outbound/<field>), and a field outbound doesn’t take is field_unknown.

What this can’t change

  • auth_mode. Create a new endpoint of the other kind instead.
  • A trunk’s username and password. For a new password, issue one; the username stays. An extension’s password is changed with register.password instead.
  • A SIP address. A body with slug is refused with 400 SIP_ENDPOINT_REQUEST_INVALID, which says how to move to a new address: create a new endpoint, point your phone system at its sip_uri, then delete this one.
Any other field the endpoint does not read, such as sip_password, require_tls or a misspelt name, is refused the same way, by name, and nothing is saved. Every fault is named in one answer: issues[] holds each, with path the field as a pointer and code field_unknown, field_required (Nothing to update is one, at the body) or field_invalid; error says the first.

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).

Path Parameters

id
string<uuid>
required

Body

application/json
name
string

A new label.

Required string length: 1 - 200
inbound_agent_id
string<uuid>

An agent in this workspace. It answers from the next call on. Any agent can answer, a workflow agent included; calls to an agent that is switched off, or whose workflow has never been published, are refused (on a trunk with SIP 603 Decline).

is_active
boolean

false refuses the endpoint's new calls before they are answered until you set it back to true (a trunk or SIP address endpoint answers SIP 603 Decline; an extension endpoint's calls are refused). Calls in progress are not affected. On a trunk or SIP address endpoint, re-route the calls in your phone system first: it may not try its next route after a 603. On an extension endpoint, register.status reads disabled and your phone system is not told. Re-route or remove the extension on your phone system first. To change an extension endpoint's agent, call limit, server or password, edit it: don't delete and re-create it.

max_concurrent_calls
integer

Username-and-password trunks and extension endpoints only. 1 to 8 calls at once. null is refused: every endpoint has a limit.

Required range: 1 <= x <= 8
register
object

Any of the extension's settings. Changing username or auth_username needs password in the same request, and a password change is password on its own. Yappr does not keep the password, so it can't reuse it: send the new one whenever it changes on your phone system, because Yappr's carrier holds the last one it was given and uses it to register and to place transfers. Changing only server, transport or region doesn't need it.

pbx_feature_code and pbx_feature_code_hangup_after_secs are Yappr's own settings: changing them needs no password, doesn't go to the carrier (the registration isn't touched), doesn't count toward the 30 changes an hour, and works while the endpoint is switched off. A field you leave out keeps its value.

allowed_source_ips
string[] | null
deprecated

SIP address endpoints only. Recorded only — calls are not checked against it. [] or null clears it.

Maximum array length: 50

Response

The updated SIP endpoint

data
object

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.