curl --request POST \
--url https://api.goyappr.com/call-requests/{id}/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-yappr-call-request-key: <x-yappr-call-request-key>' \
--data '
{
"sdp": "<string>",
"type": "offer"
}
'import requests
url = "https://api.goyappr.com/call-requests/{id}/start"
payload = {
"sdp": "<string>",
"type": "offer"
}
headers = {
"x-yappr-call-request-key": "<x-yappr-call-request-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-yappr-call-request-key': '<x-yappr-call-request-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sdp: '<string>', type: 'offer'})
};
fetch('https://api.goyappr.com/call-requests/{id}/start', 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/call-requests/{id}/start",
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([
'sdp' => '<string>',
'type' => 'offer'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-yappr-call-request-key: <x-yappr-call-request-key>"
],
]);
$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/call-requests/{id}/start"
payload := strings.NewReader("{\n \"sdp\": \"<string>\",\n \"type\": \"offer\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-yappr-call-request-key", "<x-yappr-call-request-key>")
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/call-requests/{id}/start")
.header("x-yappr-call-request-key", "<x-yappr-call-request-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sdp\": \"<string>\",\n \"type\": \"offer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/call-requests/{id}/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-yappr-call-request-key"] = '<x-yappr-call-request-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sdp\": \"<string>\",\n \"type\": \"offer\"\n}"
response = http.request(request)
puts response.read_body{
"sdp": "<string>",
"type": "answer",
"pc_id": "<string>",
"call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ice_candidate_url": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"replayed": true
}{
"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>",
"message": "<string>",
"path": "<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>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Start Web Call Request
Requires calls:create, plus the request’s own start_capability in the x-yappr-call-request-key header. Sends a fresh SDP offer for a request that has reached ready, takes a line, and returns the answer the browser completes the connection with.
A start is one offer. Sending the same offer again returns the same peer, so a lost response is recovered rather than turned into a second call; sending a different one is refused, because the request has already spent its start. A 503 here is refused before anything is claimed, so the preparation is still worth starting - poll and try again.
curl --request POST \
--url https://api.goyappr.com/call-requests/{id}/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-yappr-call-request-key: <x-yappr-call-request-key>' \
--data '
{
"sdp": "<string>",
"type": "offer"
}
'import requests
url = "https://api.goyappr.com/call-requests/{id}/start"
payload = {
"sdp": "<string>",
"type": "offer"
}
headers = {
"x-yappr-call-request-key": "<x-yappr-call-request-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-yappr-call-request-key': '<x-yappr-call-request-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sdp: '<string>', type: 'offer'})
};
fetch('https://api.goyappr.com/call-requests/{id}/start', 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/call-requests/{id}/start",
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([
'sdp' => '<string>',
'type' => 'offer'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-yappr-call-request-key: <x-yappr-call-request-key>"
],
]);
$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/call-requests/{id}/start"
payload := strings.NewReader("{\n \"sdp\": \"<string>\",\n \"type\": \"offer\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-yappr-call-request-key", "<x-yappr-call-request-key>")
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/call-requests/{id}/start")
.header("x-yappr-call-request-key", "<x-yappr-call-request-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sdp\": \"<string>\",\n \"type\": \"offer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/call-requests/{id}/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-yappr-call-request-key"] = '<x-yappr-call-request-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sdp\": \"<string>\",\n \"type\": \"offer\"\n}"
response = http.request(request)
puts response.read_body{
"sdp": "<string>",
"type": "answer",
"pc_id": "<string>",
"call_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ice_candidate_url": "<string>",
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"replayed": true
}{
"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>",
"message": "<string>",
"path": "<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>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}calls:create and the request’s own start_capability in the
x-yappr-call-request-key header. Sends a fresh SDP offer for a request that has
reached ready, takes a line, and returns the answer the browser completes the
connection with.
curl -X POST "https://api.goyappr.com/web-call/call-requests/REQUEST_ID/start" \
-H "x-yappr-call-request-key: START_CAPABILITY" \
-H "Content-Type: application/json" \
-d '{ "sdp": "v=0…", "type": "offer" }'
{
"sdp": "v=0…",
"type": "answer",
"pc_id": "…",
"ice_candidate_url": "https://voice.goyappr.com/api/web-call/offer",
"call_id": "7c4d…",
"request_id": "9f1c…",
"replayed": false
}
Send a fresh offer
Build the peer connection now, not before the steps ran. Preparation can take seconds, and candidates gathered before someone else’s calendar lookup are stale by the time it finishes.A start is one offer
Sending the same offer again returns the same peer, withreplayed: true —
so a lost response is recovered rather than turned into a second call. Sending a
different one is 409 WORKFLOW_START_ALREADY_CLAIMED: this request has spent
its start, and a second call means creating a second request.
What each refusal means
| Status | Code | What to do |
|---|---|---|
401 | CALL_REQUEST_KEY_REQUIRED | No capability was sent. Send the start_capability the create answered with as x-yappr-call-request-key. |
403 | WORKFLOW_START_DENIED | The capability does not belong to that request. The same answer covers a wrong capability, an unknown request and a phone request, on purpose. |
409 | WORKFLOW_START_NOT_READY | The steps have not finished. Poll until the request reports ready. |
409 | WORKFLOW_START_ALREADY_CLAIMED | Already started with a different offer. Create a new request. |
409 | WORKFLOW_REQUEST_CANCELLED | Cancelled. Create a new request. |
410 | WORKFLOW_START_EXPIRED | The request outlived expires_at. Create a new one. |
402 | WORKFLOW_BILLING_UNAVAILABLE | The workspace is out of credit. |
503 | AT_CAPACITY | Every line is busy and nothing was claimed — the preparation is still good. Wait and start again. |
502 | WEB_START_REFUSED | The voice runtime refused the offer. The line was given back and the request is finished; create a new one. |
503 | WEB_START_UNAVAILABLE | The voice runtime never answered. Same as above: the line was given back and the request is finished. |
AT_CAPACITY against the other two. It is
refused before anything is claimed, so the request is still startable; the
others happen after the claim, which is why they end the request instead of
inviting a retry onto a second peer.
After it connects
Trickle ICE candidates toice_candidate_url with pc_id, and DELETE the same
URL with pc_id to hang up. call_id is the call record —
Get Call reads it once the call ends.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).
Body
Response
The call is live. Complete the WebRTC connection with this answer.