Telnyx Whatsapp Phone Numbers API

Manage Whatsapp phone numbers

OpenAPI Specification

telnyx-whatsapp-phone-numbers-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  contact:
    email: support@telnyx.com
  description: Telnyx provides global communications and connectivity APIs for developers — including SIP trunking, programmable voice, SMS, MMS, WhatsApp Business Messaging, Call Control, Fax, Wireless (IoT & eSIM), Phone Numbers (DID provisioning & porting), Emergency Services, and Network APIs for private interconnects and edge connectivity. Build, scale, and manage voice, messaging, and data networks with Telnyx's carrier-grade global infrastructure and API-first platform.
  title: Telnyx Access Tokens Whatsapp Phone Numbers API
  version: 2.0.0
  x-endpoint-cost: light
servers:
- description: Version 2.0.0 of the Telnyx API
  url: https://api.telnyx.com/v2
security:
- bearerAuth: []
tags:
- description: Manage Whatsapp phone numbers
  name: Whatsapp Phone Numbers
paths:
  /v2/whatsapp/business_accounts/{id}/phone_numbers:
    post:
      operationId: InitializeWhatsappVerification
      parameters:
      - $ref: '#/components/parameters/WabaId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappPhoneNumberVerificationRequest'
        required: true
      responses:
        '204':
          description: Verification initiated
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Initialize Whatsapp phone number verification
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
  /v2/whatsapp/phone_numbers:
    get:
      operationId: ListPhoneNumbers
      parameters:
      - $ref: '#/components/parameters/PageConsolidated'
      responses:
        '200':
          $ref: '#/components/responses/WhatsappPhonesListResponse'
          description: Phone numbers
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: List Whatsapp phone numbers
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
  /v2/whatsapp/phone_numbers/{phone_number}:
    delete:
      operationId: DeleteWhatsappPhoneNumber
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      responses:
        '204':
          description: Phone number was successfully deleted
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Delete a Whatsapp phone number
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
  /v2/whatsapp/phone_numbers/{phone_number}/calling_settings:
    get:
      operationId: GetWhatsappCallingSettings
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      responses:
        '200':
          $ref: '#/components/responses/WhatsappCallingSettingsResponse'
          description: Calling settings
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Get calling settings for a phone number
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
    patch:
      operationId: PatchWhatsappCallingSettings
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappPatchCallingSettingsRequest'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/WhatsappCallingSettingsResponse'
          description: Updated calling settings
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Enable or disable Whatsapp calling for a phone number
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
  /v2/whatsapp/phone_numbers/{phone_number}/profile:
    get:
      operationId: GetWhatsappProfile
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      responses:
        '200':
          $ref: '#/components/responses/WhatsappProfileSingleResponse'
          description: Profile
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Get phone number business profile
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
    patch:
      operationId: PatchWhatsappProfile
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappUpdateProfileRequest'
        required: true
      responses:
        '200':
          $ref: '#/components/responses/WhatsappProfileSingleResponse'
          description: Updated profile
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Update phone number business profile
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
  /v2/whatsapp/phone_numbers/{phone_number}/profile/photo:
    delete:
      operationId: DeleteWhatsappProfilePhoto
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      responses:
        '204':
          description: Photo deleted
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Delete Whatsapp profile photo
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
    get:
      operationId: GetWhatsappProfilePhoto
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WhatsappProfilePhotoResponse'
          description: Profile photo
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Get Whatsapp profile photo
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
    post:
      operationId: PostWhatsappProfilePhoto
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      requestBody:
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  description: Image file (JPEG recommended, max 10 MB)
                  format: binary
                  type: string
              required:
              - file
              type: object
        required: true
      responses:
        '200':
          $ref: '#/components/responses/WhatsappProfileSingleResponse'
          description: Profile with updated photo
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Upload Whatsapp profile photo
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
  /v2/whatsapp/phone_numbers/{phone_number}/resend_verification:
    post:
      operationId: ResendWhatsappVerification
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappResendVerificationRequest'
        required: true
      responses:
        '204':
          description: Code resent
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Resend verification code
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
  /v2/whatsapp/phone_numbers/{phone_number}/verify:
    post:
      operationId: VerifyWhatsappPhoneNumber
      parameters:
      - $ref: '#/components/parameters/WhatsappPhoneNumber'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WhatsappVerifyCodeRequest'
        required: true
      responses:
        '204':
          description: Verified successfully
        4XX:
          $ref: '#/components/responses/messaging_GenericErrorResponse'
      summary: Submit verification code for a phone number
      tags:
      - Whatsapp Phone Numbers
      x-latency-category: responsive
components:
  schemas:
    WhatsappProfilePhotoResponse:
      properties:
        data:
          $ref: '#/components/schemas/WhatsappProfilePhotoData'
      type: object
    WhatsappProfileData:
      properties:
        about:
          maxLength: 139
          type: string
        address:
          type: string
        category:
          type: string
        created_at:
          format: date-time
          type: string
        description:
          maxLength: 512
          type: string
        display_name:
          type: string
        email:
          type: string
        id:
          type: string
        phone_number_id:
          description: Whatsapp phone number ID
          type: string
        profile_id:
          type: string
        profile_photo_url:
          type: string
        record_type:
          example: whatsapp_phone_number_profiles
          type: string
        updated_at:
          format: date-time
          type: string
        website:
          type: string
      type: object
    WhatsappVerifyCodeRequest:
      properties:
        code:
          type: string
      required:
      - code
      type: object
    WhatsappResendVerificationRequest:
      properties:
        verification_method:
          default: sms
          enum:
          - sms
          - voice
          type: string
      type: object
    WhatsappPhoneResponse:
      properties:
        calling_enabled:
          type: boolean
        created_at:
          format: date-time
          type: string
        display_name:
          type: string
        enabled:
          type: boolean
        phone_number:
          description: Phone number in E164 format
          type: string
        phone_number_id:
          description: Whatsapp phone number ID
          type: string
        quality_rating:
          description: Whatsapp quality rating
          type: string
        record_type:
          example: whatsapp_business_phone_number
          type: string
        status:
          type: string
        user_id:
          description: User ID
          type: string
        waba_id:
          description: WABA ID of Whatsapp business account
          type: string
      type: object
    WhatsappCallingSettingsData:
      properties:
        enabled:
          description: True if calling is enabled on the phone
          type: boolean
        phone_number:
          description: Phone number in E164 format
          type: string
        record_type:
          example: whatsapp_calling_settings
          type: string
        updated_at:
          format: date-time
          type: string
      type: object
    messaging_Errors:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/messaging_Error'
          type: array
    WhatsappPhoneNumberVerificationRequest:
      properties:
        display_name:
          type: string
        language:
          default: en_US
          type: string
        phone_number:
          type: string
        verification_method:
          default: sms
          enum:
          - sms
          - voice
          type: string
      required:
      - phone_number
      - display_name
      type: object
    messaging_PaginationMeta:
      properties:
        page_number:
          example: 2
          type: integer
        page_size:
          example: 25
          type: integer
        total_pages:
          example: 3
          type: integer
        total_results:
          example: 55
          type: integer
      required:
      - total_pages
      - total_results
      - page_size
      - page_number
      type: object
    WhatsappProfilePhotoData:
      properties:
        phone_number_id:
          description: Meta phone number ID
          type: string
        profile_photo_url:
          description: URL of the business profile photo (served by Meta's CDN). May be empty if no photo is set.
          type: string
        record_type:
          example: whatsapp_phone_number_profile_photos
          type: string
      type: object
    WhatsappPatchCallingSettingsRequest:
      properties:
        enabled:
          type: boolean
      required:
      - enabled
      type: object
    messaging_Error:
      properties:
        code:
          type: string
          x-format: integer
        detail:
          type: string
        meta:
          type: object
        source:
          properties:
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              format: json-pointer
              type: string
          type: object
        title:
          type: string
      required:
      - code
      - title
    WhatsappUpdateProfileRequest:
      properties:
        about:
          maxLength: 139
          type: string
        address:
          type: string
        category:
          type: string
        description:
          maxLength: 512
          type: string
        display_name:
          type: string
        email:
          type: string
        profile_id:
          description: Messaging profile ID for inbound messages
          format: uuid
          type: string
        website:
          type: string
      type: object
  responses:
    messaging_GenericErrorResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/messaging_Errors'
      description: Unexpected error
    WhatsappProfileSingleResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/WhatsappProfileData'
            type: object
      description: Successful response with Whatsapp profile
    WhatsappPhonesListResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                items:
                  $ref: '#/components/schemas/WhatsappPhoneResponse'
                type: array
              meta:
                $ref: '#/components/schemas/messaging_PaginationMeta'
            type: object
      description: Successful response with Whatsapp phone numbers
    WhatsappCallingSettingsResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/WhatsappCallingSettingsData'
            type: object
      description: Successful response with Whatsapp calling settings
  parameters:
    WabaId:
      description: Whatsapp Business Account ID
      in: path
      name: id
      required: true
      schema:
        type: string
    PageConsolidated:
      description: 'Consolidated page parameter (deepObject style). Originally: page[number], page[size]'
      explode: true
      in: query
      name: page
      schema:
        properties:
          number:
            default: 1
            description: The page number to load
            minimum: 1
            type: integer
          size:
            default: 20
            description: The size of the page
            maximum: 250
            minimum: 1
            type: integer
        type: object
      style: deepObject
    WhatsappPhoneNumber:
      description: Phone number (E.164 format)
      in: path
      name: phone_number
      required: true
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    branded-calling_bearerAuth:
      description: API key passed as a Bearer token in the Authorization header
      scheme: bearer
      type: http
    oauthClientAuth:
      description: OAuth 2.0 authentication for Telnyx API and MCP integrations
      flows:
        authorizationCode:
          authorizationUrl: https://api.telnyx.com/v2/oauth/authorize
          refreshUrl: https://api.telnyx.com/v2/oauth/token
          scopes:
            admin: Administrative access to Telnyx resources
          tokenUrl: https://api.telnyx.com/v2/oauth/token
        clientCredentials:
          scopes:
            admin: Administrative access to Telnyx resources
          tokenUrl: https://api.telnyx.com/v2/oauth/token
      type: oauth2
    outbound-voice-profiles_bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http
    pronunciation-dicts_bearerAuth:
      description: Telnyx API v2 key. Obtain from https://portal.telnyx.com
      scheme: bearer
      type: http
    stored-payment-transactions_bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http