Skip to main content

Cancel a phone line

DELETE /v1/phone-lines/{id} cancels a line and answers the line as it is afterwards. What happens depends on the line’s status.
Requires a tenant-scoped key. With an OAuth / MCP token, only the workspace Owner may cancel (phone_lines:cancel) — 403 PERMISSION_DENIED otherwise.

Endpoint

DELETE https://pilotstatus.com.br/v1/phone-lines/{id} No body. {id} is the line’s id, not the phone number.

What happens, by status

A returned number stops being yours for good: nothing undoes a return, and there is no guarantee you can ever get it again. The WhatsApp account activated on it stays tied to that number — whoever rents it next can request a verification code for it. Cancelling an unpaid line does this at once, with no grace period.
If a return of the same unpaid line is already under way — started by the hourly billing run or by the dashboard’s Choose which lines to keep — the call answers 200 with the line as it stands, possibly still PAYMENT_PENDING or SUSPENDED, and that process completes the return. Read the line again to confirm RETURNED. Changed your mind about an ACTIVE line? Undoing a scheduled cancellation is available in the dashboard only, to the workspace Owner (Phone lines → the line → Undo cancellation), while the line is still ACTIVE.

Example

The body is the line object.

Events

  • A line cancelled at period end sends phone_line.canceled when it becomes CANCELED — usually within about an hour after currentPeriodEnd; if the carrier does not confirm, it is retried at each hourly run.
  • An unpaid line returned by this call sends phone_line.returned right away.
See Phone line webhooks.

Errors