> ## Documentation Index
> Fetch the complete documentation index at: https://docs.otpiq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Track SMS

> Get the delivery status of a specific SMS message.



## OpenAPI

````yaml GET /sms/track/{smsId}
openapi: 3.1.1
info:
  title: OTPIQ SMS API
  description: >-
    Enterprise-grade SMS and messaging API for sending verification codes,
    custom messages, and managing sender IDs. Supports multiple providers
    including SMS, WhatsApp, and Telegram with intelligent fallback routing.


    ## Features


    * **Multi-Provider Support**: Send messages via SMS, WhatsApp, or Telegram

    * **Smart Fallback Routes**: Automatic provider switching for maximum
    delivery success

    * **Verification Codes**: Automated OTP delivery with customizable codes

    * **Custom Messages**: Send personalized messages with custom sender IDs

    * **Rate Limiting**: Built-in protection against abuse

    * **Spending Controls**: Configurable spending thresholds and credit
    management

    * **Real-time Tracking**: Monitor message delivery status

    * **Sender ID Management**: Register and manage custom sender IDs

    * **Webhook Notifications**: Real-time delivery status updates via webhooks


    ## Provider Options


    OTPIQ now offers 6 provider options including smart fallback routes:


    - **`whatsapp-sms`**: Try WhatsApp first, fallback to SMS

    - **`telegram-sms`**: Try Telegram first, fallback to SMS

    - **`whatsapp-telegram-sms`**: Try WhatsApp → Telegram → SMS (maximum
    delivery success)

    - **`sms`**: SMS only

    - **`whatsapp`**: WhatsApp only

    - **`telegram`**: Telegram only


    ## Authentication


    All API requests require authentication using your project API key. Include
    it in the Authorization header:


    ```

    Authorization: Bearer sk_live_your_api_key_here

    ```


    ## Webhooks


    OTPIQ provides real-time delivery status notifications via webhooks. See the
    Webhooks section for detailed documentation and examples.


    ## Support


    * **Documentation**: [https://docs.otpiq.com](https://docs.otpiq.com)

    * **Support Email**: info@otpiq.com
  version: 1.0.0
  contact:
    name: OTPIQ Support
    url: https://otpiq.com
    email: info@otpiq.com
  license:
    name: Commercial
    url: https://otpiq.com/terms
servers:
  - url: https://api.otpiq.com/api
    description: Production API
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: API key authentication and project information
  - name: SMS
    description: >-
      Send SMS messages, verification codes, and track delivery with multiple
      provider options and fallback routing
  - name: Sender IDs
    description: Manage custom sender IDs for your messages
  - name: Webhooks
    description: Real-time delivery status notifications via webhooks
  - name: Delivery Reports
    description: Generate and list CSV delivery reports for SMS/messages in a date range
  - name: Pricing
    description: Retrieve international SMS pricing information
  - name: WhatsApp
    description: >-
      List WhatsApp businesses, accounts, phone numbers, and message templates
      connected to a project
externalDocs:
  description: OTPIQ Documentation
  url: https://docs.otpiq.com
paths:
  /sms/track/{smsId}:
    get:
      tags:
        - SMS
      summary: Track SMS
      description: Get the delivery status of a specific SMS message.
      operationId: trackSMS
      parameters:
        - name: smsId
          in: path
          description: The SMS ID to track
          required: true
          schema:
            type: string
            pattern: ^sms-[a-f0-9]{24}$
            examples:
              - sms-1234567890abcdef123456
      responses:
        '200':
          description: >-
            SMS status retrieved successfully. Response body includes
            SMSTrackingResponse with fields: smsId, phoneNumber, status, cost,
            isFinalStatus, lastChannel, channelFlow[].
          content:
            application/json:
              schema:
                type: object
                required:
                  - smsId
                  - phoneNumber
                  - status
                  - cost
                  - isFinalStatus
                  - lastChannel
                  - channelFlow
                properties:
                  smsId:
                    type: string
                    description: Unique identifier for the SMS message
                    pattern: ^sms-[a-f0-9]{24}$
                    examples:
                      - sms-1234567890abcdef123456
                  phoneNumber:
                    type: string
                    description: Phone number the SMS was sent to
                    examples:
                      - '964750123456'
                  status:
                    type: string
                    enum:
                      - pending
                      - sent
                      - delivered
                      - read
                      - failed
                    description: Current status of the SMS message
                    examples:
                      - sent
                  cost:
                    type: number
                    description: Cost of the SMS in IQD
                    minimum: 0
                    examples:
                      - 200
                  isFinalStatus:
                    type: boolean
                    description: >-
                      Whether the SMS has reached a final state (no further
                      attempts will be made)
                    examples:
                      - false
                  lastChannel:
                    type: string
                    description: >-
                      The last channel attempted or used for sending. One of
                      'sms', 'whatsapp', 'telegram'.
                  channelFlow:
                    type: array
                    description: Sequence of channels and their attempt statuses
                    items:
                      type: object
                      required:
                        - channel
                        - tried
                      properties:
                        channel:
                          type: string
                          description: Messaging channel
                          enum:
                            - sms
                            - whatsapp
                            - telegram
                        tried:
                          type: boolean
                          description: Whether this channel was attempted
                        success:
                          type:
                            - boolean
                            - 'null'
                          description: >-
                            Whether this channel succeeded (null if not tried
                            yet)
                        error:
                          type:
                            - string
                            - 'null'
                          description: Error message if the attempt failed
                        refunded:
                          type:
                            - boolean
                            - 'null'
                          description: >-
                            Whether the cost for this channel was refunded (when
                            applicable)
              examples:
                success:
                  summary: Successful response
                  value:
                    smsId: sms-1234567890abcdef123456
                    phoneNumber: '964750123456'
                    status: sent
                    cost: 200
                    isFinalStatus: false
                    lastChannel: whatsapp
                    channelFlow:
                      - channel: whatsapp
                        tried: true
                        success: true
                      - channel: sms
                        tried: false
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: SMS not found
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                    description: Not found error message
                    examples:
                      - SMS not found
              examples:
                not_found:
                  summary: SMS not found
                  value:
                    message: SMS not found
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearerAuth: []
components:
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            required:
              - message
            properties:
              message:
                type: string
                description: Unauthorized error message
                examples:
                  - Unauthorized, please use your project api key
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            required:
              - message
            properties:
              message:
                type: string
                description: Internal server error message
                examples:
                  - Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Project API key (`sk_live…` or `sk_dev…`). Send it as `Authorization:
        Bearer <api_key>`.

````