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

# Send Sms

> Send Sms to different destinations.



## OpenAPI

````yaml post /sms
openapi: 3.0.0
info:
  title: Hub2 Service · Api
  description: |-
    This is the Hub2 api reference |
          Please check https://docs.hub2.io/ for the full documentation |
          Rate limits of endpoints are here : https://docs.hub2.io/en/details/limits.html.
  version: 2.149.1
  contact:
    name: Hub2
    url: https://www.hub2.io/
    email: contact@hub2.io
servers: []
security: []
tags:
  - name: Payments
    description: >-
      Best known as the PAY-IN API, it provides endpoints for merchants to
      perform Hub2 PAY-IN transactions.
  - name: Transfers
    description: >-
      Best known as the PAY-OUT API, it provides endpoints for merchants to
      perform Hub2 PAY-OUT transactions.
  - name: IRT
    description: International Remittance Transfers
  - name: Balance
    description: ''
  - name: Webhooks
    description: ''
  - name: Provisioning
    description: ''
  - name: Payment on Terminal
    description: ''
  - name: Receipt
    description: ''
  - name: Sms
    description: ''
  - name: Data
    description: ''
  - name: Compliance
    description: ''
  - name: Recipient
    description: ''
  - name: Delegation
    description: ''
  - name: Deposits
    description: ''
  - name: Payment Links
    description: ''
  - name: Submerchants
    description: ''
paths:
  /sms:
    post:
      tags:
        - Sms
      summary: Send Sms
      description: Send Sms to different destinations.
      operationId: SmsController_send
      parameters:
        - name: ApiKey
          in: header
          description: >-
            Your api key. To create a key, please get into our dashboard. If you
            don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: MerchantId
          in: header
          description: >-
            Your merchant ID. This information is available in our dashboard. If
            you don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: Environment
          in: header
          description: >-
            Allow you to choose between the sandbox mode to perform some tests
            or the live mode for real world transactions.
          required: true
          schema:
            enum:
              - live
              - sandbox
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendSmsDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SmsDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadRequestErrorAlias'
        '401':
          description: Wrong credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorizedErrorAlias'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInternalErrorAlias'
components:
  schemas:
    SendSmsDto:
      type: object
      properties:
        destinations:
          description: >-
            Array of destinations number with country code (+44...) or in
            international format (0044 ...)
          example: '["+3300000000","+330000001"]'
          type: array
          items:
            type: string
        message:
          type: string
          description: Message content
          example: my message
        senderName:
          type: string
          description: Merchant name
          example: my company
        webhookUrl:
          type: string
          description: Webhook Url
          example: https://my.webhook.target
          deprecated: true
      required:
        - destinations
        - message
        - senderName
    SmsDto:
      type: object
      properties:
        id:
          type: string
          description: unique identifier for the sms.
          example: sms_QIVmCKgbOAcXm4BbVt15H
        senderId:
          type: string
          description: Identifier of the merchant that send the sms
          example: '1'
        senderName:
          type: string
          description: name of the merchant that send the sms
          example: my_company
        destination:
          type: string
          description: >-
            Number of the recipient with country code (+44...) or in
            international format (0044 ...)
          example: '+33600000000'
        smsCount:
          type: number
          description: >-
            Number of Sms sent , depending on the message length (1 sms per 160
            character)
          example: '7'
        message:
          type: string
          description: Message content
          example: My message
        status:
          type: string
          description: Status of the sms
          example: received
        createdAt:
          type: string
          description: |-
            Datetime in UTC timezone at which the sms was created.
                Follows the[Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601). 
          example: '2021-08-19 11:00:31.225+00'
        sentAt:
          type: string
          description: |-
            Datetime in UTC timezone at which the sms was sent.
                Follows the[Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601). 
          example: '2021-08-19 11:00:31.229+00'
        receivedAt:
          type: string
          description: |-
            Datetime in UTC timezone at which the sms was received.
                Follows the[Datetime ISO](https://en.wikipedia.org/wiki/ISO_8601). 
          example: '2021-08-19 11:00:32.225+00'
        failureCause:
          description: Object describing the failure
          example: |-
            {"FailureCause": "not_delivered",
                "message":"Le message a été envoyé mais n'a pas pu être délivré."
              }
          allOf:
            - $ref: '#/components/schemas/SmsFailureCauseDto'
      required:
        - id
        - senderId
        - senderName
        - destination
        - smsCount
        - message
        - status
        - createdAt
        - sentAt
        - receivedAt
        - failureCause
    ApiBadRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP error code.
          example: 400
        error:
          description: HTTP error description.
          allOf:
            - $ref: '#/components/schemas/InternalApiBadRequestError'
      required:
        - status
        - error
    ApiUnauthorizedErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP error code.
          example: 401
        error:
          description: HTTP error description.
          allOf:
            - $ref: '#/components/schemas/InternalApiUnauthorizedError'
      required:
        - status
        - error
    ApiInternalErrorAlias:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: internal_error
        code:
          type: string
          description: The error code for this error.
          example:
            - internal_error
            - wrong_credentials
            - not_granted
            - live_mode_not_granted
            - invalid_sandbox_msisdn
            - invalid_url
            - orange_invalid_url
            - wrong_provider
            - override_business_name
            - do_not_override_business_name
        message:
          type: string
          description: The error message describing what happens to throw this error.
          example: An error occurred on our system. Please try again later.
      required:
        - type
        - code
        - message
    SmsFailureCauseDto:
      type: object
      properties: {}
    InternalApiBadRequestError:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP error code.
          example: 400
        message:
          description: >-
            Detailed error message or array of messages to describe what's
            wrong.
          example:
            - destination.provider must be a string
          type: array
          items:
            type: string
        error:
          type: string
          description: The error message
          example: Bad Request
      required:
        - statusCode
        - message
        - error
    InternalApiUnauthorizedError:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: authorization_error
        code:
          type: string
          description: The internal error code describing what happened.
          enum:
            - bad_payment_intent_token
            - wrong_credentials
          example: wrong_credentials
        message:
          type: string
          description: Detailed error message which describe what happened.
          example: L'ID marchand et/ou la clé d'API sont incorrects.
      required:
        - type
        - code
        - message

````