Telstra SMS API

Send, retrieve, and check status of SMS messages.

OpenAPI Specification

telstra-sms-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Telstra Messaging Authentication SMS API
  description: 'The Telstra Messaging API provides programmatic SMS and MMS messaging

    services in Australia and select international destinations. Built on

    the Telstra mobile network, the API supports outbound and inbound

    SMS/MMS, delivery status callbacks, virtual numbers, and provisioning

    workflows. Authentication uses OAuth 2.0 client credentials with the

    NSMS scope.

    '
  version: 2.2.10
  contact:
    name: Telstra Developer Support
    url: https://dev.telstra.com
  termsOfService: https://www.telstra.com.au/business-enterprise/legal/messaging-api-terms-of-service
  license:
    name: Telstra Developer License
    url: https://github.com/telstra/tdev-doc-license
  x-logo:
    url: https://www.telstra.com.au/etc/designs/telstrav8/clientlibs/img/Telstra_Symbol.svg
servers:
- url: https://tapi.telstra.com/v2
  description: Production Server
security:
- OAuth2ClientCredentials:
  - NSMS
tags:
- name: SMS
  description: Send, retrieve, and check status of SMS messages.
paths:
  /messages/sms:
    post:
      summary: Telstra Send SMS
      description: Send a single SMS message to one or more destination numbers. Returns a message ID per destination plus delivery and reply callback registrations.
      operationId: sendSms
      tags:
      - SMS
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendSmsRequest'
      responses:
        '201':
          description: SMS accepted for delivery.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
    get:
      summary: Telstra Get SMS Replies
      description: Retrieve queued inbound SMS replies for the authenticated dedicated virtual number.
      operationId: getSmsReplies
      tags:
      - SMS
      responses:
        '200':
          description: Reply payload (empty if no replies are queued).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboundMessage'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /messages/sms/{messageId}/status:
    get:
      summary: Telstra Get SMS Status
      description: Retrieve the current delivery status for a previously sent SMS by message ID.
      operationId: getSmsStatus
      tags:
      - SMS
      parameters:
      - name: messageId
        in: path
        required: true
        schema:
          type: string
        description: Server-issued message identifier returned from POST /messages/sms.
      responses:
        '200':
          description: Current delivery status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageStatus'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Forbidden:
      description: Forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Too Many Requests.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    BadRequest:
      description: Bad Request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    MessageReceipt:
      type: object
      required:
      - to
      - deliveryStatus
      - messageId
      properties:
        to:
          type: string
        deliveryStatus:
          type: string
          enum:
          - MessageWaiting
          - DeliveredToNetwork
          - MessageBuffered
          - DeliveredToTerminal
          - DeliveryImpossible
          - Rejected
        messageId:
          type: string
        messageStatusURL:
          type: string
          format: uri
    InboundMessage:
      type: object
      properties:
        status:
          type: string
          enum:
          - EMPTY
          - RECEIVED
        destinationAddress:
          type: string
        senderAddress:
          type: string
        message:
          type: string
        messageId:
          type: string
        sentTimestamp:
          type: string
          format: date-time
        apiMsgId:
          type: string
    SendMessageResponse:
      type: object
      required:
      - messages
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/MessageReceipt'
        country:
          type: array
          items:
            type: object
        messageType:
          type: string
        numberSegments:
          type: integer
        numberNationalDestinations:
          type: integer
        numberInternationalDestinations:
          type: integer
    ErrorResponse:
      type: object
      required:
      - status
      - code
      - message
      properties:
        status:
          type: string
        code:
          type: string
        message:
          type: string
    MessageStatus:
      type: object
      required:
      - to
      - sentTimestamp
      - status
      properties:
        to:
          type: string
        sentTimestamp:
          type: string
          format: date-time
        receivedTimestamp:
          type: string
          format: date-time
        status:
          type: string
          enum:
          - MessageWaiting
          - DeliveredToNetwork
          - MessageBuffered
          - DeliveredToTerminal
          - DeliveryImpossible
          - Rejected
    SendSmsRequest:
      type: object
      required:
      - to
      - body
      properties:
        to:
          oneOf:
          - type: string
          - type: array
            items:
              type: string
          description: One or more destination MSISDNs in E.164 format.
        body:
          type: string
          description: The SMS message body. UCS-2 supported.
          maxLength: 1900
        from:
          type: string
          description: Sender ID or virtual number override; subject to provisioning and regulatory approvals.
        validity:
          type: integer
          description: Validity period in minutes (1 to 1440).
          minimum: 1
          maximum: 1440
        scheduledDelivery:
          type: integer
          description: Delay in minutes before the message is dispatched (1 to 1440).
          minimum: 1
          maximum: 1440
        notifyURL:
          type: string
          format: uri
          description: HTTPS callback URL to receive delivery status notifications.
        replyRequest:
          type: boolean
          description: Whether to enable inbound reply tracking on this message.
        priority:
          type: boolean
          description: Whether the message is sent at high priority.
        receiptOff:
          type: boolean
          description: Suppress carrier-side delivery receipts.
        userMsgRef:
          type: string
          description: Application-supplied reference echoed back in callbacks and status retrieval.
  securitySchemes:
    OAuth2ClientCredentials:
      type: oauth2
      description: OAuth 2.0 client credentials grant against https://tapi.telstra.com/v2/oauth/token with the NSMS scope.
      flows:
        clientCredentials:
          tokenUrl: https://tapi.telstra.com/v2/oauth/token
          scopes:
            NSMS: Send and receive SMS/MMS through Telstra Messaging.