Telefonie Number Management API

Search, purchase, configure, and manage phone numbers across multiple countries and number types (local, national, toll-free, mobile). Supports number portability (LNP), number lookup, capabilities checking, and configuring inbound call/SMS routing for numbers.

OpenAPI Specification

telefonie-numbers-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Telefonie Number Management API
  description: >-
    Search, purchase, configure, and manage phone numbers. Supports local, national,
    toll-free, and mobile numbers across multiple countries with full lifecycle management.
  version: 'v1'
  contact:
    name: Telefonie Support
    url: https://www.telefonie.com/support
  termsOfService: https://www.telefonie.com/terms
servers:
  - url: https://api.telefonie.com/v1/numbers
    description: Telefonie Number Management API
security:
  - ApiKeyAuth: []
tags:
  - name: Available Numbers
    description: Search for phone numbers to purchase
  - name: Owned Numbers
    description: Manage phone numbers in your account
paths:
  /available:
    get:
      operationId: searchAvailableNumbers
      summary: Search Available Numbers
      description: Search for available phone numbers matching specified criteria.
      tags:
        - Available Numbers
      parameters:
        - name: country_code
          in: query
          required: true
          schema:
            type: string
          description: ISO 3166-1 alpha-2 country code (e.g., US, GB, DE)
        - name: type
          in: query
          schema:
            type: string
            enum: [local, national, toll-free, mobile]
          description: Type of phone number
        - name: area_code
          in: query
          schema:
            type: string
          description: Desired area code for local numbers
        - name: contains
          in: query
          schema:
            type: string
          description: Pattern to match in the number (digits only)
        - name: sms_enabled
          in: query
          schema:
            type: boolean
          description: Filter to numbers with SMS capability
        - name: voice_enabled
          in: query
          schema:
            type: boolean
          description: Filter to numbers with voice capability
        - name: limit
          in: query
          schema:
            type: integer
            maximum: 20
          description: Maximum number of results to return
      responses:
        '200':
          description: List of available numbers
          content:
            application/json:
              schema:
                type: object
                properties:
                  available_numbers:
                    type: array
                    items:
                      $ref: '#/components/schemas/AvailableNumber'
  /owned:
    get:
      operationId: listOwnedNumbers
      summary: List Owned Numbers
      description: List all phone numbers in your account.
      tags:
        - Owned Numbers
      parameters:
        - name: type
          in: query
          schema:
            type: string
            enum: [local, national, toll-free, mobile]
          description: Filter by number type
        - name: page
          in: query
          schema:
            type: integer
          description: Page number
        - name: page_size
          in: query
          schema:
            type: integer
            maximum: 100
      responses:
        '200':
          description: List of owned numbers
          content:
            application/json:
              schema:
                type: object
                properties:
                  numbers:
                    type: array
                    items:
                      $ref: '#/components/schemas/OwnedNumber'
                  total:
                    type: integer
    post:
      operationId: purchaseNumber
      summary: Purchase Number
      description: Purchase a phone number and add it to your account.
      tags:
        - Owned Numbers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - phone_number
              properties:
                phone_number:
                  type: string
                  description: Phone number to purchase in E.164 format
                voice_url:
                  type: string
                  description: Webhook URL for incoming voice calls
                sms_url:
                  type: string
                  description: Webhook URL for incoming SMS messages
                friendly_name:
                  type: string
                  description: Human-readable label for the number
      responses:
        '201':
          description: Number purchased
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedNumber'
  /owned/{phone_number}:
    get:
      operationId: getOwnedNumber
      summary: Get Owned Number
      description: Get configuration details for a specific owned phone number.
      tags:
        - Owned Numbers
      parameters:
        - name: phone_number
          in: path
          required: true
          schema:
            type: string
          description: Phone number in E.164 format (URL-encoded)
      responses:
        '200':
          description: Phone number details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedNumber'
    post:
      operationId: updateOwnedNumber
      summary: Update Owned Number
      description: Update the configuration (webhooks, friendly name) for an owned number.
      tags:
        - Owned Numbers
      parameters:
        - name: phone_number
          in: path
          required: true
          schema:
            type: string
          description: Phone number in E.164 format
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                voice_url:
                  type: string
                  description: Webhook URL for incoming voice calls
                sms_url:
                  type: string
                  description: Webhook URL for incoming SMS messages
                friendly_name:
                  type: string
                  description: Updated label for the number
      responses:
        '200':
          description: Number updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OwnedNumber'
    delete:
      operationId: releaseNumber
      summary: Release Number
      description: Release a phone number from your account. This action cannot be undone.
      tags:
        - Owned Numbers
      parameters:
        - name: phone_number
          in: path
          required: true
          schema:
            type: string
          description: Phone number in E.164 format
      responses:
        '204':
          description: Number released
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
  schemas:
    AvailableNumber:
      type: object
      properties:
        phone_number:
          type: string
          description: Phone number in E.164 format
        friendly_name:
          type: string
          description: Formatted phone number for display
        country_code:
          type: string
          description: ISO country code
        type:
          type: string
          enum: [local, national, toll-free, mobile]
          description: Number type
        capabilities:
          type: object
          properties:
            voice:
              type: boolean
            sms:
              type: boolean
            mms:
              type: boolean
          description: Supported capabilities for this number
        monthly_rate:
          type: string
          description: Monthly cost for this number
      required:
        - phone_number
        - country_code
        - type
    OwnedNumber:
      type: object
      properties:
        phone_number:
          type: string
          description: Phone number in E.164 format
        friendly_name:
          type: string
          description: Human-readable label
        type:
          type: string
          enum: [local, national, toll-free, mobile]
          description: Number type
        country_code:
          type: string
          description: ISO country code
        capabilities:
          type: object
          properties:
            voice:
              type: boolean
            sms:
              type: boolean
            mms:
              type: boolean
        voice_url:
          type: string
          description: Webhook URL for incoming calls
        sms_url:
          type: string
          description: Webhook URL for incoming SMS
        date_created:
          type: string
          format: date-time
          description: When the number was purchased
        monthly_rate:
          type: string
          description: Monthly rental rate
      required:
        - phone_number
        - type