Get Usage
Retrieve how much of your plan your organization has used in the current period.
The period is the UTC calendar month
Usage is counted per UTC calendar month, from period_start up to but not including period_end. This is not your billing cycle: counters reset on the first of each month regardless of when you subscribed.
Endpoint
GET /usage
Returns: 200 OK
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Response
{
"object": "usage",
"period_start": "2026-03-01T00:00:00.000Z",
"period_end": "2026-04-01T00:00:00.000Z",
"emails": {
"marketing": { "used": 18240, "limit": 50000, "remaining": 31760 },
"transactional": { "used": 912, "limit": 10000, "remaining": 9088 }
},
"sms": { "used": 4310, "limit": null, "remaining": null },
"whatsapp": { "used": 126, "limit": 1000, "remaining": 874 },
"push": { "used": 73400, "limit": null, "remaining": null },
"in_app": { "used": 0, "limit": 100000, "remaining": 100000 },
"automation_runs": { "used": 388, "limit": 1000, "remaining": 612 },
"contacts": { "used": 41250, "limit": 50000, "remaining": 8750 }
}
Response fields
| Field | Type | Description |
|---|---|---|
period_start | string | Start of the current period (ISO 8601) |
period_end | string | Exclusive end of the period: the instant the next one starts |
emails.marketing | meter | Marketing emails: campaigns and automations |
emails.transactional | meter | Transactional emails, sent through POST /email/send or SMTP |
sms | meter | SMS credits. One credit is one message part, so a long or non-Latin message uses several. |
whatsapp | meter | WhatsApp messages |
push | meter | Push notifications |
in_app | meter | In-app messages |
automation_runs | meter | Automation runs |
contacts | meter | Contacts in the organization right now, against the plan limit. Not a per-period counter. |
Every meter has the same three fields:
| Field | Type | Description |
|---|---|---|
used | number | The amount used so far |
limit | number | null | The plan's limit. null means the plan sets no limit. |
remaining | number | null | What is left of limit, never below 0. null when there is no limit. |
Balances and prices are not part of this response.
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl "https://api.arsel.sa/v1/usage" \
-H "Authorization: Bearer $ARSEL_API_KEY"
const response = await fetch("https://api.arsel.sa/v1/usage", {
headers: {
Authorization: `Bearer ${process.env.ARSEL_API_KEY}`,
},
});
const data = await response.json();
if (!response.ok) {
throw new Error(`${data.name}: ${data.message}`);
}
console.log(data);
import os
import requests
response = requests.get(
"https://api.arsel.sa/v1/usage",
headers={"Authorization": f"Bearer {os.environ['ARSEL_API_KEY']}"},
)
response.raise_for_status()
print(response.json())
using System.Net.Http.Headers;
var client = new HttpClient(); // share one instance across requests
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
"Bearer", Environment.GetEnvironmentVariable("ARSEL_API_KEY"));
var response = await client.GetAsync("https://api.arsel.sa/v1/usage");
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode)
throw new HttpRequestException($"{(int)response.StatusCode}: {body}");
Console.WriteLine(body);
<?php
$ch = curl_init("https://api.arsel.sa/v1/usage");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("ARSEL_API_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_HTTP_CODE) >= 400) {
throw new Exception("{$data['name']}: {$data['message']}");
}
print_r($data);
Error Responses
- 401 Unauthorized
{
"status_code": 401,
"name": "unauthorized",
"message": "Invalid API Key"
}