Early beta (v0.9) · free while in beta · nothing anyone says is kept once it is heard

API reference

tin-phone public notices API

Send a notice to enrolled devices of a tenant and read its delivery and acknowledgement receipts. Contract version 1.0.0, OpenAPI 3.1.0.

Authentication

A tenant API credential: 20 to 128 characters of [A-Za-z0-9_-], issued once by the tenant's admin (role sender) or the operator. The server keeps only its SHA-256. The operator's own token is accepted too but is not part of this contract.

The base address is the operator's: a self-hosted server answers on http://127.0.0.1:8787 by default.

Notices

POST /tenants/{tenantId}/notices

Send a notice to enrolled devices Bearer tenant token

Role sender only. Every addressee must be an enrolled, unrevoked device of this tenant; otherwise 403 with the same answer for an unknown, another tenant's or a revoked device, so a sender learns nothing about devices outside its tenant. The notice and one queued receipt per device commit together.

tenantId path, required
The tenant. personal is never a tenant: every route refuses it (403).

Body: SendNoticeRequest

  • 201 The notice was queued for every addressee. (SentNotice)
  • 400 The request is malformed or breaks a limit. (Error)
  • 401 No credential, or one the server does not know. (Error)
  • 403 The credential is of another tenant, its role may not do this, an addressee is not an enrolled device of this tenant, or the tenant is personal. (Error)
  • 404 No such tenant or notice (or it is another tenant's). (Error)
  • 503 Notice delivery is not configured on this server. (Error)

Try it in the playground

GET /tenants/{tenantId}/notices/{noticeId}

Delivery state per device Bearer tenant token

Roles sender and tenant-admin. Overdue deliveries are expired before the answer. A notice of another tenant is 404.

tenantId path, required
The tenant. personal is never a tenant: every route refuses it (403).
noticeId path, required
  • 200 The notice and one delivery per addressee. (NoticeStatus)
  • 401 No credential, or one the server does not know. (Error)
  • 403 The credential is of another tenant, its role may not do this, an addressee is not an enrolled device of this tenant, or the tenant is personal. (Error)
  • 404 No such tenant or notice (or it is another tenant's). (Error)
  • 503 Notice delivery is not configured on this server. (Error)

Try it in the playground

POST /tenants/{tenantId}/notices/{noticeId}/revoke

Take a notice back Bearer tenant token

Role sender only. Every open delivery (queued or delivered) becomes revoked, sealed; acknowledged and expired deliveries keep their state. Idempotent.

tenantId path, required
The tenant. personal is never a tenant: every route refuses it (403).
noticeId path, required
  • 200 The deliveries after the revocation. (RevokedNotice)
  • 401 No credential, or one the server does not know. (Error)
  • 403 The credential is of another tenant, its role may not do this, an addressee is not an enrolled device of this tenant, or the tenant is personal. (Error)
  • 404 No such tenant or notice (or it is another tenant's). (Error)
  • 503 Notice delivery is not configured on this server. (Error)

Try it in the playground

GET /tenants/{tenantId}/notices/{noticeId}/receipts

The sealed receipt chain of a notice Bearer tenant token

Roles sender and tenant-admin. events is the whole chain, oldest first. check is the server's own check and is informative only: a client verifies events itself against the seal keys it pinned. A receipt never carries the notice's content, only its digest.

tenantId path, required
The tenant. personal is never a tenant: every route refuses it (403).
noticeId path, required
  • 200 The chain and the server's check of it. (NoticeReceipts)
  • 401 No credential, or one the server does not know. (Error)
  • 403 The credential is of another tenant, its role may not do this, an addressee is not an enrolled device of this tenant, or the tenant is personal. (Error)
  • 404 No such tenant or notice (or it is another tenant's). (Error)
  • 503 Notice delivery is not configured on this server. (Error)

Try it in the playground

Schemas

Error

Every error. The HTTP status is the contract; error is a human-readable sentence that may change between minor versions.

error required
string

Health

status required
any
service
string
version
string

DeviceId

A device ID: base32 of SHA-256 over the device's P-256 SPKI key, first 26 characters.

string

Digest

Lowercase hex SHA-256.

string

UnixMillis

integer

NoticeContent

type required
"text" | "html" | "json" | "binary" | "audio" | "event"
body required
string: At most 64 KiB of UTF-8.
mimeType
string

NoticeAction

id required
string
label required
string

FollowUpRequest

afterMinutes required
integer
times required
integer

FollowUp

afterMs required
integer
times required
integer

SendNoticeRequest

to required
array of DeviceId: Duplicates are collapsed.
content required
NoticeContent
ttlSeconds
number: Default 7 days. Not with expiresAt.
expiresAt
UnixMillis: Within the next 30 days. Not with ttlSeconds.
actions
array of NoticeAction: The replies a device may acknowledge with. Without actions a device acknowledges with acknowledge.
followUp
FollowUpRequest or null: Re-notify devices that have not acknowledged.

DeliveryState

"queued" | "delivered" | "acknowledged" | "expired" | "revoked"

Delivery

noticeId required
string
deviceId required
DeviceId
state required
DeliveryState
updatedAt required
UnixMillis
deliveredAt required
integer or null
acknowledgedAt required
integer or null
ackAction required
string or null: The action the device acknowledged with (acknowledge for a plain acknowledgement).
reminders required
integer
lastNotifiedAt
integer or null

NoticeStatus

id required
string
expiresAt required
UnixMillis
revokedAt required
integer or null
actions required
array of NoticeAction
followUp required
FollowUp
deliveries required
array of Delivery

RevokedNotice

id required
string
deliveries required
array of Delivery

ReceiptWho

id required
string
name required
string
role required
string

SealedReceipt

One sealed step. hash = lowercase hex SHA-256 of the UTF-8 canonical JSON of {lineId, seq, at, who, what, text, data, prev} (keys sorted by UTF-16 code unit at every depth); sig = base64 Ed25519 over the UTF-8 bytes of the 64-character hash; keyId = first 16 hex of SHA-256 over the seal key's SPKI DER. The shape of @contextual/seal.

lineId required
string: The notice ID.
seq required
integer
at required
string: ISO 8601 UTC.
who required
ReceiptWho
what required
"queued" | "delivered" | "acknowledged" | "expired" | "revoked" | "reminded"
text required
string
data required
object
prev required
Digest
hash required
Digest
keyId required
string
sig required
string

ChainCheck

object or object

Every other route

Outside the versioned notices contract; they may change between versions.

Routes by area
AreaWhoRoutes
Channels and messagesBearer: operator or tenant tokenGET /health · GET /adapters · POST /channels · GET /channels/:id · DELETE /channels/:id · POST /channels/:id/messages · GET /channels/:id/messages · POST /webhooks/:adapterId
OperatorBearer: admin tokenPOST /admin/v1/tenants · POST /admin/v1/tenants/:t/tokens · POST /admin/v1/devices · POST /admin/v1/devices/import · POST /admin/v1/devices/:id/revoke · GET /admin/v1/tenants/:t/devices · POST /admin/v1/tenants/:t/tokens/:id/revoke · POST /admin/v1/tenants/:t/workflow-credentials/:id/revoke
Tenant adminBearer: tenant-admin token, or the operatorPOST /tenants/:t/tokens · POST /tenants/:t/tokens/:id/revoke · POST /tenants/:t/devices · POST /tenants/:t/devices/:id/revoke · POST /tenants/:t/devices/:id/replace · GET /tenants/:t/devices · GET /tenants/:t/audit?format=json|csv&from=&to=
DevicesSigned by the device (X-Pillion-*)GET /devices/v1/self · GET /devices/v1/notices · GET /devices/v1/notices/stream (SSE) · GET /devices/v1/notices/socket (WebSocket) · POST /devices/v1/notices/:id/received · POST /devices/v1/notices/:id/ack
Receipt keysNone; rate limited, cacheableGET /receipts/v1/keys
Push-to-talkTenant admin or operator; devices signPOST /ptt/v1/tenants/:t/channels · GET /ptt/v1/tenants/:t/channels/:id · GET /ptt/v1/tenants/:t/channels/:id/receipts · GET /ptt/v1/device/channels · POST /ptt/v1/device/channels/:id/ticket · POST /ptt/v1/device/channels/:id/spurts/:spurtId/heard · GET /ptt/v1/device/ice · GET /ptt/v1/socket?ticket=…
RelayTenant admin; postmaster signs its eventsPOST /relay/v1/tenants/:t/telegram/links · PUT /relay/v1/tenants/:t/sources/postmaster · POST /relay/v1/postmaster/:tenantId · POST /relay/v1/telegram/webhook
Pillion FleetBearer: operator token of the tenantPOST /fleet/v1/admin/tenants/:t/operator-tokens · GET /fleet/v1/tenants/:t/jobs · POST /fleet/v1/tenants/:t/jobs · GET /fleet/v1/tenants/:t/jobs/:id · the console at /fleet