Auto
EN
GET/api/v2/account/wallet/spend-report

Message spend by API key

Requires api_keys:read and wallet_read. Returns net recorded spend after discounts for successful wallet-paid messages, excluding bundles and grants. Defaults to the calling key and preserves sender restrictions. Balances, subscriptions and top-ups are account-wide. Key names are safe; secret credentials are never returned. Legacy unlinked messages remain unattributed.

When to use it. Reconcile spend with wallet reports for the same key and period. For one day, use equal start/end dates.

Code example

Correct: Store spend for a month

curl --request GET 'https://raselsms.com/api/v2/account/wallet/spend-report?month=2026-11' \--header 'X-API-Key: YOUR_API_KEY'

Response example

200 — Store spend for a month

{  "success": true,  "data": {    "period": {      "fromDate": "2026-11-01",      "toDate": "2026-11-30",      "timezone": "Asia/Damascus"    },    "filters": {      "apiKeyId": "6800abc123def4567890fedc",      "channel": null,      "messageType": null    },    "apiKey": {      "id": "6800abc123def4567890fedc",      "name": "Online store",      "revoked": false,      "deleted": false    },    "currency": "USD",    "coverage": "successful_wallet_paid_messages",    "senderScope": "all",    "totals": {      "spendUsd": 0.8,      "messageCount": 2,      "segmentCount": 4,      "averageMessageCostUsd": 0.4    },    "monthly": [      {        "key": "2026-11",        "spendUsd": 0.8,        "messageCount": 2,        "segmentCount": 4,        "averageMessageCostUsd": 0.4      }    ],    "byChannel": [      {        "key": "sms_syria",        "spendUsd": 0.8,        "messageCount": 2,        "segmentCount": 4,        "averageMessageCostUsd": 0.4      }    ],    "byMessageType": [      {        "key": "utility",        "spendUsd": 0.8,        "messageCount": 2,        "segmentCount": 4,        "averageMessageCostUsd": 0.4      }    ]  }}

HTTP request

GET /api/v2/account/wallet/spend-report

Request Headers

HeaderTypeDescription
X-API-KeystringYour Rasel API key. Send it on every documented request except inbound webhooks. *

Query parameters

FieldTypeDescription
apiKeyIdstringAn owned key ID, all, or unattributed. Defaults to the current key. Never send the secret value here.
monthstringYYYY-MM; use month OR both start/end dates, never both.
fromDatestringInclusive start date filter (YYYY-MM-DD).
toDatestringInclusive end date filter (YYYY-MM-DD).
channelall | whatsapp_user_session | whatsapp_web | whatsapp_official | telegram_verifyway | telegram_bot | sms_twilio | sms_clicksend | sms_syria | sms_taqnyat | email_system | email_userDelivery channel. For unified send prefer auto, local_sms, int_sms, official_whatsapp, WhatsApp Web sessions, telegram_bot, or email_user. For verification omit the field for automatic selection; do not send bare sms, whatsapp, or auto.
messageTypeall | otp | utility | marketing | free_textMessage classification: otp, utility, marketing, or free_text.

Response Fields

FieldTypeDescriptionExample
successbooleanTrue when the operation succeeded, or when at least one batch recipient succeeded.
dataobjectPrimary payload for list and snapshot endpoints.
data.periodobjectInclusive period in the report timezone.
data.period.fromDatestringInclusive start date filter (YYYY-MM-DD).
data.period.toDatestringInclusive end date filter (YYYY-MM-DD).
data.period.timezonestringTimezone for day boundaries and monthly grouping.
data.filtersobjectFilters applied to message spend.
data.filters.apiKeyIdstringDatabase key reference, never the secret credential. null means all sources; unattributed means unlinked history.
data.filters.channelstringDelivery channel. For unified send prefer auto, local_sms, int_sms, official_whatsapp, WhatsApp Web sessions, telegram_bot, or email_user. For verification omit the field for automatic selection; do not send bare sms, whatsapp, or auto.
data.filters.messageTypestringMessage classification: otp, utility, marketing, or free_text.
data.apiKeyobjectSelected key name and status, or null for all sources or a key not found in the account.
data.apiKey.idstringResource identifier.
data.apiKey.namestringDisplay name or lowercase template identifier, depending on the endpoint.
data.apiKey.revokedbooleanWhether the key is revoked; historical spend remains available.
data.apiKey.deletedbooleanWhether the key was deleted while historical usage remains.
data.currencyenumCurrency of the balance and the cost, matching the wallet.
data.coveragestringCoverage: successful wallet-paid messages, excluding bundles and free grants.
data.senderScopeenumall or selected according to the calling key sender restrictions.
data.totalsobjectSpend, message and unit totals for the selected period and filters.
data.totals.spendUsdnumberNet spend in USD after discounts recorded at send time.
data.totals.messageCountintegerRecorded message count; in spend reports this differs from SMS unit count.
data.totals.segmentCountintegerBilled unit count; one SMS message may contain several units.
data.totals.averageMessageCostUsdnumberAverage USD cost per message; zero when no messages exist.
data.monthlyjsonSpend grouped by month; keys use YYYY-MM.
data.byChanneljsonSpend grouped by channel.
data.byMessageTypejsonSpend grouped by message type.

Status Codes

StatusDescription
200Success.
400Invalid request, validation error, or the resource cannot be used in this state.
401Missing or invalid API key.
403Phone not verified, missing permission, or the account cannot perform this action.
429Rate limit exceeded, or the maximum number of verification attempts was reached.
500Report unavailable.
413Request body exceeds the size limit.

Try it

Parameters

An owned key ID, all, or unattributed. Defaults to the current key. Never send the secret value here.

YYYY-MM; use month OR both start/end dates, never both.

Inclusive start date filter (YYYY-MM-DD).

Inclusive end date filter (YYYY-MM-DD).

Delivery channel. For unified send prefer auto, local_sms, int_sms, official_whatsapp, WhatsApp Web sessions, telegram_bot, or email_user. For verification omit the field for automatic selection; do not send bare sms, whatsapp, or auto.

Message classification: otp, utility, marketing, or free_text.

Request

GET /api/v2/account/wallet/spend-report?month=2026-11&fromDate=2026-11-01&toDate=2026-11-01&channel=sms_syria&messageType=all

Response

Example response

{  "success": true,  "data": {    "period": {      "fromDate": "2026-11-01",      "toDate": "2026-11-30",      "timezone": "Asia/Damascus"    },    "filters": {      "apiKeyId": "6800abc123def4567890fedc",      "channel": null,      "messageType": null    },    "apiKey": {      "id": "6800abc123def4567890fedc",      "name": "Online store",      "revoked": false,      "deleted": false    },    "currency": "USD",    "coverage": "successful_wallet_paid_messages",    "senderScope": "all",    "totals": {      "spendUsd": 0.8,      "messageCount": 2,      "segmentCount": 4,      "averageMessageCostUsd": 0.4    },    "monthly": [      {        "key": "2026-11",        "spendUsd": 0.8,        "messageCount": 2,        "segmentCount": 4,        "averageMessageCostUsd": 0.4      }    ],    "byChannel": [      {        "key": "sms_syria",        "spendUsd": 0.8,        "messageCount": 2,        "segmentCount": 4,        "averageMessageCostUsd": 0.4      }    ],    "byMessageType": [      {        "key": "utility",        "spendUsd": 0.8,        "messageCount": 2,        "segmentCount": 4,        "averageMessageCostUsd": 0.4      }    ]  }}