Expand description
HTTP API over interloper.
| route | |
|---|---|
GET /health | liveness, no auth, not rate limited |
GET /v1/providers | measured health matrix |
DELETE /v1/providers/{name}/quarantine | return a quarantined provider to routing |
POST /v1/inboxes | issue an address |
GET /v1/inboxes/{addr}/messages | list |
GET /v1/inboxes/{addr}/messages/{id} | read one, with its OTP |
DELETE /v1/inboxes/{addr}/messages/{id} | delete |
GET /v1/inboxes/{addr}/wait | long-poll for the next (matching) message |
GET /v1/inboxes/{addr}/events | Server-Sent Events: every message as it lands |
POST/GET /v1/webhooks, DELETE /v1/webhooks/{id} | one-shot outbound webhooks |
Every response is {"success", "data", "error"}. Auth is X-API-Key.
With a Postgres URL, instances share addresses and health: see fleet.
Modules§
- config
- Server settings, from the environment.
- error
- HTTP errors. Clients get a fixed message per kind; detail goes to the log.
- fleet
- Fleet mode: several servers sharing one Postgres.
- ratelimit
- Token buckets, keyed so one noisy client cannot spend another’s budget.
- service
- The logic the routes call. Routes own HTTP; this owns everything else.
- store
- Where the server keeps the addresses it issued.
- webhooks
- One-shot outbound webhooks: “POST me the next message to this address”.
Structs§
Functions§
- envelope
- The one response shape.
successis derived fromerror, so a body can never claim success while carrying one. - envelope_
err - message_
json - The one shape a message takes on the wire:
.../messages/{id},wait, SSE and webhook payloads alike. - router
- serve
- Run the server until Ctrl-C/SIGTERM. Refuses to start without API keys.