Solicitar código de activación
Prepara la línea para capturar una NUEVA llamada de verificación de WhatsApp, sin cuerpo. WhatsApp verifica una línea fija llamándola y diciendo un código de 6 dígitos; este endpoint abre la ventana de captura, no hace la llamada. La línea se reinicia en el operador, así que la grabación de una llamada anterior nunca puede leerse como el código de esta, y una solicitud se abre en WAITING hasta pollDeadline, 5 minutos después. Una llamada que llega antes de que exista esta solicitud no se captura.
Después del 201, registra el número en WhatsApp Business y elige la opción de llamada telefónica (“Llamarme”): la línea es fija y no recibe SMS. Luego consulta GET /v1/phone-lines/activations/{activationId} cada pocos segundos (o escucha el webhook phone_line.code_received) y escribe code en WhatsApp.
Se permite mientras la línea esté ACTIVE o PAYMENT_PENDING; una línea SUSPENDED, RETURNED o CANCELED recibe 409 LINE_NOT_ACTIVE. Una solicitud en espera por línea: mientras una solicitud esté WAITING y su pollDeadline aún no haya pasado, otro POST responde 409 ACTIVATION_IN_PROGRESS: consulta la que tienes, o cancélala con POST /v1/phone-lines/{id}/activations/{activationId}/cancel para pedir de nuevo enseguida. Sin límite de solicitudes en el tiempo; cada solicitud que se abre incrementa el activationCount de la línea. Se envía con Cache-Control: no-store: el código es una credencial.
Requiere una clave con alcance de tenant: una clave con alcance de número (o un permiso OAuth por número) recibe 403 NUMBER_SCOPE_NOT_ALLOWED. Permiso phone_lines:read: con un token OAuth / MCP el usuario debe ser Owner o Admin (403 PERMISSION_DENIED en otro caso).
curl --request POST \
--url https://pilotstatus.com.br/v1/phone-lines/{id}/activations \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/phone-lines/{id}/activations"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/phone-lines/{id}/activations', 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/phone-lines/{id}/activations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/phone-lines/{id}/activations"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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/phone-lines/{id}/activations")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/phone-lines/{id}/activations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"activation": {
"id": "cmg5k3a7c0002ac8example4q",
"lineId": "cmg5k2l1n0001pl8example9x",
"status": "WAITING",
"requestedAt": "2026-10-01T14:10:00.000Z",
"pollDeadline": "2026-10-01T14:15:00.000Z",
"code": null,
"capturedAt": null,
"transcribedAt": null,
"failureReason": null,
"hasAudio": false
}
}Parámetros de ruta
¿Esta página le ayudó?
curl --request POST \
--url https://pilotstatus.com.br/v1/phone-lines/{id}/activations \
--header 'x-api-key: <api-key>'import requests
url = "https://pilotstatus.com.br/v1/phone-lines/{id}/activations"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://pilotstatus.com.br/v1/phone-lines/{id}/activations', 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/phone-lines/{id}/activations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/phone-lines/{id}/activations"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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/phone-lines/{id}/activations")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/phone-lines/{id}/activations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"activation": {
"id": "cmg5k3a7c0002ac8example4q",
"lineId": "cmg5k2l1n0001pl8example9x",
"status": "WAITING",
"requestedAt": "2026-10-01T14:10:00.000Z",
"pollDeadline": "2026-10-01T14:15:00.000Z",
"code": null,
"capturedAt": null,
"transcribedAt": null,
"failureReason": null,
"hasAudio": false
}
}