API reference · v1

Send SMS from your own product

A small, predictable REST API. Everything the dashboard does — validation, pricing, balance checks, scheduling and delivery tracking — works the same over the API.

Base URL

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.

Base URL
https://app.dragonflysms.online

For compatibility the same endpoints are also served from the website at https://dragonflysms.online/api/v1/…. New integrations should use the base URL above.

Authentication

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:

Header
Authorization: Bearer dsk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Base URL

https://app.dragonflysms.online

Format

JSON in, JSON out

Rate limit

60 sends / minute / key

Responses & errors

Every response uses the same envelope. Check success first, then read data or error.

Success
{
  "success": true,
  "data": { ... }
}
Error
{
  "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 }
  }
}
StatusCodeMeaning
401UNAUTHENTICATEDMissing, invalid or revoked API key.
402INSUFFICIENT_CASH_BALANCEYour messaging balance doesn't cover this request. Top up from Billing.
403ACTIVE_PLAN_REQUIREDYour account has no active plan.
404NOT_FOUNDThe resource doesn't exist or isn't yours.
409CANNOT_CANCELThe campaign is sending or already finished.
422VALIDATION_ERRORInvalid body, recipients, sender ID or schedule. See error.details.
429RATE_LIMITEDMore than 60 send requests per minute for this key.
POST/v1/messages

Send or schedule a message

Sends 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.

FieldTypeDescription
fromrequiredstringSender ID (max 11 chars) or one of your provisioned phone numbers.
torequiredstring | string[]Recipient(s) in international format, e.g. +2348012345678.
messagerequiredstringMessage text, up to 1,600 characters. Segments are calculated automatically.
namestringCampaign name shown in your dashboard.
scheduledAtISO 8601Send later (1 minute to 90 days ahead). Omit to send now.
skipInvalidbooleanSend to valid recipients and report the rest, instead of rejecting the whole request. Default false.
acknowledgeWarningsbooleanSend even if deliverability checks flag the content. Default false.
Request body
{
  "from": "Drogon",
  "to": ["+2348012345678", "+14155552671"],
  "message": "Your verification code is 482913",
  "skipInvalid": true
}
Response
{
  "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 }
    ]
  }
}
GET/v1/messages/:id

Get a message

Returns the current delivery status of a single message. Statuses progress from queued → pending → sent → delivered (or failed / rejected / expired).

Response
{
  "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"
  }
}
GET/v1/campaigns/:id

Get a campaign

Returns the status of a send request with a per-status breakdown of its messages.

Response
{
  "success": true,
  "data": {
    "id": "cm3x9k2f40001",
    "name": "Order updates",
    "status": "completed",
    "recipients": 2,
    "scheduledAt": null,
    "messages": { "delivered": 1, "sent": 1 }
  }
}
DELETE/v1/campaigns/:id

Cancel a campaign

Cancels 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.

Response
{
  "success": true,
  "data": { "cancelledMessages": 2, "refundedUsd": 0.014175 }
}
GET/v1/balance

Get your balance

Returns your USD messaging balance and your active plan.

Response
{
  "success": true,
  "data": {
    "messagingBalanceUsd": 82.4471,
    "plan": { "name": "Professional", "expiresAt": "2027-08-01T00:00:00.000Z" }
  }
}

Security

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.