Subscribers (Endpoints)
A subscriber is one destination for your data: one URL, one kind of data, one optional transform script. Everything about outbound traffic is configured here — Courier has no other way to send data anywhere.
Field reference
| Field | Meaning |
|---|---|
| Name | Display name, used in ledgers, notifications and context.endpointName |
| Kind | What this subscriber receives: workout, sleep, note (annotation) or weather. One subscriber = one kind |
| URL | Destination. HTTPS required (plain http://localhost is allowed for local testing) |
| Method | GET / POST / PUT / PATCH / DELETE — default POST |
| Headers | Static, non-secret headers sent with every request |
| Auth | How the secret is attached: Bearer (Authorization: Bearer <secret>), custom header (you name the header), query parameter (you name the parameter), or None |
| Secret | Stored in the iOS Keychain, never in the database and never in config backups |
| Body params | Static key–value pairs. With POST they are merged into the JSON body; with other methods they are flattened into the query string |
| Include route | Workouts only: attach the GPS track (can be large) |
| Include HR series | Workouts only: attach the full heart-rate time series (large) |
| Auto dispatch | Deliver automatically when new data of this kind arrives. Off = this subscriber only receives manual/batch dispatches |
| Linked weather | Sleep subscribers only: after a successful sleep dispatch, also send current weather to the selected weather subscriber |
| Weather once per day | With linked weather: only the first sleep of the day carries weather (naps don't re-send it) |
| Transform script | Optional JavaScript that builds the request body — see JavaScript Transform |
What the request looks like
Without a transform script, the body is the canonical record of the kind — a stable, versioned JSON document (schemas in JavaScript Transform) — with your body params merged in. Every request also carries an Idempotency-Key header; see Dispatch & Sync for the exact semantics.
2xx responses count as success. Any other status, and the item enters the retry/attention flow with the response recorded in the dispatch history.
Testing a subscriber
The editor's Test button sends a recent sample record through the entire pipeline — including your transform script, auth and headers — and shows the HTTP status plus response body in-app. Use it until your server is happy, then enable auto dispatch.
Patterns
- Same URL, two kinds: add two subscribers pointing at the same endpoint, one for workouts, one for sleep. Your server can branch on the payload.
- Weather journal: create a
weathersubscriber, then link it from your sleep subscriber — every morning's dispatch carries the day's weather next to the night's sleep. - Fan-out: any number of subscribers may receive the same kind; each dispatch is tracked separately, and one failing endpoint never blocks another.