← Back to MESSA
MESSA API documentation
JSON in, JSON out. Authenticated requests use Authorization: Bearer <token>.
Device requests use X-Device-Key: <key>. Base URL: https://messa.sgm.ng/api.
Authentication
| Method | Path | Body |
| POST | /auth/register | name, email, password, token |
| POST | /auth/login | email, password → token |
| POST | /auth/logout | — |
| GET | /me | — |
Data tables
| Method | Path | Description |
| GET | /tables | List tables |
| POST | /tables | Create table |
| GET | /tables/{id} | Table + rows |
| PUT | /tables/{id} | Rename / change columns |
| DELETE | /tables/{id} | Delete table |
| POST | /tables/{id}/rows | Add row |
| PUT | /tables/{id}/rows/{rowId} | Update row |
| DELETE | /tables/{id}/rows/{rowId} | Delete row |
| POST | /tables/{id}/replace | Replace all rows |
| POST | /tables/{id}/import | Import from sheet.spacet.me |
Devices & remote queue
| Method | Path | Auth | Description |
| GET | /devices | Bearer | List device keys |
| POST | /devices | Bearer | Create a device key (name) → key |
| DELETE | /devices/{id} | Bearer | Revoke a device key |
| POST | /queues | Bearer | Create a messaging batch |
| GET | /queues | Bearer | Recent batches + counts |
| GET | /device/queue | Device | Claim pending messages for the device |
| POST | /device/queue/report | Device | Report send results |
Queue a message batch
curl -X POST https://messa.sgm.ng/api/queues \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"batch_name": "Fee reminders",
"device_id": 1,
"messages": [
{ "phone": "08012345678", "message": "Dear parent, your balance is N25,000" },
{ "phone": "08023456789", "message": "Dear parent, your balance is N12,500" }
]
}'
Device claim + report
GET https://messa.sgm.ng/api/device/queue?limit=25 \
-H "X-Device-Key: $DEVICE_KEY"
POST https://messa.sgm.ng/api/device/queue/report \
-H "X-Device-Key: $DEVICE_KEY" \
-H "Content-Type: application/json" \
-d '{"results":[{"id":10,"status":"sent"},{"id":11,"status":"failed","error":"no service"}]}'
Public data export
GET https://messa.sgm.ng/sheet/{public_token}.json
Returns an array of row objects — drop-in compatible with sheet.spacet.me.