Skip to main content
GET
This endpoint retrieves the current webhook configuration for a phone number, showing the URLs configured to receive voice call and SMS events.

How It Works

  1. Provider Detection: Automatically detects which provider owns the number
  2. Configuration Retrieval: Fetches current webhook URLs from the provider
  3. Detailed Response: Returns complete webhook configuration with metadata
Real-Time Data: This endpoint queries the provider directly to get the most current webhook configuration, not cached data.

Path Parameters

  • phone_number (string, required): Phone number to get webhooks for in E.164 format (e.g., +14155551234)

Query Parameters

  • provider (string, optional): Provider ("twilio" or "telnyx"). Auto-detected if not provided

Response

A successful request returns a 200 OK status with current webhook configuration.
Response

Response Fields

  • success (boolean): Whether the request completed successfully
  • phone_number (string): The queried phone number
  • provider (string): Provider that owns the number (“twilio” or “telnyx”)
  • voice_webhook_url (string): Current voice webhook URL
  • sms_webhook_url (string): Current SMS webhook URL
  • configuration (object): Complete webhook configuration details
    • For Twilio:
      • voice_method (string): HTTP method for voice webhooks
      • sms_method (string): HTTP method for SMS webhooks
      • status_callback_url (string): URL for status callbacks
      • phone_number_sid (string): Twilio phone number SID
      • friendly_name (string): Display name for the number
    • For Telnyx:
      • connection_id (string): Associated connection ID
      • phone_number_id (string): Telnyx phone number ID
      • status (string): Number status
      • features (array): Supported features

Error Responses

400 Bad Request

Returned when the request contains invalid parameters.

404 Not Found

Returned when the phone number is not found.

500 Internal Server Error

Returned when the provider API fails.

Provider-Specific Responses

Twilio Response Example

Telnyx Response Example

Telnyx Limitation: Telnyx webhook URLs are configured at the Connection/Application level, so the exact webhook URLs may not be directly retrievable via the phone number API. The response indicates they are “Configured at Connection level”.

Use Cases

Configuration Audit

Verify webhook configurations across all numbers:

Environment Verification

Confirm webhooks point to the correct environment:

Debugging Call Issues

Check webhook configuration when troubleshooting:

Integration Examples

Node.js

Python

PHP

Batch Operations

Check Multiple Numbers

Environment Comparison

Monitoring and Alerting

Webhook Health Check

Configuration Drift Detection

Best Practices

Regular Auditing

  1. Daily Checks: Verify webhook configurations daily
  2. Environment Validation: Ensure correct environment URLs
  3. Accessibility Testing: Test webhook URL accessibility
  4. Provider Sync: Compare with provider console settings

Error Handling

Caching Strategy

This endpoint is essential for maintaining visibility into your webhook configurations and ensuring your phone numbers are properly connected to your application’s event handling endpoints.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

phone_number
string
required

Query Parameters

provider
string | null

Response

Successful Response

Response model for getting current webhook URLs.

success
boolean
required
phone_number
string
required
provider
string
required
configuration
Configuration · object
required
voice_webhook_url
string | null
sms_webhook_url
string | null