Telefonie Voice API

Make, receive, and control phone calls programmatically. Supports outbound dialing, inbound call handling, call routing, IVR (Interactive Voice Response), call transfer, conferencing, and real-time call control via REST and WebSockets.

OpenAPI Specification

telefonie-voice-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Telefonie Voice API
  description: >-
    Make, receive, and control phone calls programmatically. Supports outbound
    dialing, inbound call handling, IVR, conferencing, call transfer, and real-time
    call control.
  version: 'v1'
  contact:
    name: Telefonie Support
    url: https://www.telefonie.com/support
    email: [email protected]
  termsOfService: https://www.telefonie.com/terms
servers:
  - url: https://api.telefonie.com/v1/voice
    description: Telefonie Voice API
security:
  - ApiKeyAuth: []
tags:
  - name: Calls
    description: Make and manage voice calls
  - name: Conferences
    description: Multi-party conferencing
  - name: Recordings
    description: Call recording management
paths:
  /calls:
    get:
      operationId: listCalls
      summary: List Calls
      description: Retrieve a paginated list of calls with optional filtering by status, direction, or date range.
      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: from
          in: query
          schema:
            type: string
          description: Filter calls from this phone number
        - name: to
          in: query
          schema:
            type: string
          description: Filter calls to this phone number
        - name: page
          in: query
          schema:
            type: integer
          description: Page number for pagination
        - name: page_size
          in: query
          schema:
            type: integer
            maximum: 100
          description: Number of 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
                  page:
                    type: integer
                  page_size:
                    type: integer
    post:
      operationId: initiateCall
      summary: Initiate Call
      description: Initiate an outbound phone call to a specified number.
      tags:
        - Calls
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to
                - from
              properties:
                to:
                  type: string
                  description: The phone number to call in E.164 format
                from:
                  type: string
                  description: The phone number to use as caller ID (must be a number you own)
                url:
                  type: string
                  description: Webhook URL to receive call events and control call flow
                method:
                  type: string
                  enum: [GET, POST]
                  description: HTTP method for the webhook URL
                status_callback:
                  type: string
                  description: URL to receive call status change events
                timeout:
                  type: integer
                  description: Number of seconds to wait for the call to be answered
                  default: 30
                record:
                  type: boolean
                  description: Whether to record the call
      responses:
        '201':
          description: Call initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Call'
  /calls/{call_id}:
    get:
      operationId: getCall
      summary: Get Call
      description: Retrieve details about a specific call by its ID.
      tags:
        - Calls
      parameters:
        - name: call_id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier for the call
      responses:
        '200':
          description: Call details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Call'
        '404':
          description: Call not found
    post:
      operationId: updateCall
      summary: Update Call
      description: Modify an in-progress call — mute, hold, transfer, or redirect to a new URL.
      tags:
        - Calls
      parameters:
        - name: call_id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier for the call
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum: [completed, canceled]
                  description: Change call status (hang up or cancel)
                url:
                  type: string
                  description: Redirect call to a new webhook URL
                method:
                  type: string
                  description: HTTP method for the redirect URL
      responses:
        '200':
          description: Call updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Call'
    delete:
      operationId: endCall
      summary: End Call
      description: Hang up an in-progress or ringing call.
      tags:
        - Calls
      parameters:
        - name: call_id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier for the call
      responses:
        '204':
          description: Call ended
  /conferences:
    get:
      operationId: listConferences
      summary: List Conferences
      description: List all active and completed conference calls.
      tags:
        - Conferences
      parameters:
        - name: status
          in: query
          schema:
            type: string
            enum: [init, in-progress, completed]
          description: Filter by conference status
      responses:
        '200':
          description: List of conferences
          content:
            application/json:
              schema:
                type: object
                properties:
                  conferences:
                    type: array
                    items:
                      $ref: '#/components/schemas/Conference'
    post:
      operationId: createConference
      summary: Create Conference
      description: Create a new conference room.
      tags:
        - Conferences
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                friendly_name:
                  type: string
                  description: A human-readable name for the conference
                max_participants:
                  type: integer
                  description: Maximum number of participants allowed
                  default: 250
                record:
                  type: boolean
                  description: Record the conference automatically
                status_callback:
                  type: string
                  description: URL to receive conference events
      responses:
        '201':
          description: Conference created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conference'
  /conferences/{conference_id}/participants:
    get:
      operationId: listConferenceParticipants
      summary: List Conference Participants
      description: List all participants currently in a conference.
      tags:
        - Conferences
      parameters:
        - name: conference_id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier for the conference
      responses:
        '200':
          description: List of participants
          content:
            application/json:
              schema:
                type: object
                properties:
                  participants:
                    type: array
                    items:
                      $ref: '#/components/schemas/Participant'
    post:
      operationId: addConferenceParticipant
      summary: Add Conference Participant
      description: Dial out and add a participant to an existing conference.
      tags:
        - Conferences
      parameters:
        - name: conference_id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier for the conference
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to
                - from
              properties:
                to:
                  type: string
                  description: Phone number to dial into the conference
                from:
                  type: string
                  description: Caller ID to use for the outbound dial
                muted:
                  type: boolean
                  description: Whether to mute the participant upon joining
      responses:
        '201':
          description: Participant added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Participant'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
  schemas:
    Call:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the call
        status:
          type: string
          enum: [queued, ringing, in-progress, completed, failed, busy, no-answer, canceled]
          description: Current status of the call
        direction:
          type: string
          enum: [inbound, outbound]
          description: Whether the call is inbound or outbound
        from:
          type: string
          description: The phone number that made the call
        to:
          type: string
          description: The phone number that was called
        duration:
          type: integer
          description: Duration of the call 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: Currency for the price
        recording_url:
          type: string
          description: URL to the call recording if recorded
      required:
        - id
        - status
        - direction
        - from
        - to
    Conference:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the conference
        friendly_name:
          type: string
          description: Human-readable name for the conference
        status:
          type: string
          enum: [init, in-progress, completed]
          description: Current status of the conference
        participant_count:
          type: integer
          description: Number of current participants
        max_participants:
          type: integer
          description: Maximum allowed participants
        date_created:
          type: string
          format: date-time
          description: When the conference was created
      required:
        - id
        - status
    Participant:
      type: object
      properties:
        call_id:
          type: string
          description: Call ID for this participant's connection
        conference_id:
          type: string
          description: Conference the participant is in
        muted:
          type: boolean
          description: Whether the participant is muted
        hold:
          type: boolean
          description: Whether the participant is on hold
        status:
          type: string
          description: Participant connection status
      required:
        - call_id
        - conference_id