Overview

The API lives at https://api.zapsy.com/1/. Requests are HTTPS POSTs with form-encoded or JSON bodies; responses are JSON. Every response carries a request id you can quote to support.

This site is a mock-up. The endpoints below are live on this host and answer with realistic JSON from a demo account, so you can try the shapes, but nothing is delivered anywhere.

Tokens and keys

Two 30-character strings identify every message:

ParameterWhat it isWhere to find it
tokenThe application token. One per application you create.Dashboard, the application's page
userYour user key, or a group key. Where the message goes.Dashboard, top of the page

Treat both like passwords. A leaked token lets anyone send you messages; rotate it from the application page.

Rate limits

Each application may send 10,000 messages per month. Every response includes the headers X-Limit-App-Limit, X-Limit-App-Remaining and X-Limit-App-Reset (Unix time). Beyond the limit you get HTTP 429 until the reset.

Send a message

POST/1/messages.json
ParameterDescription
tokenrequiredApplication token.
userrequiredUser or group key.
messagerequiredThe message body, up to 1,024 characters.
titleUp to 250 characters. Defaults to the application name.
deviceA device name, or several separated by commas. Omit to reach all devices.
priority-2 to 2, see below. Default 0.
retryEmergency only. Seconds between repeats, minimum 30.
expireEmergency only. Seconds until repeats stop, maximum 10,800.
callbackEmergency only. URL we POST to when the message is acknowledged.
urlSupplementary link shown with the message, up to 512 characters.
url_titleLabel for the link, up to 100 characters.
soundOne of the sound names below.
timestampUnix time to show instead of the time of receipt.
htmlSet to 1 to enable bold, italic, underline and links in the message.
attachmentImage file, multipart upload, up to 5 MB.
# request
curl -s https://api.zapsy.com/1/messages.json \
  -d token=aH3nX8qL2wP5vK9mC4rT7yB1zF6dJ0 \
  -d user=uZ4k9pQ2mN7xW1vB8cR3tY6hL0sD5f \
  -d title="Disk almost full" \
  -d message="/dev/sda1 at 94% on harvest-e" \
  -d priority=1 -d sound=siren

# response, HTTP 200
{ "status": 1, "request": "c4a2b7e0-5f3d-4c1a-9e8b-2d6f1a0b3c4d" }

Priorities

ValueNameBehaviour
-2LowestNo notification. Badge count only.
-1LowNotification without sound or vibration.
0NormalRegular notification. Silent during the user's quiet hours.
1HighBypasses quiet hours. Highlighted in the app.
2EmergencyRepeats every retry seconds until acknowledged or expire is reached. Returns a receipt.

Receipts

GET/1/receipts/{receipt}.json?token=...

Emergency messages return a receipt id. Poll it to learn the acknowledgement state, or give a callback URL when sending and we POST the same fields there once.

{ "status": 1,
  "acknowledged": 1, "acknowledged_at": 1760003620,
  "acknowledged_by": "uZ4k9pQ2mN7xW1vB8cR3tY6hL0sD5f", "acknowledged_by_device": "iphone",
  "last_delivered_at": 1760003590, "expired": 0, "expires_at": 1760007190,
  "called_back": 0, "called_back_at": 0,
  "request": "..." }

Validate a user or group

POST/1/users/validate.json

Pass token and user (optionally device) to check a key before storing it in your configuration. The answer lists the registered devices and licensed platforms.

Application limits

GET/1/apps/limits.json?token=...

Returns limit, remaining and reset for the application, the same numbers as the response headers.

Sounds

zap bolt chime bell ping drum siren cosmic none

Custom sounds uploaded to an application are addressed by the name you give them.

Errors

Invalid requests answer HTTP 400 with status: 0, a list of human-readable errors, and each offending parameter set to "invalid".

{ "status": 0,
  "errors": ["message cannot be blank"],
  "message": "invalid",
  "request": "..." }
HTTPMeaning
200Accepted for delivery.
400Something in the request is invalid. See errors.
429Monthly limit reached for this application.
5xxOur fault. Retry with backoff; the request id helps us trace it.

Try it against this mock-up

The demo account's keys are on the dashboard. This sends through the mock endpoint on this host and the message appears in the dashboard's recent list:

curl -s /1/messages.json \
  -d token=aH3nX8qL2wP5vK9mC4rT7yB1zF6dJ0 \
  -d user=uZ4k9pQ2mN7xW1vB8cR3tY6hL0sD5f \
  -d message="Hello from the docs" -d priority=2 -d retry=30 -d expire=600