Status: DRAFT
Base URL: /api/v1
Formats: JSON · UTF-8
| Client | Header |
|---|---|
| User (dashboard) | Authorization: Bearer <access_jwt> |
| Project API | X-API-Key: <key> |
| Agent | Authorization: Device <device_token> |
TLS required in production.
- UUIDs for IDs
- Timestamps ISO-8601 UTC
- Pagination:
?page=1&page_size=50→{ count, next, previous, results } - Errors:
{ "error": { "code", "message", "details?" } } - Idempotency: header
Idempotency-Keyon send
Body: { "email", "password", "tenant_slug?" }
→ { access, refresh, user, tenant, role }
Body: { "refresh" } → new access
Invalidate refresh (if denylist enabled)
Current tenant profile
List memberships (Admin)
{ email, role }
Change role / deactivate
{ name, slug, settings? }
Soft-delete preferred
Replace attachments { device_ids, priorities? }
{ name, ip_whitelist?, scopes? } → returns plaintext key once
Admin/Operator creates code { name? } → { code, expires_at }
Query: status, q
Rename, disable, labels
Timeline
{ "command": "restart_agent"|"sync"|"clear_queue"|"refresh_sim"|"enable_logs", "params"? }
Inspector aggregates + optional list
{ pairing_code, device_info } → { device_id, device_token, config }
Health payload (or via WS)
{ status, error_code?, latency_ms?, sim_slot? }
{ from, body, received_at, sim_slot?, meta? }
REST fallback if WS down
API Key or JWT
{
"to": "+98912...",
"text": "Hello",
"project": "otp-service",
"device": null,
"mode": "otp",
"sim_slot": null,
"scheduled_at": null,
"client_ref": "order-123",
"meta": {}
}Either project (slug/id) via key context, or explicit device name/id.
Response 202:
{
"id": "uuid",
"status": "queued",
"created_at": "..."
}{ messages: [ ... ] } or multipart CSV — Phase 2
Filters: project, device, status, to, from_date, to_date, q
Render preview: POST /templates/{id}/render { vars }
Event types: message.queued, message.sent, message.delivered, message.failed, inbound.received, device.offline, device.online
Signed with X-DeviceFlow-Signature: sha256=...
CRUD contacts, groups, blacklist/whitelist
{ type: "messages", filters, format: "csv"|"xlsx"|"json" } → job id
Download when ready
Admin/Auditor
| Code | Meaning |
|---|---|
| 200 | OK |
| 201 | Created |
| 202 | Accepted (async) |
| 400 | Validation |
| 401 | Auth |
| 403 | Permission |
| 404 | Not found |
| 409 | Conflict (idempotency) |
| 422 | Business rule |
| 429 | Rate limited |
| 500 | Server error |