Llamadas
Preaceptar llamada (opcional)
Envía la respuesta SDP antes de aceptar para reducir cortes de audio al inicio de la llamada. OPCIONAL: la llamada solo se conecta al aceptar. Cuerpo: { sdp, sdpType?:"answer" }. {callId} acepta id o wacid. Solo números de Meta (es un concepto de señalización; números web → 400 FEATURE_NOT_SUPPORTED). Los fallos del proveedor aparecen con un `code` mapeado (p. ej. `META_CALL_PERMISSION_REQUIRED`, `META_CALLING_NOT_ENABLED`; si no, `WHATSAPP_UPSTREAM_ERROR`), el estado HTTP del proveedor y `details: { status, body }`.
**Auth:** una clave de número (`ps_number_`), o una clave de workspace (`ps_workspace_`) / clave de cuenta (`ps_account_`, más `x-workspace-id`) / token OAuth que indique el número en `x-whatsapp-number-id`. Sin número → `403 TENANT_SCOPE_NOT_ALLOWED`. Con una clave de cuenta o un token OAuth, el rol del usuario en el workspace debe permitir `calls:handle` (AGENT, ADMIN u OWNER); si no → `403 PERMISSION_DENIED`.
POST
/
v1
/
calls
/
{callId}
/
pre-accept
Preaceptar llamada (opcional)
curl --request POST \
--url https://pilotstatus.com.br/v1/calls/{callId}/pre-accept \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sdp": "v=0\r\n...",
"sdpType": "answer"
}
'import requests
url = "https://pilotstatus.com.br/v1/calls/{callId}/pre-accept"
payload = {
"sdp": "v=0
...",
"sdpType": "answer"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({sdp: 'v=0\r\n...', sdpType: 'answer'})
};
fetch('https://pilotstatus.com.br/v1/calls/{callId}/pre-accept', 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://pilotstatus.com.br/v1/calls/{callId}/pre-accept",
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' => 'v=0
...',
'sdpType' => 'answer'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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://pilotstatus.com.br/v1/calls/{callId}/pre-accept"
payload := strings.NewReader("{\n \"sdp\": \"v=0\\r\\n...\",\n \"sdpType\": \"answer\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/calls/{callId}/pre-accept")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sdp\": \"v=0\\r\\n...\",\n \"sdpType\": \"answer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/calls/{callId}/pre-accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sdp\": \"v=0\\r\\n...\",\n \"sdpType\": \"answer\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "cmc1x2y3z0000abcd1234efgh",
"status": "RINGING"
}
Encabezados
Parámetros de ruta
Cuerpo
application/json
Respuesta
Preaceptar
¿Esta página le ayudó?
⌘I
Preaceptar llamada (opcional)
curl --request POST \
--url https://pilotstatus.com.br/v1/calls/{callId}/pre-accept \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sdp": "v=0\r\n...",
"sdpType": "answer"
}
'import requests
url = "https://pilotstatus.com.br/v1/calls/{callId}/pre-accept"
payload = {
"sdp": "v=0
...",
"sdpType": "answer"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({sdp: 'v=0\r\n...', sdpType: 'answer'})
};
fetch('https://pilotstatus.com.br/v1/calls/{callId}/pre-accept', 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://pilotstatus.com.br/v1/calls/{callId}/pre-accept",
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' => 'v=0
...',
'sdpType' => 'answer'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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://pilotstatus.com.br/v1/calls/{callId}/pre-accept"
payload := strings.NewReader("{\n \"sdp\": \"v=0\\r\\n...\",\n \"sdpType\": \"answer\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/calls/{callId}/pre-accept")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sdp\": \"v=0\\r\\n...\",\n \"sdpType\": \"answer\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/calls/{callId}/pre-accept")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sdp\": \"v=0\\r\\n...\",\n \"sdpType\": \"answer\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"id": "cmc1x2y3z0000abcd1234efgh",
"status": "RINGING"
}