# Send SMS

Sends an SMS message using the required sender ID, recipient and text fields and optionally include callback and reference ID fields.<br><br><b>Authentication options:</b> either use a <b>Promotexter token</b> in the Authorization header, or provide `apiKey` and `apiSecret` in the request body. Refer to the <a href="https://promotexter-api.redocly.app/api/api-authentication" target="_blank" rel="noopener noreferrer">API Authentication</a> section for details.<br><br>

Endpoint: POST /sms/send

## Request fields (application/json):

  - `apiKey` (string)
    Your API key.  Required only when not using a Promotexter-generated bearer token.
    Example: your-api-key

  - `apiSecret` (string)
    Your API secret.  Required only when not using a Promotexter-generated bearer token.
    Example: your-api-secret

  - `from` (string, required)
    Your SMS sender name. This would appear as the sender of the SMS message.  Must be whitelisted to your account.
    Example: TestSender

  - `to` (string, required)
    Recipient of the message.  Must be a valid mobile number.
    Example: 639123456789

  - `text` (string, required)
    SMS message content.  Up to 10-message parts (1530 standard-GSM or 670 Unicode characters).  URLs in the message content must be safelisted. To safelist your URL, you can contact our Support team at support@promotexter.com
    Example: Hello, this is a test message.

  - `dlrReport` (integer)
    Enable DLR notifications for this transaction.  Set to `1` to send DLR notifications to the indicated `dlrCallback`.  Set to `0` to disable DLR notifications.  Overrides account settings.
    Example: 1

  - `dlrCallback` (string)
    [Legacy] Your own API endpoint where DLR notifications will be sent via the GET method.  Overrides account settings.
    Example: https://example.com/dlr

  - `dlrCallbackConfig` (object)
    Configuration for receiving DLR notifications via the POST method.

  - `dlrCallbackConfig.url` (string, required)
    Your own API endpoint where DLR notifications will be sent.  URL must be safelisted. To safelist your URL, contact support@promotexter.com
    Example: https://example.com

  - `dlrCallbackConfig.headers` (object)
    Key-value pairs of HTTP headers to include in the callback request. Headers must be safelisted. To safelist your headers, contact support@promotexter.com.

  - `dlrCallbackConfig.body` (object)
    Key-value pairs to include in the callback request body. Values may contain dynamic placeholders that will be replaced with actual transaction values. See the supported placeholders in the **DLR Notification POST** under the [Callbacks](#operation/sendSms/callbacks) section.

  - `referenceId` (string)
    Your own reference ID to the transaction.  Up to 60 characters.
    Example: TXN-20260514-0001

## Response 200 fields (application/json):

  - `status` (string, required)
    Example: ok

  - `data` (object, required)

  - `data.id` (string, required)
    Example: 9f6393ce-4eff-41d6-a03b-64d267056d03

  - `data.unitCost` (number, required)
    Example: 0.5

  - `data.transactionCost` (number, required)
    Example: 0.5

  - `data.operatorCode` (string, required)
    Example: PHL_GLOBE

  - `data.messageParts` (integer, required)
    Example: 1

  - `data.from` (string, required)
    Example: Promotexter

  - `data.to` (string, required)
    Example: 639170000001

  - `data.source` (string, required)
    Example: 112.198.221.111

  - `data.remaining` (integer, required)
    Example: 100

## Response 400 fields (application/problem+json):

  - `code` (integer)
    Example: 40004

  - `message` (string)
    Example: Bad Request. Description: [description]

## Response 401 fields (application/problem+json):

  - `code` (integer)
    Example: 40001

  - `message` (string)
    Example: Unauthorized Access.

## Response 422 fields (application/problem+json):

  - `code` (integer)
    Example: 200100

  - `message` (string)
    Example: Parameters validation error.

