← 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

MethodPathBody
POST/auth/registername, email, password, token
POST/auth/loginemail, password → token
POST/auth/logout—
GET/me—

Data tables

MethodPathDescription
GET/tablesList tables
POST/tablesCreate table
GET/tables/{id}Table + rows
PUT/tables/{id}Rename / change columns
DELETE/tables/{id}Delete table
POST/tables/{id}/rowsAdd row
PUT/tables/{id}/rows/{rowId}Update row
DELETE/tables/{id}/rows/{rowId}Delete row
POST/tables/{id}/replaceReplace all rows
POST/tables/{id}/importImport from sheet.spacet.me

Devices & remote queue

MethodPathAuthDescription
GET/devicesBearerList device keys
POST/devicesBearerCreate a device key (name) → key
DELETE/devices/{id}BearerRevoke a device key
POST/queuesBearerCreate a messaging batch
GET/queuesBearerRecent batches + counts
GET/device/queueDeviceClaim pending messages for the device
POST/device/queue/reportDeviceReport 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.