Telefon Calls API

Make and manage phone calls

OpenAPI Specification

telefon-calls-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Telefon Number Management Available Numbers Calls API
  description: Search, purchase, configure, and manage phone numbers across 70+ countries. Supports local, national, mobile, toll-free, and short code numbers.
  version: v1
  contact:
    name: Telefon Support
    url: https://www.telefon.com/support
  termsOfService: https://www.telefon.com/terms
servers:
- url: https://api.telefon.com/v1/numbers
  description: Telefon Number Management API
security:
- ApiKeyAuth: []
tags:
- name: Calls
  description: Make and manage phone calls
paths:
  /calls:
    get:
      operationId: listCalls
      summary: List Calls
      description: Retrieve a paginated list of calls with filtering options.
      tags:
      - Calls
      parameters:
      - name: status
        in: query
        schema:
          type: string
          enum:
          - queued
          - ringing
          - in-progress
          - completed
          - failed
          - busy
          - no-answer
          - canceled
        description: Filter by call status
      - name: direction
        in: query
        schema:
          type: string
          enum:
          - inbound
          - outbound
        description: Filter by call direction
      - name: page
        in: query
        schema:
          type: integer
        description: Page number
      - name: page_size
        in: query
        schema:
          type: integer
          maximum: 100
        description: Results per page
      responses:
        '200':
          description: List of calls
          content:
            application/json:
              schema:
                type: object
                properties:
                  calls:
                    type: array
                    items:
                      $ref: '#/components/schemas/Call'
                  total:
                    type: integer
    post:
      operationId: createCall
      summary: Create Call
      description: Initiate an outbound voice call.
      tags:
      - Calls
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - to
              - from
              properties:
                to:
                  type: string
                  description: Destination phone number in E.164 format
                from:
                  type: string
                  description: Caller ID phone number (must be owned)
                url:
                  type: string
                  description: Webhook URL for call flow control
                status_callback:
                  type: string
                  description: URL to receive call status events
                timeout:
                  type: integer
                  default: 30
                  description: Seconds to wait for answer
                record:
                  type: boolean
                  description: Record the call automatically
      responses:
        '201':
          description: Call created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Call'
  /calls/{call_id}:
    get:
      operationId: getCall
      summary: Get Call
      description: Get details for a specific call by ID.
      tags:
      - Calls
      parameters:
      - name: call_id
        in: path
        required: true
        schema:
          type: string
        description: Unique call identifier
      responses:
        '200':
          description: Call details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Call'
        '404':
          description: Call not found
    delete:
      operationId: endCall
      summary: End Call
      description: Hang up an active call.
      tags:
      - Calls
      parameters:
      - name: call_id
        in: path
        required: true
        schema:
          type: string
        description: Unique call identifier
      responses:
        '204':
          description: Call ended
components:
  schemas:
    Call:
      type: object
      required:
      - id
      - status
      - direction
      - from
      - to
      properties:
        id:
          type: string
          description: Unique call identifier
        status:
          type: string
          enum:
          - queued
          - ringing
          - in-progress
          - completed
          - failed
          - busy
          - no-answer
          - canceled
          description: Current call status
        direction:
          type: string
          enum:
          - inbound
          - outbound
          description: Call direction
        from:
          type: string
          description: Originating phone number (E.164)
        to:
          type: string
          description: Destination phone number (E.164)
        duration:
          type: integer
          description: Duration in seconds
        start_time:
          type: string
          format: date-time
          description: When the call started
        end_time:
          type: string
          format: date-time
          description: When the call ended
        price:
          type: string
          description: Cost of the call
        price_unit:
          type: string
          description: ISO 4217 currency code
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key