Webhooks

Get notified the instant something happens — a call comes in, a voicemail is left, or a transcription finishes. Register a URL once, pick the events you care about, and Phone.inc will POST a JSON payload to your endpoint in real time.

Partner OAuth permissions

Partner OAuth tokens need webhooks:read to list subscriptions, and both webhooks:write and webhooks:read to create, update, or delete them. Subscriptions are scoped to the installation that created them, not every webhook in the company.

Application-owned subscriptions are hidden throughout the customer dashboard, including Webhooks, Integrations, and direct delivery-history links. Customers stop them by disconnecting the application. Publishers see a sanitized delivery log across customer installations under Applications. API keys and legacy tokens can still list subscriptions belonging to their company and inspect their delivery history, but cannot update, delete, retrieve signing secrets, or send test deliveries for application-owned subscriptions; those operations return 404. Only the owning installation's OAuth credentials can manage them. The same ownership rules apply through MCP. Customer-managed subscriptions keep their existing controls.

Each event also requires its resource read scope: call.* needs calls:read, voicemail.* needs voicemails:read, contact.* needs contacts:read, employee.* needs employees:read, and number.* needs business_numbers:read. Call transcription and summary events need only calls:read; voicemail transcription events need only voicemails:read. Webhook management permission alone does not grant event data.

Each subscription has a scope ceiling based on the creating installation's granted scopes that can shrink but never expand. Resource reads include that resource's recordings, transcriptions, and summaries where available. Deliveries omit ungranted embedded employee, contact, department, and business-number details. Reference IDs remain available. The same redaction applies inside nested payloads.

Adding enabled application scopes does not disconnect installations or delete subscriptions. Neither existing tokens nor subscriptions gain permissions after later consent. When installation or application permissions are removed, subscription scope ceilings and event lists shrink permanently. Readding a scope cannot revive removed access on an old subscription; create a new subscription for expanded access. Unaffected narrower credentials and installations continue. See the OAuth installation lifecycle.

Disconnect removes the installation's subscriptions and stops deliveries, including deliveries already queued or waiting for retry. Removing every installed permission also disconnects that installation. Reconnecting does not revive old subscriptions or queued events; create new subscriptions after reconnecting.


The webhook model

A webhook subscription tells Phone.inc where to send event notifications and which events to include.

Properties

  • Name
    id
    Type
    string
    Description

    Unique public identifier for the webhook.

  • Name
    name
    Type
    string
    Description

    A human-readable label for the webhook (e.g. Slack notifications, CRM sync).

  • Name
    url
    Type
    string
    Description

    The HTTPS endpoint where events are delivered via POST.

  • Name
    events
    Type
    array
    Description

    List of event types this webhook subscribes to. See Events for all available types.

  • Name
    active
    Type
    boolean
    Description

    Whether the webhook is currently receiving events. Set to false to pause delivery without deleting the subscription.

  • Name
    signing_secret
    Type
    string
    Description

    Per-subscription HMAC secret. Returned only by successful create and update responses, never by lists or delivery diagnostics. Store it securely and do not log it. It is generated by Phone.inc and cannot be set through request parameters.

  • Name
    created_at
    Type
    timestamp
    Description

    ISO 8601 timestamp of when the webhook was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    ISO 8601 timestamp of the last update.


Events

Each event maps to a specific moment in a call's lifecycle or a voicemail being recorded.

  • Name
    call.initiated
    Description

    A new inbound or outbound call has started. The call exists but hasn't been answered yet.

  • Name
    call.outside_business_hours
    Description

    An inbound call arrived outside the business number's configured business hours. Existing call.outside_opening_hours subscriptions are migrated to this name, and payloads now use call.outside_business_hours.

  • Name
    call.queued
    Description

    The caller joined the employee wait queue. The payload is the existing call envelope; state is queued and answered_at is still null. Fires once per call.

  • Name
    call.answered
    Description

    The call was answered by an employee. answered_at is now set on the call, and employees includes the employee who answered.

  • Name
    call.ended
    Description

    The call has ended, regardless of outcome. Fires for every call that reaches the ended state — answered, missed, or rejected.

  • Name
    call.lost
    Description

    The call ended without being answered and without a spoken voicemail message. This includes recordings containing only silence or sound effects. Discarding a sound-only recording emits this event unless it was already emitted for the call.

  • Name
    call.transcription_done
    Description

    The call recording has been transcribed. The transcription and transcription_segments fields are now populated on the call. The summary is generated afterwards, so do not rely on summary being populated in this event. Subscribe to call.summary_done to receive it.

  • Name
    call.summary_done
    Description

    The AI summary of the call has been saved. The payload includes summary, transcription, and transcription_segments. Dispatched after call.transcription_done, but webhook deliveries may arrive out of order. Not sent when the call has too little conversation to summarize, contains no meaningful content, or its transcription was deleted during summary generation.

  • Name
    call.data_deleted
    Description

    Call content or a recording was deleted. data.deleted lists transcription, recording, or both. Deleting transcription data also deletes the summary, stored caller context, and whisper brief, even if no transcript exists. data.reason is retention_policy for scheduled deletion, keep_disabled when temporary audio is removed after transcription, or manual when an employee deletes call data.

  • Name
    voicemail.new
    Description

    A new voicemail was recorded and confirmed to contain spoken words, or a receptionist saved a written message. Recorded voicemail fires after transcription, not immediately after upload. Written messages fire when saved. The payload includes call and voicemail data, including kind, transcription and message_details. Written messages have kind: "receptionist_message" and no audio; collected fields and declined values follow the voicemail model.

  • Name
    voicemail.transcription_done
    Description

    The voicemail recording has been transcribed. The payload's voicemail object now has its transcription field populated.

  • Name
    voicemail.data_deleted
    Description

    Voicemail or written-message data was manually deleted. data.deleted lists removed transcription, recording, and/or message_details, and data.reason is manual. Collected details are cleared alongside the message.

  • Name
    contact.created
    Description

    A new contact was added to your address book. The payload's data.contact object includes the full contact model.

  • Name
    contact.updated
    Description

    An existing contact was edited. The payload's data.contact object includes the new values.

  • Name
    contact.deleted
    Description

    A contact was removed. The payload's data.contact object reflects the contact at the time of deletion.

  • Name
    employee.status.changed
    Description

    An employee's live presence changed (for example from available to on_call, or when they enable/disable do-not-disturb). The payload's data.employee object matches the employee model, including status, do_not_disturb, do_not_disturb_activated_at, and do_not_disturb_expires_at. It also has a call_id: the call the employee is ringing for when status is ringing, the call they are on when status is on_call, and null otherwise. If an employee rings for several calls at once, call_id is the most recent one. The event also fires when call_id changes while status stays the same.

  • Name
    number.registration_approved
    Description

    A business number's regulatory registration was approved by the carrier. The payload's business_number includes id, number, and registration_status.

  • Name
    number.registration_rejected
    Description

    A business number's regulatory registration was rejected. The payload's business_number includes id, number, and registration_status. A sibling reason string explains the rejection.


Payload structure

Call, voicemail, contact, and employee webhook deliveries are JSON POSTs with the following envelope:

Webhook payload

{
  "event": "call.answered",
  "timestamp": "2026-05-15T14:22:33Z",
  "data": {
    "id": "01JVWX...",
    "call_control_id": "v3:...",
    "from": "+14155551234",
    "to": "+14155559876",
    "direction": "inbound",
    "state": "answered",
    "started_at": "2026-05-15T14:22:00Z",
    "answered_at": "2026-05-15T14:22:33Z",
    "duration": null,
    "summary": null,
    "transcription": null,
    "transcription_segments": null,
    "business_number_id": "01JVWX...",
    "business_number_name": "Sales",
    "business_number_number": "+14155559876",
    "business_number_number_formatted": "(415) 555-9876",
    "employees": [{ "id": "01JVWX...", "name": "Jane Smith", "first_name": "Jane", "last_name": "Smith" }],
    "initiated_by": null
  }
}

For call.* events, the data object contains the full call model. On call.data_deleted, deleted fields are already null, data.deleted identifies what was removed, and data.reason identifies why. For voicemail.new, voicemail.transcription_done, and voicemail.data_deleted events, the payload also includes a voicemail object nested inside data with the voicemail id, from, business_number_name, business_number_number, transcription, and created_at. The transcription is populated on voicemail.new and voicemail.transcription_done, and null after voicemail.data_deleted. For contact.created, contact.updated, and contact.deleted events, data contains a contact object with the full contact model. For employee.status.changed events, data contains an employee object with the full employee model (including status) plus call_id. For number.registration_approved and number.registration_rejected events, the top level contains a business_number object with id, number, and registration_status; rejected events also include a reason string.

After a Shopify customer or store privacy deletion, affected contact deliveries use the contact's current name and email, or null if the contact no longer exists. Queued deliveries and retries cannot restore the deleted Shopify values. Historical delivery payloads and response bodies for affected contacts are cleared; attempt metadata remains. Your endpoint must handle deletion of any copies it already received.

Registration events use this payload structure:

Registration payload

{
  "event": "number.registration_rejected",
  "business_number": {
    "id": "01JVWX...",
    "number": "+14155559876",
    "registration_status": "rejected"
  },
  "reason": "Address does not match identity country"
}

Your endpoint should return a 2xx status code to acknowledge receipt. Transport errors and HTTP 408, 429, and 5xx responses are retried with polynomial delays, with at most 5 total attempts (the initial attempt plus up to 4 retries). Private-address and other URL-validation failures are not retried. Ordinary 4xx responses other than 408 and 429 are not retried.

Delivery resolves and checks every address using the caller-context endpoint's blocked-address policy before connecting to a validated address. This blocks private, loopback, link-local, carrier-grade NAT, benchmark, multicast, IPv4 0.0.0.0/8 and 240.0.0.0/4, IPv6 unspecified, and NAT64 64:ff9b::/96 addresses. IPv4-mapped IPv6 addresses receive the same checks. Any blocked answer rejects the attempt, including hosts with mixed public and blocked DNS answers.


Verify delivery signatures

Every delivery, including synthetic tests and retries, includes these headers:

X-Phone-Inc-Timestamp: 1793016000
X-Phone-Inc-Signature: v1=<64 lowercase hexadecimal characters>

Save signing_secret from the successful POST /api/v1/webhooks response. To retrieve it later, send PATCH /api/v1/webhooks/:id with an empty JSON object ({}); the response returns the same secret without changing subscription settings. Existing subscriptions acquire a persistent secret on their first delivery or successful API update. Each subscription has its own secret, encrypted at rest. Dashboard pages do not display secrets; retrieve dashboard-created subscriptions' secrets through an authorized API-key update.

Partner OAuth retrieval requires both webhooks:write and webhooks:read and is limited to the token's own installation. Read-only tokens cannot retrieve secrets. API keys and legacy tokens keep their existing company access. Lists and delivery diagnostics never return the secret. There is no rotation endpoint; create a replacement subscription and remove the old one if a secret is compromised.

The v1 value is the lowercase hexadecimal HMAC-SHA256 of the header timestamp, a literal period (.), and the exact raw HTTP request body bytes, using the subscription's secret as the key. Use the secret string as returned, not hex-decoded bytes. This matches the caller-context header convention, but webhook secrets are separate from caller-context signing secrets.

Read the body before JSON parsing or middleware transformations. Reject missing or malformed headers, unsupported versions, and timestamps outside a short tolerance, for example 300 seconds in either direction. Compute the HMAC over timestamp + '.' + raw_body and compare the full v1=... value in constant time. Parse and process JSON only after verification succeeds.

Verify raw bytes in Python

import hashlib
import hmac
import re
import time

def valid_webhook(raw_body: bytes, timestamp: str | None, signature: str | None, signing_secret: str) -> bool:
    if re.fullmatch(r"[0-9]{1,12}", timestamp or "") is None:
        return False
    if re.fullmatch(r"v1=[0-9a-f]{64}", signature or "") is None:
        return False
    if abs(time.time() - int(timestamp)) > 300:
        return False
    message = timestamp.encode("ascii") + b"." + raw_body
    digest = hmac.new(signing_secret.encode("ascii"), message, hashlib.sha256).hexdigest()
    return hmac.compare_digest("v1=" + digest, signature)

The header timestamp is the delivery attempt time in Unix seconds, not the event's JSON timestamp. Every retry computes a signature using the current attempt time and the exact body being sent; the subscription secret stays the same. A delayed retry can therefore pass the freshness check even when the original event is older than five minutes. Keep your receiver's clock synchronized.

A timestamp tolerance limits replay age but does not stop replay within the allowed window. Deliveries are not exactly-once and have no universal event ID. Make domain changes idempotent and retain durable deduplication state suitable for your application. Do not use the signature or header timestamp as an event identifier: they can change between attempts. Acknowledge accepted events promptly with 2xx; the retry policy also applies to signed tests.


GET/v1/webhooks

List webhooks

Returns all webhook subscriptions for your company, without signing secrets.

Request

GET
/v1/webhooks
curl https://app.phone.inc/api/v1/webhooks \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Response

[
  {
    "id": "01JVWX...",
    "name": "Slack notifications",
    "url": "https://example.com/webhooks",
    "events": ["call.initiated", "call.answered", "voicemail.new"],
    "active": true,
    "created_at": "2026-05-15T10:00:00Z",
    "updated_at": "2026-05-15T10:00:00Z"
  }
]

POST/v1/webhooks

Create a webhook

Registers a new webhook subscription. The response includes its signing_secret; store it securely to verify deliveries.

Required attributes

  • Name
    name
    Type
    string
    Description

    A human-readable label for the webhook.

  • Name
    url
    Type
    string
    Description

    The HTTPS endpoint to receive events.

  • Name
    events
    Type
    array
    Description

    One or more event types to subscribe to. See Events.

Request

POST
/v1/webhooks
curl -X POST https://app.phone.inc/api/v1/webhooks \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Slack notifications",
    "url": "https://example.com/webhooks",
    "events": ["call.initiated", "call.answered"]
  }'

Response

{
  "id": "01JVWX...",
  "name": "Slack notifications",
  "url": "https://example.com/webhooks",
  "events": ["call.initiated", "call.answered"],
  "active": true,
  "signing_secret": "f07b2e7e844d991e7df46ae01d3c5289a5b05aa71817f2f11b490be4457d22ad",
  "created_at": "2026-05-15T10:00:00Z",
  "updated_at": "2026-05-15T10:00:00Z"
}

PATCH/v1/webhooks/:id

Update a webhook

Updates an existing webhook. You can change the URL, events, or toggle it on/off. Successful responses include the persistent signing_secret. Send {} to retrieve it without changing settings; updates do not rotate it.

Partner OAuth tokens that change the destination URL, change subscribed events, or resume delivery must cover the resulting subscription's effective delivery scopes: its saved scope ceiling intersected with the installation's current permissions. This includes event resource reads and embedded employee, contact, department, and business-number details, plus call data included with voicemail events. Changing events requires these permissions even if the destination was changed in an earlier request. A token issued before additional consent may lack these permissions even when it has webhooks:read and webhooks:write. Insufficient scopes return 403 without changing the subscription or its ceiling. Name-only edits and pausing delivery do not require these extra data scopes. The same restriction applies through MCP. API keys and legacy tokens can update only customer-managed subscriptions; application-owned subscriptions return 404, including empty updates to retrieve signing secrets.

Optional attributes

  • Name
    name
    Type
    string
    Description

    New label for the webhook.

  • Name
    url
    Type
    string
    Description

    New endpoint URL.

  • Name
    events
    Type
    array
    Description

    Replace the subscribed events list.

  • Name
    active
    Type
    boolean
    Description

    Set to false to pause delivery, true to resume.

Request

PATCH
/v1/webhooks/:id
curl -X PATCH https://app.phone.inc/api/v1/webhooks/01JVWX... \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active": false}'

Response

{
  "id": "01JVWX...",
  "name": "Slack notifications",
  "url": "https://example.com/webhooks",
  "events": ["call.initiated", "call.answered"],
  "active": false,
  "signing_secret": "f07b2e7e844d991e7df46ae01d3c5289a5b05aa71817f2f11b490be4457d22ad",
  "created_at": "2026-05-15T10:00:00Z",
  "updated_at": "2026-05-15T14:30:00Z"
}

DELETE/v1/webhooks/:id

Delete a webhook

Permanently removes a webhook subscription. Events will stop being delivered immediately. API keys and legacy tokens can delete only customer-managed subscriptions. Deleting an application-owned subscription requires the owning installation's OAuth credentials; other credentials receive 404.

Request

DELETE
/v1/webhooks/:id
curl -X DELETE https://app.phone.inc/api/v1/webhooks/01JVWX... \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Returns 204 No Content on success.


GET/v1/webhooks/:webhook_id/deliveries

List delivery attempts

Returns the latest 50 recorded attempts for one subscription, newest first. Each retry is a separate attempt. There are no pagination parameters. No attempts returns []; queued work does not appear until an attempt is recorded.

API keys can inspect webhooks in their company. Partner OAuth requires webhooks:read and can inspect only the installation's own subscriptions. Unknown or inaccessible subscriptions return 404. Diagnostics do not expand the subscription's saved scope ceiling or current installation permissions, and do not include the request payload. Partner OAuth responses also omit response_body, including transport and validation error text, because arbitrary receiver text can echo customer data. API keys and legacy tokens retain that field.

In the dashboard, open Webhooks and the subscription's delivery history to inspect the same latest 50 attempts. Refresh after sending a test to see its result.

Attempt properties

  • Name
    event
    Type
    string
    Description
    Event name, including webhook.test for synthetic tests.
  • Name
    test
    Type
    boolean
    Description
    Whether this is a synthetic test.
  • Name
    success
    Type
    boolean
    Description
    True only for an HTTP 2xx response.
  • Name
    response_code
    Type
    integer | null
    Description
    Destination HTTP status, or null when no response was received.
  • Name
    response_body
    Type
    string | null
    Description
    Response body or transport/validation error text, truncated to 1,000 characters. Omitted for partner OAuth tokens.
  • Name
    created_at
    Type
    timestamp
    Description
    ISO 8601 time the attempt was recorded.
  • Name
    delivered_at
    Type
    timestamp | null
    Description
    ISO 8601 delivery time for a successful attempt; otherwise null.

Request

GET
/v1/webhooks/:webhook_id/deliveries
curl https://app.phone.inc/api/v1/webhooks/01JVWX.../deliveries \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Response

[
  {
    "event": "webhook.test",
    "test": true,
    "success": true,
    "response_code": 200,
    "response_body": "OK",
    "created_at": "2026-10-22T12:00:00Z",
    "delivered_at": "2026-10-22T12:00:00Z"
  }
]

POST/v1/webhooks/:webhook_id/test

Send a test delivery

Queues a safe synthetic webhook.test event for this subscription only. No request body is needed. It contains test: true, a timestamp, and data.message: "Synthetic Phone.inc connectivity test. No customer data." It does not replay a real event, fan out to other subscriptions, or mutate customer records. webhook.test is not a subscribable production event.

API keys and legacy tokens can test only their company's customer-managed subscriptions; application-owned subscriptions return 404. Partner OAuth requires both webhooks:write and webhooks:read, and can test only its own installation's subscriptions. The installation must remain connected and webhook management must be allowed by both the subscription's saved scope ceiling and the installation's current scopes. Tests do not bypass those checks.

Returns 202 Accepted when queued, not when delivered. Unknown or inaccessible subscriptions return 404. A paused subscription returns 422 with errors.base asking you to resume it; unavailable installation management permission returns 422 asking you to reconnect. Missing token scopes return 403.

Use Send test delivery in dashboard delivery history for customer-managed subscriptions. Application-owned subscriptions are hidden from the customer dashboard; publishers inspect their application delivery log. Tests use the normal delivery job, URL/private-address protections, and retry policy. Inspect delivery attempts for the destination's response.

Request

POST
/v1/webhooks/:webhook_id/test
curl -X POST https://app.phone.inc/api/v1/webhooks/01JVWX.../test \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Response (202)

{ "status": "queued", "event": "webhook.test", "test": true }