Device notices
A notice, to the right phones, with proof
A tenant sends a notice to specific enrolled phones. Each phone sees only its own; every state change commits with its receipt.
The device
A phone enrolled by its P-256 public key, exactly as Pillion enrols it, so one phone key signs for both.
Its id
base32 of the SHA-256 of its public key (SPKI DER), first 26 characters.
Its requests
Four headers, X-Pillion-Device, -Timestamp, -Nonce and -Signature, sign the method, path, time, nonce and a hash of the body. Five-minute window; each nonce once per device, stored, so a replay fails after a restart too.
pillion-request/1
METHOD
/path?query
timestamp
nonce
hex(sha256(body))
A notice's life, per device
- queuedsent, not yet fetched
- deliveredfetched, or confirmed received
- acknowledgedan explicit signed ack, with the action chosen
Or expired or revoked. Delivery is by WebSocket, SSE or pull. Acknowledging twice changes nothing.
For a business
| Role | May |
|---|---|
| Operator | everything, in every tenant (the admin token) |
| Tenant admin | enrol, replace and revoke its staff phones; mint sender tokens; export the audit |
| Authorised sender | send, follow and revoke notices |
| Staff device | fetch its notices, confirm, acknowledge; every request signed |
Actions and expiry
Up to four actions such as on-my-way, and ttlSeconds or expiresAt. The receipt holds the action's code, never its label.
Follow-up
followUp: {afterMinutes, times} reminds phones that have not acknowledged, every N minutes, at most M times, each sealed as reminded.
Revocation and replacement
Revoking a phone ends its connections and its reminders. A step it takes commits only while it is unrevoked, in the same transaction as its receipt. A replaced phone's new key sees none of the old notices.
Audit
GET /tenants/:t/audit?format=json|csv: every notice, its per-device states and times and its receipt chain, sealed as a whole, and verifiable offline.
Send one
import { NoticesClient } from "@tin-phone/sdk";
const notices = new NoticesClient({ baseUrl, tenantId, token, trustedKeys });
const sent = await notices.send({
to: [deviceId],
content: { type: "text", body: "Shift starts at 7" },
actions: [{ id: "on-my-way", label: "On my way" }],
ttlSeconds: 3600,
followUp: { afterMinutes: 10, times: 3 },
});
const { check } = await notices.verifiedReceipts(sent.id);
The public contract is OpenAPI 3.1 with conformance vectors: notices in the API reference. Pillion Fleet jobs (driver, meeting point, status in order, location for the job only) travel as these notices too.