# Silon API

The interactive reference: https://silon.tech/docs/ . The OpenAPI schema: https://silon.tech/api/schema/ .

## Overview

The Silon API is a JSON-over-HTTPS interface for sending messages,
broadcasts, and managing the surrounding resources (clients, groups,
templates, reports). Everything is RESTful and uses standard HTTP
status codes.

## Authentication

Every request authenticates with a Bearer token:

```http
Authorization: Bearer YOUR_API_TOKEN
```

The `Bearer` keyword is required — the legacy `Token` keyword is no longer
accepted.

**Get a key.** The primary credential is an API key created in the dashboard
under **Settings → API keys**. It looks like `sk_live_…` and is shown once at
creation, so store it somewhere safe. Keys can be scoped (**full**,
**send-only**, or **read-only**) and given an optional expiry; a read-only
key is rejected from send endpoints with `403`. Rotate or revoke a key from
the same screen.

**Workspace scope.** Requests are routed to a workspace by subdomain
(`https://<workspace>.silon.tech/api/v1/…`). A key only authorizes the
workspace it was created in — using it against another workspace returns
`403`. Always call the API on your own workspace's subdomain.

## Idempotency

The send endpoints accept an `Idempotency-Key` header for safe retries —
`POST /api/v1/messages/` (both single sends and broadcasts) and
`POST /api/v1/otp/send/`. Same key + same body within 24 hours returns the
cached response without re-running the operation. Use a fresh UUID per
logical request, then retry that UUID on network errors:

```http
POST /api/v1/messages/
Idempotency-Key: 7f3e8a82-1c5a-4b1f-9d4c-7b5d2c8f3e9a
```

If you reuse a key with a *different* body within the window, the
response is `409 Conflict`. Other endpoints ignore the header.

## Pagination

List endpoints on the modern resources return a **cursor envelope**:

```json
{ "results": [ ... ], "next": "<url|null>", "previous": "<url|null>" }
```

Follow the `next` URL (or pass its `cursor` query param) to page forward,
and cap the page size with `?limit=` (default 50, max 100). This is the
canonical list grammar. A few legacy list endpoints still answer with a bare
JSON array or a `{count, results}` shape; each is flagged as legacy in its
own reference and keeps that shape unchanged for backward compatibility.

## Errors

There are **two** error shapes, told apart by the response `Content-Type`.
Check the header before parsing — they are not identical.

* **Standard errors** — raised by the framework (validation, authentication,
  permission, not-found, throttling). Served as `application/json` with a
  **bare-slug** `type` (`validation_error`, `client_error`, or
  `server_error`) and an `errors[]` list carrying the specific `code`,
  `detail`, and `attr` per field:

  ```json
  {
    "type": "validation_error",
    "errors": [
      {"code": "required", "detail": "This field is required.", "attr": "to"}
    ]
  }
  ```

* **Problem responses** — raised by the send pipeline (unknown channel slug,
  idempotency conflict, audience errors, OTP, web-push widget). These follow
  [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807): served as
  `application/problem+json` with a full **URL** `type` and a
  `{type, title, status, detail, field}` body:

  ```json
  {
    "type": "https://silon.tech/docs/errors/channel-not-found",
    "title": "Channel not registered",
    "status": 404,
    "detail": "No v1 handler registered for channel='banana'.",
    "field": "channel"
  }
  ```

A problem response's `type` URL redirects to its reference card in the
[Errors](https://silon.tech/docs/#errors) section of this page.

## Rate limits

Throttled endpoints advertise your quota with [IETF draft RateLimit headers](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/):

```http
RateLimit-Limit: 1000
RateLimit-Remaining: 998
RateLimit-Reset: 1779050545
```

Enforcement is scoped to specific endpoints. The transactional **send** and
**broadcast** endpoints are rate-limited per API key (with a coarser
per-workspace ceiling), and a few credential endpoints (the password-reset
pair, and OTP send/verify) enforce strict per-minute
limits. On those responses the `RateLimit-*` headers reflect your real,
decrementing remaining quota, and exceeding a limit returns `429 Too Many
Requests` — back off until the `RateLimit-Reset` epoch (Unix seconds) before
retrying. Where the headers appear on other `/api/v1/` responses they are
informational, not a live quota.

## Request correlation

Each response carries an `X-Request-Id` header. Include it when reporting
issues; it lets us trace the exact request through our logs. Clients may
also set their own `X-Request-Id` on the request and it will be echoed back
unchanged.

## Versioning

The API is versioned via the URL prefix (`/api/v1/`). Breaking changes
ship in a new version; non-breaking additions land in the current one.

## Trailing slashes

The canonical form of every path carries a trailing slash
(`/api/v1/messages/`). A request without it is accepted too — the router
matches both forms — but responses, `Location` headers, and these docs use
the slash form.

## Auth

Token / password / signup endpoints.
- [`GET /api/v1/profile/`](https://silon.tech/docs/api/retrieveUserProfile.md) Retrieve a user profile: Return the current user's profile.
- [`PATCH /api/v1/profile/`](https://silon.tech/docs/api/patchUserProfile.md) Patch the current user profile: The authenticated user's own profile. Every action operates on the caller — there is no id in the path.
- [`PUT /api/v1/profile/`](https://silon.tech/docs/api/updateUserProfile.md) Replace the current user profile: The authenticated user's own profile. Every action operates on the caller — there is no id in the path.
- [`POST /api/v1/signup/`](https://silon.tech/docs/api/signupUser.md) Sign up a new user: Create a new user account and a matching contact profile. This endpoint is public (no authentication) and IP-rate-limited. `email` doubles as the login username; get a key afterwards in the dashboard under **Settings → API keys**.

## Bulk

Bulk upload + send pipeline.
- [`GET /api/v1/bulk/`](https://silon.tech/docs/api/listBulkBatches.md) List bulk batches: List this workspace's bulk send batches with success/total roll-ups, newest first.
- [`GET /api/v1/bulk/files/`](https://silon.tech/docs/api/listBulkFiles.md) List saved CSVs available for bulk sends: List CSV files saved on the server for the current tenant. Each filename can be passed as ``file`` to ``POST /api/v1/messages/batch/`` (``createMessageBatch``) to dispatch a batch from the saved file. (The deprecated ``POST /api/v1/bulk/send/`` accepts the same names as ``bulk_file``.)
- [`POST /api/v1/bulk/files/`](https://silon.tech/docs/api/uploadBulkFile.md) Upload a CSV for later bulk sends: Upload a CSV file (multipart). The saved filename is a UUID4 with a ``.csv`` suffix — collision-proof by construction so the same caller can re-upload ``vips.csv`` any number of times without clobbering earlier batches. The response returns the UUID-based ``name`` (use this as ``file`` on ``POST /api/v1/messages/batch/`` — ``createMessageBatch``, the successor of the deprecated ``/api/v1/bulk/send/``, which accepts it as ``bulk_file``) plus the ``original_filename`` you uploaded for your own records.
- [`GET /api/v1/bulk/recipient/{id}/`](https://silon.tech/docs/api/getBulkRecipient.md) Retrieve one bulk recipient row (deprecated)
- [`POST /api/v1/bulk/send/`](https://silon.tech/docs/api/sendBulkBatch.md) Dispatch a bulk send (deprecated)
- [`GET /api/v1/bulk/{id}/`](https://silon.tech/docs/api/getBulkBatchDetailed.md) Retrieve a bulk batch with full detail: Return one bulk batch with its full per-recipient breakdown, success/total roll-ups, channels, provider, and templates.

## CRM Clients

Client profile resource (contacts you can address by ID).
- [`GET /api/v1/crm/client/`](https://silon.tech/docs/api/listClients.md) List client profiles
- [`POST /api/v1/crm/client/`](https://silon.tech/docs/api/createClient.md) Create a client profile
- [`DELETE /api/v1/crm/client/{client_id}/`](https://silon.tech/docs/api/deleteClient.md) Delete a client profile
- [`GET /api/v1/crm/client/{client_id}/`](https://silon.tech/docs/api/getClient.md) Retrieve one client profile
- [`PATCH /api/v1/crm/client/{client_id}/`](https://silon.tech/docs/api/patchClient.md) Patch a client profile
- [`PUT /api/v1/crm/client/{client_id}/`](https://silon.tech/docs/api/updateClient.md) Replace a client profile
- [`GET /api/v1/crm/clients/`](https://silon.tech/docs/api/listClientRecords.md) List client profiles: List the client profiles in your workspace, newest first. Cursor paginated: the response is `{results, next, previous}`; follow `next` (or pass `?cursor=…`) to page, and cap the page with `?limit=` (max 100).
- [`POST /api/v1/crm/clients/`](https://silon.tech/docs/api/createClientRecord.md) Create a client profile: Create a client profile. Contacts are also created automatically the first time someone messages you on any channel.
- [`DELETE /api/v1/crm/clients/{client_id}/`](https://silon.tech/docs/api/deleteClientRecord.md) Delete a client profile: Delete a client profile.
- [`GET /api/v1/crm/clients/{client_id}/`](https://silon.tech/docs/api/getClientRecord.md) Retrieve one client profile: Fetch a single client profile by its `client_id`.
- [`PATCH /api/v1/crm/clients/{client_id}/`](https://silon.tech/docs/api/updateClientRecord.md) Patch a client profile: Update selected fields on a client profile (PATCH).
- [`PUT /api/v1/crm/clients/{client_id}/`](https://silon.tech/docs/api/replaceClientRecord.md) Replace a client profile: Replace all writable fields on a client profile (PUT).

## CRM Groups

Client groups for targeting broadcasts and bulk sends.
- [`GET /api/v1/crm/group/`](https://silon.tech/docs/api/listClientGroups.md) List client groups
- [`POST /api/v1/crm/group/`](https://silon.tech/docs/api/createClientGroup.md) Create a client group
- [`DELETE /api/v1/crm/group/{id}/`](https://silon.tech/docs/api/deleteClientGroup.md) Delete a client group
- [`GET /api/v1/crm/group/{id}/`](https://silon.tech/docs/api/getClientGroup.md) Retrieve one client group
- [`PATCH /api/v1/crm/group/{id}/`](https://silon.tech/docs/api/patchClientGroup.md) Patch a client group
- [`PUT /api/v1/crm/group/{id}/`](https://silon.tech/docs/api/updateClientGroup.md) Replace a client group
- [`GET /api/v1/crm/groups/`](https://silon.tech/docs/api/listClientGroupRecords.md) List client groups: Return the client groups on this workspace, newest first. Cursor paginated: the response is `{results, next, previous}`; follow `next` (or pass `?cursor=…`) to page, and cap the page with `?limit=` (max 100).
- [`POST /api/v1/crm/groups/`](https://silon.tech/docs/api/createClientGroupRecord.md) Create a client group: Create a client group. Pass `client_ids` to set the initial membership.
- [`DELETE /api/v1/crm/groups/{id}/`](https://silon.tech/docs/api/deleteClientGroupRecord.md) Delete a client group: Delete a client group. The member client profiles are not deleted.
- [`GET /api/v1/crm/groups/{id}/`](https://silon.tech/docs/api/getClientGroupRecord.md) Retrieve one client group: Return one client group, including its member client profiles.
- [`PATCH /api/v1/crm/groups/{id}/`](https://silon.tech/docs/api/updateClientGroupRecord.md) Patch a client group: Update some fields of a client group; omit `client_ids` to leave the membership unchanged.
- [`PUT /api/v1/crm/groups/{id}/`](https://silon.tech/docs/api/replaceClientGroupRecord.md) Replace a client group: Replace a client group. `client_ids` replaces the membership wholesale.

## Conversations

- [`GET /api/v1/conversations/`](https://silon.tech/docs/api/listConversations.md) List conversations: Returns a cursor-paginated page of the workspace's conversations, most recently active first. Poll for changes with `updated_since`.
- [`GET /api/v1/conversations/{conv_id}/`](https://silon.tech/docs/api/getConversation.md) Retrieve a conversation
- [`PATCH /api/v1/conversations/{conv_id}/`](https://silon.tech/docs/api/updateConversation.md) Update a conversation: Change status, priority, assignee, labels or archive state. Only the fields you send are altered.
- [`GET /api/v1/conversations/{conv_id}/messages/`](https://silon.tech/docs/api/listConversationMessages.md) List messages in a conversation: Cursor-paginated message history, newest first.
- [`POST /api/v1/conversations/{conv_id}/messages/`](https://silon.tech/docs/api/createConversationMessage.md) Reply in a conversation: Sends a reply to the customer through the conversation's own channel, or records an internal note when `internal` is true. Returns 409 when the channel's messaging window has closed.

## Deliveries

- [`GET /api/v1/deliveries/`](https://silon.tech/docs/api/listDeliveries.md) List message deliveries: Every delivery attempt across every channel, newest first — the API twin of the Deliveries page.
- [`GET /api/v1/deliveries/{delivery_id}/`](https://silon.tech/docs/api/getDelivery.md) Retrieve one delivery: Fetch a single delivery by the `id` returned in the list — the same tracking id `/broadcasts/{id}/deliveries` reports.

## Events

The durable event log. Outbound delivery events (`message.delivered`, `message.failed`, `broadcast.completed`) and inbox events (`message.received`, `conversation.created` / `.status_changed` / `.assigned`) are recorded here and remain retrievable / replayable independently of webhook delivery.
- [`GET /api/v1/events`](https://silon.tech/docs/api/listEvents.md) List events: Returns a cursor-paginated page of the tenant's event log, newest first. Optionally filter by ``type``. Each row is the same envelope POSTed to webhook endpoints.
- [`GET /api/v1/events/{public_id}`](https://silon.tech/docs/api/getEvent.md) Retrieve an event: Fetch a single event by id. The body is the exact envelope delivered to webhooks.
- [`POST /api/v1/events/{public_id}/replay`](https://silon.tech/docs/api/replayEvent.md) Re-deliver one event: Queue a fresh delivery of an event you already received (or missed). Useful when your handler threw on a specific payload and our retries have been exhausted.

## Messages

One unified endpoint — `POST /api/v1/messages/`. The `channel` is a body field (`whatsapp`, `sms`, `email`, `web_push`, `push`, `tts`); there are no per-channel endpoints. Provide `to` for a single recipient (returns a `message`) or `audience` to fan out (returns a `broadcast`) — exactly one.
- [`POST /api/v1/broadcasts/`](https://silon.tech/docs/api/createBroadcast.md) Send a broadcast (one content, an audience): Create a **broadcast** — one piece of content fanned out to an audience — on any outbound channel. This is the preferred broadcast endpoint (`POST /api/v1/messages/` with `audience` keeps working as a legacy alias).
- [`POST /api/v1/broadcasts/{broadcast_id}/cancel/`](https://silon.tech/docs/api/cancelBroadcast.md) Cancel a scheduled broadcast: Cancel a broadcast that was created with `send_at` and is still `scheduled`. Returns `200` with the envelope showing `status: "canceled"`; a canceled broadcast never dispatches and emits a `broadcast.canceled` event (livemode-aware).
- [`POST /api/v1/messages/`](https://silon.tech/docs/api/createMessage.md) Send a message or broadcast (unified, channel-as-field): The single messaging entry point — one endpoint for every channel and both send modes.
- [`POST /api/v1/messages/batch/`](https://silon.tech/docs/api/createMessageBatch.md) Send a batch of personalised messages (many rows, one call): Accept **many independent, personalised messages** in one HTTP call — the batch primitive. Use it when every recipient gets *different* content; for one content fanned out to an audience, use `POST /api/v1/broadcasts/`. The body takes **exactly one** of `messages` (inline rows, up to 500) or `file` (a saved CSV name from `POST /api/v1/bulk/files/`) — neither or both is a `422 batch-invalid`.
- [`POST /api/v1/messages/{event_id}/cancel/`](https://silon.tech/docs/api/cancelMessage.md) Cancel a scheduled message: Cancel a message that was created with `send_at` and is still `scheduled` — the `event_id` is the `id` from the create envelope. Returns `200` with the envelope showing `status: "canceled"`; a canceled send never dispatches and emits a `message.canceled` event (livemode-aware).

## Mobile push devices

Register iOS / Android devices and inspect delivered native pushes.
- [`GET /api/v1/push/android/{slug}/`](https://silon.tech/docs/api/listAndroidPushNotifications.md) List Android push notifications: List delivered native pushes for the current user on Android devices, under the app `slug` in the URL. Returns a bare JSON array; the canonical list grammar is the cursor envelope `{results, next, previous}` used by the modern resources.
- [`POST /api/v1/push/client/`](https://silon.tech/docs/api/upsertPushDevices.md) Register or prune a client's push devices
- [`DELETE /api/v1/push/devices/`](https://silon.tech/docs/api/deletePushDevice.md) Deregister a push device: Removes the device holding `token`. Call it on logout and on uninstall — without it the row lives until the provider reports the token dead, which for a logout never happens (the token is still valid, it just belongs to nobody now).
- [`GET /api/v1/push/devices/`](https://silon.tech/docs/api/listPushDevices.md) List push devices: Returns a cursor-paginated page of registered devices (newest first). This is the reconciliation read: an integration with no device table of its own asks Silon which of a contact's devices are still live.
- [`POST /api/v1/push/devices/`](https://silon.tech/docs/api/registerPushDevice.md) Register a push device: Registers a push token for a contact. **Idempotent on the token**: re-sending the same `(application, token)` updates that device instead of creating a second one, so an app that registers on every launch does not grow rows.
- [`GET /api/v1/push/ios/{slug}/`](https://silon.tech/docs/api/listIosPushNotifications.md) List iOS push notifications: List delivered native pushes for the current user on iOS devices, under the app `slug` in the URL. Returns a bare JSON array; the canonical list grammar is the cursor envelope `{results, next, previous}` used by the modern resources.
- [`GET /api/v1/push/list/{slug}/`](https://silon.tech/docs/api/listAllPushNotifications.md) List native push notifications (legacy combined endpoint): List delivered native pushes for the current user across all device platforms, under the app `slug` in the URL. Legacy — prefer the per-platform iOS / Android listings. Returns a bare JSON array; the canonical list grammar is the cursor envelope `{results, next, previous}` used by the modern resources.
- [`POST /api/v1/push/read/`](https://silon.tech/docs/api/markPushAsRead.md) Mark a native push notification as read: Mark all of the current user's unread native pushes for the given app `slug` as read. Returns the number of rows affected.
- [`POST /api/v1/subscribe/android/`](https://silon.tech/docs/api/subscribeAndroidDevice.md) Register an Android device for push
- [`POST /api/v1/subscribe/ios/`](https://silon.tech/docs/api/subscribeIosDevice.md) Register an iOS device for push

## OTP

Send and verify one-time passcodes over any channel.
- [`GET /api/v1/otp/purposes/`](https://silon.tech/docs/api/listOtpPurposes.md) List OTP purposes: Lists the tenant's **active** ``OtpPurpose`` configurations — the names accepted by ``POST /api/v1/otp/send/`` together with each purpose's delivery channel, code length, and TTL. Lets an integration offer a channel picker (e.g. SMS vs WhatsApp) without hard-coding purpose names. ``channels`` lists every channel a purpose delivers over: more than one entry means one code arrives over each of them, and a send must carry a recipient each accepts.
- [`POST /api/v1/otp/send/`](https://silon.tech/docs/api/sendOtp.md) Generate and dispatch an OTP: Looks up the named ``OtpPurpose`` on the tenant, generates a code per its configuration, dispatches it via the configured channel/provider (WhatsApp AUTHENTICATION template / SMS / Email), and returns the ``otp_id`` the client must pass back to ``POST /api/v1/otp/verify/``.
- [`POST /api/v1/otp/verify/`](https://silon.tech/docs/api/verifyOtp.md) Verify an OTP: Verifies a code against an ``otp_id`` issued by ``POST /api/v1/otp/send/``. Increments the per-OTP attempt counter on every call; once ``max_verify_attempts`` is reached the code is permanently rejected with ``410 Gone``. For OTPs issued in test mode (``sk_test_``), exactly the magic code ``000000`` verifies and the envelope carries ``livemode: false``.

## Payments

- [`GET /api/v1/payment_links/`](https://silon.tech/docs/api/listPaymentLinks.md) List payment links: Payment links in this key's mode, newest first, cursor-paginated.
- [`POST /api/v1/payment_links/`](https://silon.tech/docs/api/createPaymentLink.md) Create a payment link: Ask a customer for money. Returns a link to send them — hosted on your own domain, so expiry and cancellation stay enforceable.
- [`GET /api/v1/payment_links/{public_id}`](https://silon.tech/docs/api/getPaymentLink.md) Retrieve a payment link: The link's current state. `status` reflects what the gateway has confirmed — Silon never marks a link paid from anything but a server-side status query.
- [`POST /api/v1/payment_links/{public_id}/cancel`](https://silon.tech/docs/api/cancelPaymentLink.md) Cancel a payment link: Withdraw an unpaid link: the page stops accepting payment and a `payment_link.cancelled` event fires.

## Reports

Usage statistics and per-channel reports.
- [`POST /api/v1/reports/aws-usage-statistics/`](https://silon.tech/docs/api/getAwsUsageReport.md) AWS usage statistics: Amazon SES send statistics (bounces, complaints, delivery attempts, rejects) per timestamp. Takes no request parameters; returns an empty report when SES storage is not configured.
- [`GET /api/v1/reports/balance/{slug}/`](https://silon.tech/docs/api/getProviderBalance.md) Provider account balance: Returns the upstream balance for a provider account identified by ``slug``. Empty string for accounts without a balance lookup.
- [`POST /api/v1/reports/bulks/`](https://silon.tech/docs/api/getBulksReport.md) Bulk batches summary report: One row per uploaded bulk batch with creation/schedule/sent dates and success / failure counts, over an optional date range.
- [`POST /api/v1/reports/channels/`](https://silon.tech/docs/api/getChannelsReport.md) Channels usage report: Per-channel message volume (and, for SMS/TTS/Twilio, the provider account + balance) over an optional date range, for the canonical outbound channels.
- [`POST /api/v1/reports/clients/`](https://silon.tech/docs/api/getClientsReport.md) Clients activity report: Client directory filtered by registration date, default language, held device tokens and web-push subscription status.
- [`GET /api/v1/reports/conversations/`](https://silon.tech/docs/api/getConversationsReport.md) Conversation (support) metrics: Support-desk metrics for Live Desk conversations — first-response / resolution / reply times, CSAT, and open/unassigned/unattended gauges — with an agent / channel / team / label breakdown. A **GET with query params** (the correct grammar for a read), unlike the older POST-for-filter report endpoints.
- [`POST /api/v1/reports/messages/`](https://silon.tech/docs/api/getMessagesReport.md) Messages activity report: Per-message delivery log. ``report_type`` (required) selects the message family and therefore the per-row columns; it is echoed at the top level of the response.
- [`POST /api/v1/reports/specific-bulks/`](https://silon.tech/docs/api/getSpecificBulksReport.md) Specific bulk batches drill-down: Per-recipient drill-down into a single bulk batch (selected via the required ``bulks_file`` id), with channel / provider / status detail.
- [`POST /api/v1/reports/subscriptions/`](https://silon.tech/docs/api/getSubscriptionsReport.md) Push subscriptions report: Push subscription roster. ``report_type`` (required) chooses mobile device subscriptions or web browser pushes; it is echoed at the top level of the response.
- [`POST /api/v1/reports/users/`](https://silon.tech/docs/api/getUsersReport.md) Users activity report: Messages sent grouped per staff user / channel / device type over an optional date range, with an optional free-text search.

## Status

Status + delivery drill-in for past sends and broadcasts.
- [`GET /api/v1/broadcasts/{broadcast_id}/`](https://silon.tech/docs/api/getBroadcast.md) Retrieve broadcast aggregate counts: Aggregate per-status counts for a broadcast. A broadcast created with `send_at` resolves here before dispatch too: `status: "scheduled"` (or `"canceled"` after a cancel) with zero counts and `send_at` echoed; after dispatch the same id reports the normal `in_progress` → `completed` lifecycle.
- [`GET /api/v1/broadcasts/{broadcast_id}/deliveries/`](https://silon.tech/docs/api/listBroadcastDeliveries.md) List per-recipient deliveries for a broadcast
- [`GET /api/v1/messages/{event_id}/`](https://silon.tech/docs/api/getMessageStatus.md) Look up a queued / sent message by event id: Poll the delivery status of a single send. The path id is the `id` returned by `POST /api/v1/messages/` (also in the `Location` header). The modern read shape is `id` + `object: "message"` + `channel` + an aggregate `status` (`scheduled` → `queued` → `sent` / `failed`, or `canceled`) + `timeline` — the ordered list of status transitions the deliveries ledger can attest, each entry `{status, at, provider?}` ascending by `at`. Single-recipient sends show the full journey including `delivered` receipts when the channel reports them; `delivered` granularity lives only in `timeline` (the top-level `status` vocabulary is unchanged). A send created with `send_at` resolves here before dispatch too: `status: "scheduled"` (with `send_at` echoed) and a single-entry `scheduled` timeline, the same `id` continuing through the normal lifecycle after dispatch. The legacy fields `event_id`, `is_sent` and the per-recipient `messages` array are deprecated but still returned unchanged. For broadcasts, use `GET /api/v1/broadcasts/{broadcast_id}/` instead.

## Suppressions

The workspace's do-not-contact list. A suppressed address is enforced across every send surface: single sends answer `422 recipient-suppressed`, fan-outs (broadcasts, batches, bulk) skip the recipient and report it under the `skipped.suppressed` breakdown. Rows are mode-scoped (test keys manage test suppressions only) and may target one channel or all channels. Transactional sends can bypass a row per request with `override_suppression: true` on `createMessage`, gated to the `suppressions:override` scope.
- [`GET /api/v1/suppressions/`](https://silon.tech/docs/api/listSuppressions.md) List suppressions: Returns a cursor-paginated page of the workspace's suppression list (newest first), optionally filtered by ``address``, ``channel``, or ``reason``. Only rows in the key's mode are returned — test keys see test suppressions, live keys live ones.
- [`POST /api/v1/suppressions/`](https://silon.tech/docs/api/createSuppression.md) Create a suppression: Adds an address to the do-not-contact list. From that moment the address is enforced across EVERY send surface in the key's mode: single sends (`createMessage`, OTP) answer `422 recipient-suppressed`; fan-outs (broadcasts, batches, bulk, the SMTP gateway's per-message reject) skip the recipient and count it in the `skipped.suppressed` breakdown.
- [`DELETE /api/v1/suppressions/{public_id}/`](https://silon.tech/docs/api/deleteSuppression.md) Delete a suppression: Removes an address from the do-not-contact list. Sends to it are accepted again immediately. Only rows in the key's mode are deletable — a mode-mismatched id reads as `404`.

## Templates

Reusable message templates with an immutable version history. Reference one on any send via `template: {"slug": ..., "variables": {...}}` — the latest content renders unless the send pins a `version`. Every content edit (`subject` / `body` / `body_md`) mints version N+1; old versions stay frozen and pinnable forever. DELETE archives rather than destroys.
- [`GET /api/v1/templates/`](https://silon.tech/docs/api/listTemplates.md) List templates: Returns a cursor-paginated page of the workspace's message templates (newest first). Archived templates are excluded. `version` on each row is the latest immutable version number; fetch a template's full content and version list via `GET /api/v1/templates/{slug}/`.
- [`POST /api/v1/templates/`](https://silon.tech/docs/api/createTemplate.md) Create a template: Creates a message template at **version 1**. The template is immediately usable on sends via `template: {"slug": ...}` (latest content) — and every later content edit mints an immutable version you can pin with `template.version`.
- [`DELETE /api/v1/templates/{slug}/`](https://silon.tech/docs/api/deleteTemplate.md) Archive a template: Soft delete. The template disappears from lists, answers `404` on GET/PATCH, and sends referencing its slug fail template resolution exactly like an unknown slug — but its version history and past-delivery references survive, and the slug stays reserved (re-creating it is `409 template-exists`).
- [`GET /api/v1/templates/{slug}/`](https://silon.tech/docs/api/getTemplate.md) Retrieve a template: The full template object — latest content plus `versions`, the ascending list of immutable version numbers a send may pin via `template: {"slug": ..., "version": N}`. Archived templates answer `404`.
- [`PATCH /api/v1/templates/{slug}/`](https://silon.tech/docs/api/updateTemplate.md) Update a template (content edits mint a new version): Partial update. Changing any **content** field (`subject`, `body`, `body_md`) mints immutable version N+1 — the previous versions stay frozen and pinnable forever. `channel` is metadata: changing it alone updates the template without a version bump. A no-op PATCH (values identical to the current content) mints nothing.

## Web push devices

Register a browser subscription for Web Push delivery.
- [`POST /api/v1/webpush/client/`](https://silon.tech/docs/api/subscribeWebPushClient.md) Register a browser subscription for a client (legacy)

## Webhook Endpoints

Register HTTPS URLs to receive **signed** event callbacks. Every delivery carries a `Silon-Signature: t=<unix_ts>,v1=<hmac>` header — the value is `HMAC-SHA256(secret, "<unix_ts>.<raw_body>")` in hex. Verify it with the endpoint's signing secret (returned once, at create time) and reject timestamps outside a tolerance window to stop replays. Failed deliveries retry with capped exponential backoff.
- [`GET /api/v1/webhook_endpoints`](https://silon.tech/docs/api/listWebhookEndpoints.md) List webhook endpoints: Returns a cursor-paginated page of the tenant's webhook endpoints, newest first.
- [`POST /api/v1/webhook_endpoints`](https://silon.tech/docs/api/createWebhookEndpoint.md) Create a webhook endpoint: Registers a URL to receive event deliveries. The response includes the signing ``secret`` — this is the **only** time it is returned, so store it now.
- [`DELETE /api/v1/webhook_endpoints/{public_id}`](https://silon.tech/docs/api/deleteWebhookEndpoint.md) Delete a webhook endpoint: Permanently delete an endpoint. It stops receiving deliveries immediately.
- [`GET /api/v1/webhook_endpoints/{public_id}`](https://silon.tech/docs/api/getWebhookEndpoint.md) Retrieve a webhook endpoint: Fetch a single webhook endpoint by id. The signing ``secret`` is never returned.
- [`PATCH /api/v1/webhook_endpoints/{public_id}`](https://silon.tech/docs/api/updateWebhookEndpoint.md) Update a webhook endpoint: Partially update an endpoint — change its URL, description, subscribed events, or flip ``status`` to ``disabled`` to stop deliveries without deleting it.
- [`GET /api/v1/webhook_endpoints/{public_id}/attempts`](https://silon.tech/docs/api/listWebhookEndpointAttempts.md) List delivery attempts for a webhook endpoint: Returns a cursor-paginated page of this endpoint's delivery ledger, newest first — one row per (event, endpoint) delivery with its retry state. Use it to debug a misbehaving sink: ``ok: false`` rows carry the last failure in ``error`` and, while retries remain, the next retry time in ``next_attempt_at``. Test pings (``testWebhookEndpoint``) are not persisted and never appear here.
- [`POST /api/v1/webhook_endpoints/{public_id}/replay`](https://silon.tech/docs/api/replayWebhookEndpointEvents.md) Re-deliver a window of events to an endpoint: Catch an endpoint up after an outage: re-send everything it should have received between `since` and `until`.
- [`POST /api/v1/webhook_endpoints/{public_id}/rotate_secret`](https://silon.tech/docs/api/rotateWebhookEndpointSecret.md) Rotate a webhook endpoint's signing secret: Issue a new signing secret and return it — **once**, exactly like at creation.
- [`POST /api/v1/webhook_endpoints/{public_id}/test`](https://silon.tech/docs/api/testWebhookEndpoint.md) Send a test ping to a webhook endpoint: Synchronously POSTs a signed ``ping`` event envelope to the endpoint's URL and reports what happened. Use it to verify your sink's routing and signature verification before real traffic flows.

## WhatsApp Templates

Approved Meta-Cloud template inventory.
- [`GET /api/v1/whatsapp/templates/`](https://silon.tech/docs/api/listWhatsappTemplates.md) List approved WhatsApp templates: List APPROVED WhatsApp templates available on the current tenant. Each item includes the ``variables`` list whose ``key`` values are exactly what the send endpoint expects under ``whatsapp_template_variables``.
- [`GET /api/v1/whatsapp/templates/{id}/`](https://silon.tech/docs/api/getWhatsappTemplate.md) Retrieve one WhatsApp template with its components + variables: Return one WhatsApp template by pk, including its full components payload and the variable list. Use this when you want to render a custom send form against a known template.

## Self-hosting (on-prem)

AI assistants installing Silon for someone should first read the [installation runbook](https://silon.tech/install.md).

Silon runs as a Docker Compose stack on your own server. You can deploy to a new cloud VM or install on an existing Linux server.

### Install with an AI assistant

1. Send your assistant this prompt. “Install Silon on my Google Cloud account.” You can specify AWS, Azure, or a Linux server you already have. If you have the Silon Install skill, ask the assistant to use it.
2. Tell the assistant where to install, the domain you want to use (if you have one), and your email. Confirm the cloud cost before it provisions resources. Sign in to your cloud yourself. If the assistant lacks access to your terminal, it can prepare commands for Cloud Shell or an SSH session on your existing server.
3. If the assistant gives you a registration link, open it and enter the six-digit code Silon emails you so installation can continue.
4. When installation finishes, add the DNS A record if you chose a domain. Open the private setup link to create the server's owner account, then sign in and connect your channels.

### Deploy a new server with a license

Run the CLI on your computer or in your provider's Cloud Shell, signed in to the provider's CLI. The example deploys to Google Cloud. Use `aws` or `azure` for those providers.

```sh
curl -fsSL https://get.silon.tech/go/install-cli.sh | sh
export PATH="$HOME/.local/bin:$PATH"
silon deploy gcp -host chat.example.com -email ops@example.com -approve
```

Open the approval link to choose a license in your browser. You can also use the command with the install token provided on the license's page. The CLI creates the VM, its public IP, and firewall rules, follows the install, and prints the DNS record and owner setup link. If you use a domain, Silon obtains and renews its certificate once DNS points to the server.

### Install on an existing server

Use an x86-64 Linux server with Docker Engine 24 or later, Compose 2.24 or later, and ports 80 and 443 reachable. A standard deployment uses Ubuntu 24.04, 2 vCPUs, 8 GB RAM, and 50 GB of disk. Silon includes PostgreSQL by default and supports an external PostgreSQL 17 server.

Run the following on the server with a user who can run Docker. Replace the example domain, email, and install token with the values for your server.

```sh
curl -fsSL https://get.silon.tech/install.sh | sh
cd ~/silon
./bin/silon install -token sit_… -host chat.example.com -email ops@example.com
```

The installer downloads and verifies the release, claims the license, and starts Silon. On a terminal, `./bin/silon install` without flags opens the guided installer. With a license file, follow the wizard's fingerprint and license steps. Open the setup link if one was provided, or run `./bin/silon admin create` to create the owner from the server. Use `./bin/silon doctor` and `./bin/silon status` to check the installation.

### Upgrade or enable one-click updates

Run `silon upgrade` from the bundle directory to install the latest release, or pass a version to select a specific release. The CLI backs up the database before switching releases and rolls back if the new release fails its health check.

Enable **Update now** in the admin dashboard by selecting one-click updates during the guided install or running these commands on the server with the same user that manages your Silon stack.

```sh
silon agent install
silon agent status
```
