Skip to Content
PAPAMO / DOCS

REST API

Read and write a pSMS archive from your own code: messages, contacts, contact cards, the outbox and tokens.

Every pSMS archive has a JSON API under /v1. Self-hosted archives listen on the address psms status shows. Messages stay encrypted: the API returns sealed envelopes, and your code opens them with the archive key. See Decrypt a message for code, and Encryption.

Authentication

Send a token as Authorization: Bearer TOKEN.

TokenCanCreate it
OwnerEverything belowCreated with the archive; psms manage access create api makes a scoped copy
UploadSave messages and contact cards (what the phone uses)Written into the phone's shortcut
SendQueue texts in the outbox, nothing elsepsms manage access create send
Browser autofillRead recent envelopes for autofillSettings → Browser autofill

Tokens can expire after 7 or 30 days or never, and can be rotated or revoked in Settings or with psms manage access.

Messages

RequestTokenPurpose
POST /v1/messagesUpload, ownerSave one encrypted message
GET /v1/messages?limit=30OwnerNewest first. Pass next_cursor back as cursor for the next page.
GET /v1/messages/{id}OwnerOne message
PATCH /v1/messages/{id}Owner{"starred": true}, {"read": true}, or both
POST /v1/messages/readOwnerMark many read: {"ids": ["…"]}
DELETE /v1/messages/{id}OwnerDelete, and remember the ID so a retried upload can't bring it back

Saving a message:

POST /v1/messages
Authorization: Bearer UPLOAD_TOKEN
Content-Type: application/json

{ "id": "33f25af6-8774-4d98-b5bf-d73545644319",
  "sender": "papamo:encrypted:v1",
  "body": "BASE64(nonce ‖ ciphertext)",
  "contact_id": "9f2c…64 hex…" }

A new message returns 201, an identical retry 200, the same ID with different content 409, and a retry after deletion 410. The reply may include {"contact_card": "wanted"}, asking the phone to send the sender's contact card.

Contacts

RequestPurpose
GET /v1/contactsContacts, newest first. ?contact_id=ID finds one; ?include=messages adds up to five messages each.
GET /v1/contacts/{id}/messagesEvery message from one contact, with a cursor
GET /v1/contacts/cardsSealed contact cards: the phone's copy and your edited copy
PUT /v1/contacts/{id}/cardSave {"envelope": "…"}, or {"envelope": null} to drop your edits

A contact ID is sha256("psms-contact-v1\n" + sender + "\n" + archive key) in hex, so it identifies a sender without revealing them. psms contact-id --key-file KEY computes one.

Chats, reactions and files

pSMS for Mac stores group chats, tapbacks and files sealed with the archive key, like messages. The server links them only by opaque IDs.

RequestTokenPurpose
PUT /v1/chats/{id}Upload, owner{"envelope": "…"}: a chat's sealed title, members and Messages identifier. id is 32 lowercase hex characters.
GET /v1/chatsOwnerEvery chat's id, envelope and updated_at
PUT /v1/messages/{id}/reactions/{reaction}Upload, owner{"envelope": "…"}: a sealed tapback on a message (up to 100 per message)
DELETE /v1/messages/{id}/reactions/{reaction}Upload, ownerRemoves a tapback
PUT /v1/messages/{id}/attachments/{n}Upload, owner{"envelope": "…"}: file n (0–9) of a message, sealed, up to 2 MB of base64
GET /v1/messages/{id}/attachments/{n}OwnerThe sealed file

POST /v1/messages also takes a chat_id. Message listings include chat_id, reactions ([{"id", "envelope"}]) and attachments (a count) when a message has them, and GET /v1/messages?chat=ID lists one chat. Deleting a message deletes its reactions and files.

Outbox

Queue texts for a sending device, such as pSMS for Mac.

RequestTokenPurpose
POST /v1/outboxOwner, send{"to": "+15550100", "body": "On my way"}, optionally "send_at" (Unix time, up to a year ahead) to send later. Returns 202 with an id.
GET /v1/outbox/{id}Owner, sendqueued, sending, sent or failed, with an error if it failed
POST /v1/outbox/claimOwnerFor sending devices: take up to 10 queued texts
POST /v1/outbox/{id}/resultOwnerFor sending devices: {"status": "sent"} or {"status": "failed", "error": "…"}

A claimed text returns to the queue if its device doesn't report back within five minutes. Once sent, the text is removed from the outbox; the sent copy lives in the archive.

On papamo.dev the outbox stores {"envelope": "…"} instead: {"to", "body"} sealed with the archive key, so Papamo never sees it.

Other endpoints

papamo.dev

The hosted API lives at https://na.sms.papamo.dev/free/v1 (also sg, ws and sa). In your own web inbox, open Account → Settings → API keys → Create API key. Copy the key before closing Settings. Send it as Authorization: Bearer YOUR_API_KEY. Choose 1 year or Never expires before creating the key. Revoke either kind in the same section. It has:

  • GET /messages?limit=100&offset=0 (pages by next_offset), POST /messages, PATCH and DELETE /messages/{id}, POST /messages/read. There's no request for a single message: find it by id in the list.
  • GET /contacts/cards and PUT /contacts/{id}/card
  • /outbox with sealed envelopes, and managed webhooks
  • GET /me for your usage and plan, and the public GET /plans

Free accounts are rate limited.