Send SMS API

Environment: Live

Send bulk or single SMS messages. Requires an approved Sender ID and VAS Key.

# Send SMS API

The Send SMS (POST) API allows you to send bulk or single SMS messages to recipients across any network. The optional network parameter is available in Live mode. **TELECEL is the default network. If you select MTN, messages are sent over MTN only when network approval is in place; otherwise, they fall back to TELECEL.** This API requires X-API-VASKEY in the header for authentication.

## Endpoint
- **Method**: POST
- **URL**: https://api.moolre.com/open/sms/send

## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| X-API-VASKEY | string | Yes | Your SMS API VAS key. |

## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| type | integer | Yes | ID of the sms sending function. Must be 1. |
| senderid | string | Yes | Your registered and approved Sender ID (max 11 chars). |
| network | string | No | Network to use for SMS delivery. |
| messages | array | Yes | An array of message objects containing recipient, message, and optional ref. |

## Response (200 Success)
SMS message(s) sent successfully.

```json
{
  "status": 1,
  "code": "SMS01",
  "message": "Success",
  "data": null,
  "go": null
}
```

## Response (400 Unapproved Sender ID)
The Sender ID provided is not yet approved or registered.

```json
{
  "status": 0,
  "code": "ASMS07",
  "message": "Sender ID is not approved, Please login on app.moolre.com and setup your Sender ID.",
  "data": "senderid",
  "go": null
}
```

## Response (401 Authentication Error)
The VAS Key provided is invalid or unauthorized.

```json
{
  "status": 0,
  "code": "AIN01",
  "message": "Authentication Error",
  "data": null,
  "go": null
}
```

Back to the Moolre AI documentation index