Telnyx Billing API

Billing operations

OpenAPI Specification

telnyx-billing-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 Billing 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: Billing operations
  name: Billing
paths:
  /balance:
    get:
      operationId: GetUserBalance
      responses:
        '200':
          $ref: '#/components/responses/UserBalanceResponse'
        '403':
          $ref: '#/components/responses/billing_ForbiddenErrorResponse'
        '422':
          $ref: '#/components/responses/billing_UnprocessableEntityErrorResponse'
        '503':
          $ref: '#/components/responses/ServiceUnavailableErrorResponse'
        default:
          $ref: '#/components/responses/GenericErrorResponse'
      summary: Get user balance details
      tags:
      - Billing
      x-latency-category: responsive
components:
  responses:
    ServiceUnavailableErrorResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/billing_Errors'
      description: Service temporarily unavailable
    GenericErrorResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/billing_Errors'
      description: Unexpected error
    UserBalanceResponse:
      content:
        application/json:
          schema:
            properties:
              data:
                $ref: '#/components/schemas/UserBalance'
            type: object
      description: Get user balance details
    billing_UnprocessableEntityErrorResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/billing_Errors'
      description: Invalid or missing account information
    billing_ForbiddenErrorResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/billing_Errors'
      description: Insufficient permissions to access balance information
  schemas:
    billing_Errors:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/billing_Error'
          type: array
      type: object
    billing_Error:
      properties:
        code:
          type: string
        detail:
          type: string
        meta:
          additionalProperties: true
          type: object
        source:
          properties:
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
          type: object
        title:
          type: string
      required:
      - code
      - title
      type: object
    UserBalance:
      example:
        available_credit: '400.00'
        balance: '300.00'
        credit_limit: '100.00'
        currency: USD
        pending: '10.00'
        record_type: balance
      properties:
        available_credit:
          description: Available amount to spend (balance + credit limit)
          example: '400.00'
          type: string
        balance:
          description: The account's current balance.
          example: '300.00'
          type: string
        credit_limit:
          description: The account's credit limit.
          example: '100.00'
          type: string
        currency:
          description: The ISO 4217 currency identifier.
          example: USD
          type: string
        pending:
          description: The account’s pending amount.
          example: '10.00'
          type: string
        record_type:
          description: Identifies the type of the resource.
          enum:
          - balance
          example: balance
          type: string
      type: object
  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