API overview and Postman
The two APIs, how each is reached and signed, and a Postman collection of both.
Uplink has two APIs. The app's API controls one running app: its conversations, plugins, other networks and screens. The relay server's API is what every app speaks to the server that carries messages between them. Both are documented in full here, and both are in one Postman collection.
The Postman collection
ghost-messaging.postman_collection.json (Postman's v2.1 format; Insomnia, Bruno and others read it too). In Postman: Import, then choose the file or paste its address, https://gogho.st/docs/api/ghost-messaging.postman_collection.json.
It holds every method of the app's API and every HTTP route of the relay, each with its parameters described and an example body. It is made from the same lists these pages are drawn from, so it matches them. Set its variables before the first call:
| Variable | Starts as | What it is |
|---|---|---|
app | http://127.0.0.1:8765 | Where the app serves its API (Turn it on). |
token | empty | The app's token, from Settings › API › Copy the token. Sent as Authorization: Bearer on every app request. |
relay | https://gogho.st | The relay server. Your own, if you run one. |
filesToken | empty | A Files space's token, for the Files routes. |
ghostKey, ghostTime, ghostSig | empty | The signing headers of a signed relay route (below). |
The hub and the pairing channels are WebSockets with binary frames, which a collection of HTTP requests can't hold. They are written out in The hub and pairing protocols.
The app's API
| Where | On the device, http://127.0.0.1:8765 (the port can be changed); on your network too where allowed; from anywhere through the relay, sealed. |
| Who may call | Whoever holds the token (HTTP) or the connection string (through the relay). Off until turned on in developer mode. |
| Shape | POST /api/<method> with the parameters as a JSON object. Answers {"ok": true, "result": …} or {"ok": false, "error": {"code", "message"}}. |
| Reference | App API: every method. |
The relay server's API
| Where | https://gogho.st, or any server running relay/. |
| Who may call | Anyone, for what is public (the Marketplace's catalog). A Files space's routes need its token. Routes that change something are signed with an install's key. |
| Shape | Plain HTTP with JSON or raw bytes, for files, the Marketplace and feedback. WebSockets for the hub and pairing. |
| Reference | Relay server API (HTTP) and The hub and pairing protocols (WebSocket). |
What the relay can and can't see
The relay is built to carry what it can't read. Packets, rooms' chat, calls' setup, files and account backups are sealed on the device with keys the server never holds. It sees which installs connect, which talk to which, when, and how much. It knows an install by a name made from its public key, and keeps usernames, linked handles and numbers as hashes. Privacy and safety says the same for people who aren't reading the source.
Developer docs