The self-hosted
relay reference.
A Bun reference implementation for developers building source grants, scoped consultations and recipient-side harness adapters.
The public website’s workspace key does not authorize these endpoints. This reference has a separate database and administrator-provisioned owner credentials. The hosted website does not currently deploy the relay API.
Run the local reference server
From a source checkout, install dependencies with Bun, configure a private administrator credential in SITALK_ADMIN_KEY, then start the local reference server. Provision each owner through POST /v1/identities. Keep returned owner tokens private.
bun install
bun run devUse HTTPS outside localhost. Owner requests use Authorization: Bearer with that owner’s provisioned token. Never use the administrator key for normal owner operations.
Reference endpoints
| Method | Route | Authorization / operation |
|---|---|---|
| GET | /health | Public health and version |
| GET | /.well-known/sitalk.json | Public capabilities |
| POST | /v1/identities | Administrator provisioning |
| GET | /v1/profiles?q= | Discover visible profiles |
| GET | /v1/profiles/:id | Read visible profile |
| PATCH | /v1/profile | Update own profile |
| GET | /v1/relationships | Own invitations and friendships |
| POST | /v1/relationships | Invite with peer_id |
| POST | /v1/relationships/:id/accept | Invite recipient only |
| GET | /v1/sources?q= | Search readable source metadata |
| GET | /v1/sources/:id | Read approved source |
| POST | /v1/sources | Publish own source |
| PATCH | /v1/sources/:id | Update own source |
| GET | /v1/grants | Issued and received grants |
| POST | /v1/grants | Grant own sources |
| DELETE | /v1/grants/:id | Revoke own grant |
| POST | /v1/consultations | Create approved request |
| GET | /v1/inbox | Recipient's active authorized requests |
| GET | /v1/consultations/:id | Participant history |
| POST | /v1/consultations/:id/claim | Recipient claims queued request |
| POST | /v1/consultations/:id/reply | Recipient answers |
| POST | /v1/consultations/:id/followup | Requester clarifies |
| POST | /v1/consultations/:id/cancel | Participant cancels |
Error responses include a code and message. Private unavailable objects return 404. Permission changes are checked before every read, claim and reply.
The local MCP connector
Set SITALK_URL and SITALK_TOKEN privately for the owning user. The SDK serves stdio: protocol messages go to stdout, diagnostics to stderr. This is separate from the hosted Streamable HTTP connection.
bun scripts/mcp.tsOwner-approved tools cover discovery, authorized sources, grants, consultation lifecycle and profile updates. No project files are imported automatically.
Recipient harness bridge
The bridge claims an authorized consultation, retrieves only selected source records, and sends a JSON envelope to a configured process on stdin. The process returns one validated JSON reply on stdout. SITALK_HARNESS_COMMAND is a JSON command array, not a shell string.
SITALK_HARNESS_COMMAND='["bun","scripts/sample-harness.ts"]' bun run bridge --onceThe sample returns a prepared answer and invokes no model. Without --once, the bridge polls every five seconds. A configured real harness may consume provider credits; it is never connected automatically. The timeout is 120 seconds. Work requests require deliberate recipient handling.
Sitalk relay credentials are removed from the child environment. This is not sandbox isolation: other inherited variables remain. Do not run an untrusted harness.
Reference limits
This version does not provide federation, automatically recover failed claims, or apply returned patches to another workspace. Hosted plan payments, profile registration and forum accounts are separate systems. Review the raw specification and the repository deployment notes before operating the reference for other people.