Get the WhatsApp activation code
WhatsApp verifies a landline by calling it and speaking a 6-digit code. These endpoints capture that call for you: you open a capture window on the line, ask WhatsApp to call, and read the code — transcribed from the call — from the API.Requires a tenant-scoped key. With an OAuth / MCP token, the user must be an Owner or Admin (
phone_lines:read) — 403 PERMISSION_DENIED otherwise. Every response that carries an activation is sent with Cache-Control: no-store (the recording with private, no-store): the code is a credential — whoever holds it can register a WhatsApp account on the line, and the recording speaks it.How it works
1
Open a request — before WhatsApp calls
POST /v1/phone-lines/{id}/activations. The line is reset at the carrier, so the recording of an earlier call can never be read as this one’s code, and a request opens in WAITING until pollDeadline — 5 minutes later. A call that arrives before this request exists is not captured.2
Ask WhatsApp to call the line
Register the number in WhatsApp Business and, when asked how to receive the code, choose the phone call option (“Call me”). The line is a landline and does not receive SMS — waiting for an SMS only burns the window.
3
We capture and transcribe
We check the line about every 15 seconds while the window is open, and once more right after it closes. When a recording appears we store it (
CAPTURED), transcribe it and extract the code (TRANSCRIBED). A failed transcription is retried from the stored recording — up to 3 attempts in all — so reading the code usually takes seconds, but can take a few minutes.4
Read the code
Poll
GET /v1/phone-lines/activations/{activationId} every few seconds — or listen for the phone_line.code_received webhook — and type code into WhatsApp.Request a code
POST https://pilotstatus.com.br/v1/phone-lines/{id}/activations — no body. Answers 201 with the new request.
- Allowed while the line is
ACTIVEorPAYMENT_PENDING(including anACTIVEline cancelled at period end). ASUSPENDED,RETURNEDorCANCELEDline gets 409LINE_NOT_ACTIVE. - One waiting request per line. While a request is
WAITINGand itspollDeadlineis still ahead, anotherPOSTanswers 409ACTIVATION_IN_PROGRESS— poll the one you have instead, or cancel it to ask again right away. - No limit on requests over time. Ask again whenever you need to (re-registering WhatsApp, a window that timed out); each request that opens increments the line’s
activationCount.
Poll the request
GET https://pilotstatus.com.br/v1/phone-lines/activations/{activationId} returns { "activation": { … } }. A request of another workspace answers 404 ACTIVATION_NOT_FOUND, the same as one that does not exist.
Statuses
TIMED_OUTis recorded at the first check afterpollDeadline, so it can show up to about 15 seconds after the deadline. That check still reads the line one last time: a call that lands in the window’s last seconds is captured, not lost — so a request can also move fromWAITINGtoCAPTUREDjust after itspollDeadline. If a request still readsWAITINGwell after itspollDeadline, treat it as timed out: a newPOSTis already allowed, because the one-at-a-time rule only counts requests whosepollDeadlineis still ahead.failureReasonis always one of the fixed values in the table (no_call_in_window,canceled_by_customer,no_code_in_transcript,transcription_failed,audio_download_failed,audio_store_failed,poll_not_scheduled) ornull. You can branch on it; treat an unknown value as a failure, since new ones may be added.- The code comes from speech-to-text. WhatsApp speaks the code during the call; we transcribe the recording and keep the 6-digit sequence heard most often. If WhatsApp rejects the code, listen to the recording.
- The recording is served on its own.
hasAudio: truetells you there is one: download it fromGET /v1/phone-lines/activations/{activationId}/audio, or play it in the dashboard (Phone lines → the line). The raw transcription is never returned.
Download the recording
GET https://pilotstatus.com.br/v1/phone-lines/activations/{activationId}/audio returns the call recording of a request whose hasAudio is true — the stored file itself, not JSON.
- Same credentials as polling: a tenant-scoped key, or an OAuth / MCP token of an Owner or Admin (
phone_lines:read). - Headers:
Content-Typeis the recording’s own format — usuallyaudio/wavoraudio/mpeg, since the carrier’s format varies from call to call — with itsContent-Length.Content-Disposition: attachment; filename="activation-{activationId}.wav"(.mp3for an MP3; no extension for any other format).Cache-Control: private, no-store: the recording speaks the activation code. - 404
ACTIVATION_NOT_FOUNDanswers, all alike: a request of another workspace or an unknown id; a request without a recording (hasAudio: false— the wait timed out or was cancelled before any call, or the call could not be downloaded or stored); and any request of a line that isRETURNEDorCANCELED— a line that leaves your workspace has its recordings deleted. - You rarely need to build this URL. The
phone_line.audio_received,phone_line.code_receivedandphone_line.code_failedwebhooks carry it asaudioUrlwhenever the request has a recording. The URL holds no credential — send your key with it.
Cancel a wait
POST https://pilotstatus.com.br/v1/phone-lines/{id}/activations/{activationId}/cancel — no body. Ends a request that is still WAITING, so the next POST /v1/phone-lines/{id}/activations is accepted at once instead of answering 409 ACTIVATION_IN_PROGRESS until the window closes. Same credentials and permission as the other activation endpoints (phone_lines:read).
Answers 200 with { "activation": { … } }, now TIMED_OUT with failureReason: "canceled_by_customer", sent with Cache-Control: no-store. The line is no longer watched for that request. Like any request that ends without a code, it sends phone_line.code_failed and phone_line.code_received (with code: null) once, with canceled_by_customer — so an integration waiting on the webhook learns about a wait cancelled from the dashboard, too.
- A call that already arrived is never thrown away. Once the call is captured the request is no longer
WAITING, and the cancel answers 409ACTIVATION_NOT_WAITING— keep polling: its code is being read. The same 409 answers a request that already ended. Nothing changes in either case. {id}must be the line the request belongs to. A line that is not in your workspace answers 404LINE_NOT_FOUND; a request that is not on that line — or not in your workspace — answers 404ACTIVATION_NOT_FOUND.
Code history
GET https://pilotstatus.com.br/v1/phone-lines/{id}/activations returns the line’s requests, newest first, codes included: { "activations": [ … ] }. It works on suspended lines too — they keep their history.
A line that left your workspace — RETURNED or CANCELED — has its history deleted: its requests are still listed (id, status, timestamps, failureReason) and its activationCount is kept, but code is null, hasAudio turns false as the recordings are deleted, and downloading a recording answers 404.
A line of another workspace answers 404 LINE_NOT_FOUND — never an empty list.
Activation object fields
WAITING, CAPTURED, TRANSCRIBED, TIMED_OUT or FAILED — see Statuses.Why a final request has no code — see Statuses.
Whether a recording of the call is stored — downloadable from
GET /v1/phone-lines/activations/{activationId}/audio and playable in the dashboard.