API reference · v1
A small, predictable REST API. Everything the dashboard does — validation, pricing, balance checks, scheduling and delivery tracking — works the same over the API.
Every endpoint path on this page is relative to the base URL. For example, sending a message is a POST to https://app.dragonflysms.online/v1/messages.
https://app.dragonflysms.onlineFor compatibility the same endpoints are also served from the website at https://dragonflysms.online/api/v1/…. New integrations should use the base URL above.
Create keys in Dashboard → Developers. A key is shown exactly once; store it as a secret and revoke it any time. Send it as a bearer token on every request:
Authorization: Bearer dsk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxBase URL
https://app.dragonflysms.online
Format
JSON in, JSON out
Rate limit
60 sends / minute / key
Every response uses the same envelope. Check success first, then read data or error.
{
"success": true,
"data": { ... }
}{
"success": false,
"error": {
"code": "INSUFFICIENT_CASH_BALANCE",
"message": "This campaign costs $0.7560, but your balance is $0.2500...",
"details": { "requiredUsd": 0.756, "availableUsd": 0.25 }
}
}| Status | Code | Meaning |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing, invalid or revoked API key. |
| 402 | INSUFFICIENT_CASH_BALANCE | Your messaging balance doesn't cover this request. Top up from Billing. |
| 403 | ACTIVE_PLAN_REQUIRED | Your account has no active plan. |
| 404 | NOT_FOUND | The resource doesn't exist or isn't yours. |
| 409 | CANNOT_CANCEL | The campaign is sending or already finished. |
| 422 | VALIDATION_ERROR | Invalid body, recipients, sender ID or schedule. See error.details. |
| 429 | RATE_LIMITED | More than 60 send requests per minute for this key. |
/v1/messagesSends one message to one or many recipients (up to 5,000). The USD cost (carrier rate + 5% per segment) is reserved from your messaging balance up front; anything the network rejects is refunded to your balance automatically.
| Field | Type | Description |
|---|---|---|
| fromrequired | string | Sender ID (max 11 chars) or one of your provisioned phone numbers. |
| torequired | string | string[] | Recipient(s) in international format, e.g. +2348012345678. |
| messagerequired | string | Message text, up to 1,600 characters. Segments are calculated automatically. |
| name | string | Campaign name shown in your dashboard. |
| scheduledAt | ISO 8601 | Send later (1 minute to 90 days ahead). Omit to send now. |
| skipInvalid | boolean | Send to valid recipients and report the rest, instead of rejecting the whole request. Default false. |
| acknowledgeWarnings | boolean | Send even if deliverability checks flag the content. Default false. |
{
"from": "Drogon",
"to": ["+2348012345678", "+14155552671"],
"message": "Your verification code is 482913",
"skipInvalid": true
}{
"success": true,
"data": {
"id": "cm3x9k2f40001",
"status": "completed",
"scheduledAt": null,
"recipients": 2,
"segmentsPerMessage": 1,
"amountChargedUsd": 0.014175,
"amountRefundedUsd": 0,
"skipped": [],
"messages": [
{ "id": "cm3x9k2f60002", "to": "+2348012345678", "status": "sent", "segments": 1 }
]
}
}/v1/messages/:idReturns the current delivery status of a single message. Statuses progress from queued → pending → sent → delivered (or failed / rejected / expired).
{
"success": true,
"data": {
"id": "cm3x9k2f60002",
"campaignId": "cm3x9k2f40001",
"to": "+2348012345678",
"from": "Drogon",
"status": "delivered",
"segments": 1,
"amountChargedUsd": 0.0063,
"createdAt": "2026-11-05T10:00:00.000Z",
"deliveredAt": "2026-11-05T10:00:04.000Z"
}
}/v1/campaigns/:idReturns the status of a send request with a per-status breakdown of its messages.
{
"success": true,
"data": {
"id": "cm3x9k2f40001",
"name": "Order updates",
"status": "completed",
"recipients": 2,
"scheduledAt": null,
"messages": { "delivered": 1, "sent": 1 }
}
}/v1/campaigns/:idCancels a scheduled or queued campaign and refunds every message that has not been sent yet. Returns 409 if the campaign is sending right now or already finished.
{
"success": true,
"data": { "cancelledMessages": 2, "refundedUsd": 0.014175 }
}/v1/balanceReturns your USD messaging balance and your active plan.
{
"success": true,
"data": {
"messagingBalanceUsd": 82.4471,
"plan": { "name": "Professional", "expiresAt": "2027-08-01T00:00:00.000Z" }
}
}Provider and payment credentials never reach the browser — all provider communication is proxied through DrogonSMS's backend. Delivery reports are authenticated and processed idempotently, and API keys are stored only as hashes.