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

# Send an SMS

> Send one SMS, the same SMS to a bulk list, or different SMS messages to multiple recipients.

Use this endpoint to send SMS through the active QuickSend SMS integration in the selected project environment. It supports a single recipient, a bulk list with one message, and a small bulk list with different messages.

<Warning>
  This is a real external action. A successful response confirms that QuickSend accepted the request; it is not final delivery proof. While testing, send messages only to phone numbers you own or are allowed to use. Do not automatically retry after a timeout or uncertain provider outcome, because that can send duplicate messages. In the Documentation Playground, turn on `X-Confirm-Send` only after reviewing every recipient and message.
</Warning>

<Info>
  **Live Testing Guide:** Before using **Try it**, create a Development project, then enter its **Client ID** and **Client Secret**. Configure the relevant provider for that project before sending the request.
</Info>

## API endpoint

```text title="POST" theme={null}
https://avraapi.com/api/v1/sms/send
```

## Request fields

| Field | Required | Rules |
| - | - | - |
| `send_method` | Yes | One of `single`, `bulk_same`, or `bulk_different`. |
| `to` | For `single` | One QuickSend-compatible Sri Lankan number: local `07XXXXXXXX` or E.164 `+947XXXXXXXX`. |
| `message` | For `single` and `bulk_same` | Message text. Input is capped at 4,096 characters and each recipient message may use at most three SMS units. |
| `recipients` | For `bulk_same` | Array of 1–10,000 QuickSend-compatible Sri Lankan numbers. |
| `check_cost` | No; `bulk_same` only | Boolean. With `true`, QuickSend returns campaign cost information instead of sending the bulk campaign. |
| `msg_list` | For `bulk_different` | Array of 1–20 objects. Every object needs `to` and `msg`. |
| `msg_list[].to` | For `bulk_different` | One QuickSend-compatible Sri Lankan number. |
| `msg_list[].msg` | For `bulk_different` | Message text for that recipient, with the same three-unit maximum. |

Use a **Managed** QuickSend integration for `single` only. `bulk_same` and `bulk_different` require a **Manual (BYOK)** QuickSend integration. `check_cost` is forwarded only for `bulk_same`; setting it for `bulk_different` does not turn that request into a cost estimate and the messages are still sent.

## SMS units and character limits

AvraAPI calculates `message_count` from SMS units, not simply from the number of API requests. For predictable message sizing and billing, use **153 GSM-7 characters** per SMS unit or **67 Unicode (UCS-2) characters** per SMS unit. Each individual recipient message is limited to a maximum of **3 SMS units**. Therefore, a `single` request can return a maximum `message_count` of `3`; a bulk response reports the total units across all recipients and can be higher.

For example, a two-recipient `bulk_same` campaign with a one-unit message returns `message_count: 2`. A long or Unicode `single` message can return a `message_count` greater than one.

## Result fields

| Field | Type | Notes |
| - | - | - |
| `send_method` | string | The accepted AvraAPI send method. |
| `message_count` | integer | Total calculated SMS units across the request. |
| `credits_charged` | integer | AvraAPI credits charged for this request. Manual (BYOK) sends return `0`; QuickSend may charge the connected provider account separately. |
| `provider_response` | object | Raw QuickSend acceptance or cost-estimate response. Its fields vary by QuickSend operation. |

## Single SMS

### Request example

```bash curl theme={null} theme={null}
curl --request POST "https://avraapi.com/api/v1/sms/send" \
  --header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
  --header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
  --header "X-ENV: development" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{"send_method":"single","to":"RECIPIENT_NUMBER","message":"Text message"}'
```

### Response example

```json theme={null}
{
  "success": true,
  "request_id": "1af26040-c878-472f-88bd-6c5158905637",
  "data": {
    "send_method": "single",
    "message_count": 1,
    "credits_charged": 2000,
    "provider_response": {
      "status": "success",
      "id": "4726abaf7ab34f31378"
    }
  }
}
```

## Bulk SMS with the same message

### Request example

```bash curl theme={null} theme={null}
curl --request POST "https://avraapi.com/api/v1/sms/send" \
  --header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
  --header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
  --header "X-ENV: development" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{"send_method":"bulk_same","recipients":["FIRST_RECIPIENT_NUMBER","SECOND_RECIPIENT_NUMBER"],"message":"Text message","check_cost":true}'
```

### Response example

```json theme={null}
{
  "success": true,
  "request_id": "2ddf0451-ab4d-47d6-877a-8d167d25d680",
  "data": {
    "send_method": "bulk_same",
    "message_count": 2,
    "credits_charged": 0,
    "provider_response": {
      "status": "success",
      "id": "4726abaf95f01e62378"
    }
  }
}
```

## Bulk SMS cost check

### Request example

```bash curl theme={null} theme={null}
curl --request POST "https://avraapi.com/api/v1/sms/send" \
  --header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
  --header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
  --header "X-ENV: development" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{"send_method":"bulk_same","recipients":["FIRST_RECIPIENT_NUMBER","SECOND_RECIPIENT_NUMBER"],"message":"Text message","check_cost":true}'
```

### Response example

```json theme={null}
{
  "success": true,
  "request_id": "d5ca2bbb-9cab-42ef-932a-62ef61470447",
  "data": {
    "send_method": "bulk_same",
    "message_count": 2,
    "credits_charged": 0,
    "provider_response": {
      "status": "success",
      "campaign_data": {
        "campaign_method": "Same Message To Bulk",
        "campaign_type": "Transactional",
        "sender_id": "APIX SENDER",
        "campaign_total_cost": "1.12 LKR (0.56×2)",
        "campaign_total_numbers": "2 Numbers",
        "sms_msg_data": [
          {
            "msg": "BULK TRANSACTION TEST",
            "unicode": "NO",
            "msg_size": "1 SMS",
            "per_sms_cost": "0.56 LKR",
            "msg_cost": "0.56 LKR (1×0.56)"
          }
        ]
      }
    }
  }
}
```

## Bulk SMS with different messages

### Request example

```bash curl theme={null} theme={null}
curl --request POST "https://avraapi.com/api/v1/sms/send" \
  --header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
  --header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
  --header "X-ENV: development" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{"send_method":"bulk_different","msg_list":[{"to":"FIRST_RECIPIENT_NUMBER","msg":"First text message"},{"to":"SECOND_RECIPIENT_NUMBER","msg":"Second text message"}]}'
```

### Response example

```json theme={null}
{
  "success": true,
  "request_id": "5bf45f1d-e0ee-4293-8a47-f033d1fb0c4a",
  "data": {
    "send_method": "bulk_different",
    "message_count": 2,
    "credits_charged": 0,
    "provider_response": {
      "status": "success",
      "id": "4726abafafabbb0a378"
    }
  }
}
```

## Error codes

| HTTP | `error.code` | When it happens | What to do |
| - | - | - | - |
| `401` | <span style={{ whiteSpace: 'nowrap' }}><code>unauthorized</code></span> | Credentials are missing, invalid, inactive, or do not match the selected environment. | Check your backend secret configuration and `X-ENV`. |
| `402` | <span style={{ whiteSpace: 'nowrap' }}><code>insufficient\_funds</code></span> | A Managed SMS send requires AvraAPI credits that are unavailable. | Top up the AvraAPI wallet or reduce the message units before sending again. |
| `403` | <span style={{ whiteSpace: 'nowrap' }}><code>forbidden</code></span> | A Managed integration attempted `bulk_same` or `bulk_different`, or a trial destination restriction rejected the recipient. | Use `single` for Managed SMS, or configure Manual (BYOK) QuickSend for bulk sending. Check any trial recipient restriction before retrying. |
| `428` | <span style={{ whiteSpace: 'nowrap' }}><code>send\_confirmation\_required</code></span> | A Documentation Playground send did not explicitly acknowledge the real delivery action. | Review every recipient and message, then set `X-Confirm-Send` to `true`. This does not make an uncertain send safe to retry. |
| `422` | <span style={{ whiteSpace: 'nowrap' }}><code>validation\_failed</code></span> | The request body does not satisfy the selected send-method fields. The response includes field details. | Correct the body and submit a new request. |
| `422` | <span style={{ whiteSpace: 'nowrap' }}><code>provider\_selection\_failed</code></span> | No active QuickSend SMS integration can be selected for the project environment. | Configure or enable the QuickSend integration for the selected environment. |
| `422` | <span style={{ whiteSpace: 'nowrap' }}><code>http\_error</code></span> | The active integration is incomplete, the message exceeds three SMS units, or the SMS configuration cannot be used. | Correct the configuration or request; do not repeat an uncertain send. |
| `429` | <span style={{ whiteSpace: 'nowrap' }}><code>rate\_limit\_exceeded</code></span> | The configured request limit was reached. | Respect `Retry-After` when present; do not retry in a tight loop. |
| `500` | <span style={{ whiteSpace: 'nowrap' }}><code>internal\_error</code></span> | The request could not complete unexpectedly. | Investigate with the request ID before deciding whether to submit a new send. |
| `502` | <span style={{ whiteSpace: 'nowrap' }}><code>http\_error</code></span> | QuickSend rejected the request, returned an unexpected response, or its configured credentials failed. | Correct the request or integration. Do not repeat the same send until you know it was not accepted. |
| `503` | <span style={{ whiteSpace: 'nowrap' }}><code>http\_error</code></span> | QuickSend was temporarily unreachable. | Treat delivery as uncertain; check your provider records before any manual retry. |
| `503` | <span style={{ whiteSpace: 'nowrap' }}><code>project\_paused</code></span> | The project is paused. | Reactivate the project before retrying. |

<Info>
  Keep the JSON `request_id` or `X-APIX-Request-ID` response header with your support record. It is the safest way for AvraAPI support to trace a request.
</Info>

See the [REST API guide](/api-reference/rest-api) for shared credential, privacy, and error-handling guidance.

## Playground resources

The generated reference below lists this endpoint's API standard details: request fields, authorizations, and response schema. The complete integration guide, request and response examples, and endpoint-specific error handling are above.


## OpenAPI

````yaml api-reference/provider-api.openapi.yaml POST /sms/send
openapi: 3.0.3
info:
  title: AvraAPI Provider API
  version: 1.0.0
  description: >-
    The reviewed public contract for AvraAPI provider services. Operations are
    added to this document only after their route, validation, response,
    privacy, usage, and public-safety contracts have been verified.
servers:
  - url: https://avraapi.com/api/v1
    description: AvraAPI REST API v1
security:
  - ApiKeyHeader: []
    ApiSecretHeader: []
tags:
  - name: Currency
    description: Currency codes, exchange rates, and conversion.
  - name: SMS
    description: Messaging operations through configured AvraAPI providers.
  - name: Security
    description: IP and email security checks.
  - name: Location
    description: IP geolocation and intelligence.
  - name: Utilities
    description: QR code, barcode, and PDF generation.
paths:
  /sms/send:
    post:
      tags:
        - SMS
      summary: Send an SMS
      description: >-
        Sends one SMS, one message to a bulk list, or different messages to a
        small bulk list through the active QuickSend integration. This is a real
        external action. A successful result confirms provider acceptance, not
        final handset delivery. Do not blindly retry an uncertain send.
      operationId: sendSms
      parameters:
        - $ref: '#/components/parameters/XEnvironmentHeader'
        - $ref: '#/components/parameters/AcceptJsonHeader'
        - $ref: '#/components/parameters/XPrivacyModeHeader'
        - $ref: '#/components/parameters/XConfirmSendHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SmsSendRequest'
            examples:
              single:
                summary: Replace with your recipient number before sending
                value:
                  send_method: single
                  to: RECIPIENT_NUMBER
                  message: Text message
              bulk_same:
                summary: Manual (BYOK) bulk cost check
                value:
                  send_method: bulk_same
                  recipients:
                    - FIRST_RECIPIENT_NUMBER
                    - SECOND_RECIPIENT_NUMBER
                  message: Text message
                  check_cost: true
              bulk_same_cost:
                summary: Check the cost of a bulk-same campaign without sending it
                value:
                  send_method: bulk_same
                  recipients:
                    - FIRST_RECIPIENT_NUMBER
                    - SECOND_RECIPIENT_NUMBER
                  message: Text message
                  check_cost: true
              bulk_different:
                summary: Manual (BYOK) messages for multiple recipients
                value:
                  send_method: bulk_different
                  msg_list:
                    - to: FIRST_RECIPIENT_NUMBER
                      msg: First text message
                    - to: SECOND_RECIPIENT_NUMBER
                      msg: Second text message
      responses:
        '200':
          description: Provider acceptance result or bulk-same cost estimate.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsSendResponse'
              examples:
                single_accepted:
                  summary: Managed single send accepted by QuickSend
                  value:
                    success: true
                    request_id: 1af26040-c878-472f-88bd-6c5158905637
                    data:
                      send_method: single
                      message_count: 1
                      credits_charged: 2000
                      provider_response:
                        status: success
                        id: 4726abaf7ab34f31378
                bulk_same_cost:
                  summary: Manual bulk-same cost estimate
                  value:
                    success: true
                    request_id: d5ca2bbb-9cab-42ef-932a-62ef61470447
                    data:
                      send_method: bulk_same
                      message_count: 2
                      credits_charged: 0
                      provider_response:
                        status: success
                        campaign_data:
                          campaign_method: Same Message To Bulk
                          campaign_total_cost: 1.12 LKR (0.56×2)
                          campaign_total_numbers: 2 Numbers
        '401':
          description: >-
            Missing, invalid, inactive, or environment-mismatched project
            credentials.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsUnauthorizedErrorEnvelope'
              examples:
                unauthorized:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: unauthorized
                      message: <string>
                      details: {}
                    meta: {}
        '402':
          description: >-
            The Managed SMS send requires AvraAPI credits that are not
            available.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsInsufficientFundsErrorEnvelope'
              examples:
                insufficient_funds:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: insufficient_funds
                      message: <string>
                      details: {}
                    meta: {}
        '403':
          description: >-
            The requested SMS action is not allowed for the active integration
            or trial restriction.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsForbiddenErrorEnvelope'
              examples:
                forbidden:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: forbidden
                      message: <string>
                      details: {}
                    meta: {}
        '422':
          description: The send request does not satisfy the selected send-method fields.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsValidationErrorEnvelope'
              examples:
                validation_failed:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: validation_failed
                      message: <string>
                      details: {}
                    meta: {}
        '428':
          description: A Documentation Playground send was not explicitly acknowledged.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsSendConfirmationRequiredErrorEnvelope'
              examples:
                send_confirmation_required:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: send_confirmation_required
                      message: <string>
                      details: {}
                    meta: {}
        '429':
          description: The configured SMS request limit has been reached.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
            Retry-After:
              $ref: '#/components/headers/RetryAfterHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsRateLimitedErrorEnvelope'
              examples:
                rate_limit_exceeded:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: rate_limit_exceeded
                      message: <string>
                      details: {}
                    meta: {}
        '500':
          description: The SMS send could not complete unexpectedly.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsInternalErrorEnvelope'
              examples:
                internal_error:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: internal_error
                      message: <string>
                      details: {}
                    meta: {}
        '502':
          description: >-
            QuickSend rejected the request, returned an unexpected response, or
            its configured credentials failed.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsHttpErrorEnvelope'
              examples:
                http_error:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: http_error
                      message: <string>
                      details: {}
                    meta: {}
        '503':
          description: QuickSend was temporarily unreachable for the SMS send.
          headers:
            X-APIX-Request-ID:
              $ref: '#/components/headers/RequestIdHeader'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsHttpErrorEnvelope'
              examples:
                http_error:
                  value:
                    success: false
                    request_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    error:
                      code: http_error
                      message: <string>
                      details: {}
                    meta: {}
components:
  parameters:
    XEnvironmentHeader:
      name: X-ENV
      in: header
      required: false
      description: >-
        Selects the Development credential environment. The Documentation
        Playground exposes Development values only; normal backend integrations
        may use their documented Production credentials outside this tool.
      schema:
        type: string
        enum:
          - dev
          - development
        default: development
    AcceptJsonHeader:
      name: Accept
      in: header
      required: false
      description: Requests a JSON response where the selected operation supports JSON.
      schema:
        type: string
        example: application/json
    XPrivacyModeHeader:
      name: X-Privacy-Mode
      in: header
      required: false
      description: >-
        Optional privacy override. Turn this on to request that AvraAPI suppress
        request-payload storage in observability logs for this request.
      schema:
        type: boolean
        default: false
        example: true
    XConfirmSendHeader:
      name: X-Confirm-Send
      in: header
      required: false
      description: >-
        Documentation Playground safeguard for real SMS delivery. Turn this on
        only after reviewing every recipient and message. It is required for
        documentation-origin SMS send requests and does not make a timed-out
        send safe to retry.
      schema:
        type: boolean
        default: false
        example: true
  schemas:
    SmsSendRequest:
      title: SMS send request
      oneOf:
        - $ref: '#/components/schemas/SmsSendSingleRequest'
        - $ref: '#/components/schemas/SmsSendBulkSameRequest'
        - $ref: '#/components/schemas/SmsSendBulkDifferentRequest'
      discriminator:
        propertyName: send_method
        mapping:
          single: '#/components/schemas/SmsSendSingleRequest'
          bulk_same: '#/components/schemas/SmsSendBulkSameRequest'
          bulk_different: '#/components/schemas/SmsSendBulkDifferentRequest'
    SmsSendResponse:
      allOf:
        - $ref: '#/components/schemas/ApiSuccessEnvelope'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/SmsSendData'
    SmsUnauthorizedErrorEnvelope:
      type: object
      required:
        - success
        - request_id
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        request_id:
          type: string
          format: uuid
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - unauthorized
              example: unauthorized
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    SmsInsufficientFundsErrorEnvelope:
      type: object
      required:
        - success
        - request_id
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        request_id:
          type: string
          format: uuid
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - insufficient_funds
              example: insufficient_funds
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    SmsForbiddenErrorEnvelope:
      type: object
      required:
        - success
        - request_id
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        request_id:
          type: string
          format: uuid
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - forbidden
              example: forbidden
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    SmsValidationErrorEnvelope:
      type: object
      required:
        - success
        - request_id
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        request_id:
          type: string
          format: uuid
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - validation_failed
              example: validation_failed
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    SmsSendConfirmationRequiredErrorEnvelope:
      type: object
      required:
        - success
        - request_id
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        request_id:
          type: string
          format: uuid
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - send_confirmation_required
              example: send_confirmation_required
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    SmsRateLimitedErrorEnvelope:
      type: object
      required:
        - success
        - request_id
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        request_id:
          type: string
          format: uuid
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - rate_limit_exceeded
              example: rate_limit_exceeded
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    SmsInternalErrorEnvelope:
      type: object
      required:
        - success
        - request_id
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        request_id:
          type: string
          format: uuid
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - internal_error
              example: internal_error
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    SmsHttpErrorEnvelope:
      type: object
      required:
        - success
        - request_id
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        request_id:
          type: string
          format: uuid
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - http_error
              example: http_error
            message:
              type: string
            details:
              type: object
              additionalProperties: true
        meta:
          type: object
          additionalProperties: true
    SmsSendSingleRequest:
      title: Single SMS
      type: object
      required:
        - send_method
        - to
        - message
      properties:
        send_method:
          type: string
          enum:
            - single
          default: single
          x-default: single
          description: Fixed to `single` for this form.
        to:
          type: string
          maxLength: 20
          description: >-
            Local Sri Lankan `07XXXXXXXX` or E.164 `+947XXXXXXXX` number.
            Replace this with the recipient number before sending.
          example: RECIPIENT_NUMBER
          x-default: RECIPIENT_NUMBER
        message:
          type: string
          maxLength: 4096
          description: >-
            Message text. The released service limits each recipient message to
            three SMS units.
          example: Text message
          x-default: Text message
    SmsSendBulkSameRequest:
      title: Bulk SMS
      type: object
      required:
        - send_method
        - recipients
        - message
      properties:
        send_method:
          type: string
          enum:
            - bulk_same
          default: bulk_same
          x-default: bulk_same
          description: Fixed to `bulk_same` for this form.
        recipients:
          type: array
          minItems: 1
          maxItems: 10000
          x-default:
            - FIRST_RECIPIENT_NUMBER
            - SECOND_RECIPIENT_NUMBER
          items:
            type: string
            maxLength: 20
            description: >-
              Local Sri Lankan `07XXXXXXXX` or E.164 `+947XXXXXXXX` number. Add
              each recipient number separately.
            example: RECIPIENT_NUMBER
            x-default: RECIPIENT_NUMBER
        message:
          type: string
          maxLength: 4096
          description: >-
            Message text. The released service limits each recipient message to
            three SMS units.
          example: Text message
          x-default: Text message
        check_cost:
          type: boolean
          default: true
          x-default: true
          description: >-
            Start with a cost estimate. Turn this off only when you are ready to
            send the campaign to every listed recipient.
    SmsSendBulkDifferentRequest:
      title: Bulk Different
      type: object
      required:
        - send_method
        - msg_list
      properties:
        send_method:
          type: string
          enum:
            - bulk_different
          default: bulk_different
          x-default: bulk_different
          description: Fixed to `bulk_different` for this form.
        msg_list:
          type: array
          minItems: 1
          maxItems: 20
          x-default:
            - to: FIRST_RECIPIENT_NUMBER
              msg: First text message
            - to: SECOND_RECIPIENT_NUMBER
              msg: Second text message
          items:
            $ref: '#/components/schemas/SmsRecipientMessage'
    ApiSuccessEnvelope:
      type: object
      required:
        - success
        - request_id
        - data
      properties:
        success:
          type: boolean
          enum:
            - true
        request_id:
          type: string
          format: uuid
          description: Include this value when contacting AvraAPI support.
        data:
          description: Operation-specific result data.
          nullable: true
    SmsSendData:
      type: object
      required:
        - send_method
        - message_count
        - credits_charged
        - provider_response
      properties:
        send_method:
          type: string
          enum:
            - single
            - bulk_same
            - bulk_different
        message_count:
          type: integer
          minimum: 1
          description: Total calculated SMS units across the request.
        credits_charged:
          type: integer
          minimum: 0
          description: AvraAPI credits charged. Manual (BYOK) sends return zero.
        provider_response:
          type: object
          additionalProperties: true
          description: >-
            Raw QuickSend acceptance or cost-estimate response, which varies by
            operation.
    SmsRecipientMessage:
      title: Recipient message
      type: object
      additionalProperties: false
      required:
        - to
        - msg
      properties:
        to:
          type: string
          maxLength: 20
          description: >-
            Local Sri Lankan `07XXXXXXXX` or E.164 `+947XXXXXXXX` number. Enter
            a recipient number that can receive the message.
          example: RECIPIENT_NUMBER
          x-default: RECIPIENT_NUMBER
        msg:
          type: string
          maxLength: 4096
          description: >-
            Message text. The released service limits each recipient message to
            three SMS units.
          example: Text message
          x-default: Text message
  headers:
    RequestIdHeader:
      description: AvraAPI request identifier for support and troubleshooting.
      schema:
        type: string
        format: uuid
    RetryAfterHeader:
      description: Seconds to wait before retrying a rate-limited request.
      schema:
        type: integer
        minimum: 0
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your Development project's Client ID. Enter your own value in the
        Documentation Playground.
    ApiSecretHeader:
      type: apiKey
      in: header
      name: X-API-SECRET
      description: >-
        Your Development project's Client Secret. Mintlify does not proxy these
        requests; the browser sends them directly to AvraAPI. Never enter a
        Production secret in the Documentation Playground.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.