Make the key from the IVRs & numbers preset (Developer → API keys).
The whole sequence
1. Create an IVR
id. It has an empty draft and no published
revision yet, so it answers no calls.
2. Open the designer
On your server, ask for a link. Never do this from the browser: it needs your API key.return_originis the origin of the page that will open the popup: scheme, host and port, nothing else. The designer reports to this origin only. It must behttps(http://localhostis accepted while you develop). A wildcard is refused.ttl_minutesis how long the link and the designer session last: 120 by default, 5 to 480.
noopener:
the designer needs the window that opened it to report back.
What the designer tells you
A message is a hint to look. Read the IVR back with
GET /ivr-flows/{id}
before acting on it, and always check event.origin.
What the link can do
- It works once. The designer trades it for a session as it loads. A copied, reused or reloaded link shows “This designer link has ended”; ask for a new one.
- The session is for one IVR. It can read, save and publish that IVR, and
read the lists its steps choose from (agents, queues, extensions,
recordings, templates). It can upload a recording. Everything else answers
403 designer_session_scope. - It ends at
expires_at, when the user presses Done, or when the API key that asked for it is revoked. - The secret is in the URL fragment (after
#), which browsers never send to a server. Don’t log the URL or store it.
3. Read the definition
published_revision and draft_revision, its
nodes (each step: id, kind, label, config) and its edges (which
outlet of which step leads where). Add ?revision=draft for the work in
progress, or ?revision=published for what callers hear.
The definition is for reading. To change an IVR, open the designer; there is
no public call that accepts a drawing.
POST /ivr-flows/{id}/publish publishes the current draft from your server.
It answers 422 with a list of what is wrong when the draft can’t run.
4. Point a number at it
Numbers
A number goes to one destination:
The destination must belong to the same organisation as the number.
5. Ring someone into it
- It answers
202straight away, with arequest_id. The number is dialled in the background. - Whoever answers hears the IVR’s published revision, exactly as a caller to a number pointed at it would.
variablesare available to the IVR’s steps as{{name}}: in a spoken prompt, an SMS, an email or a data lookup. Up to 30, of up to 500 characters each.caller_idmust be one of your numbers. You can leave it out if you have only one.- Progress goes to
callback_url(call.started,call.ended, orcall.failedwith the reason) and is kept onGET /call-requests/{request_id}. A callback URL needs a callback secret.
422 and the reason:
- the IVR has never been published;
- the number is one of your own;
- no route reaches it;
- billing refuses it.
?dry_run=true to check all of that and get the plan back without
ringing anyone.