> ## Documentation Index
> Fetch the complete documentation index at: https://developers.vibrant-wellness.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Receive signed notifications when your clinic's orders change.

> [!NOTE]
>
> **Enabled per account.** Until webhooks are enabled for your account, management calls return
> `403` with `details.reason: "not_enabled"`. Email
> [portal-api@vibrant-wellness.com](mailto:portal-api@vibrant-wellness.com) to enable them.

Register an HTTPS endpoint once. Vibrant then sends a signed `POST` to it whenever an order of your
clinic changes. Every event identifies the order by its `accessionId` and carries the order's
complete current status: order, kit and report status, report counts, and the unified status.

Payloads never contain patient names, dates of birth, contact details, tests, or results. An
accession ID together with a lab status is still protected health information (PHI), so handle
every payload as PHI.

**1. Get an RS256 access token**

Use your existing client ID and client secret. Request the token with `algorithm=RS256`; see
[Authentication for the management API](#authentication-for-the-management-api).

**2. Create an endpoint**

`POST /v1/webhooks` with your HTTPS URL. Save the returned `secret` on your server; it is shown
only once.

**3. Verify, store, acknowledge**

Verify the signature on the raw body, save the event, and answer `2xx`. Process it
asynchronously.

**4. Fetch what changed**

Use the event's `accessionId` with the [Report endpoint](https://developers.vibrant-wellness.com/api-reference/reports/get.md) to retrieve
the latest results.

## Coverage and identifiers

An endpoint receives events for **every order of your clinic**: orders from all of its providers,
placed through the Vibrant Portal or this API. You never pass a clinic or provider ID; your
account comes from your credentials. You receive events only while an order belongs to your
clinic. When it leaves, you receive [`order.access_revoked`](#event-types).

Events identify the order **only by `accessionId`**. They do not include `orderId` or `placerId`.

* `accessionId` is an opaque string of 1 to 64 characters. It is usually 10 digits but can contain
  letters (sandbox simulations use `SIM` followed by 10 digits). Never parse it as a number.
* To match events to your own orders, store the `accessionId` that
  [`POST /orders`](https://developers.vibrant-wellness.com/api-reference/orders/place) returns. `POST /orders` returns it as a JSON number,
  so compare it as a string: `2508088888` matches `"2508088888"`. Rows of the
  [order list](https://developers.vibrant-wellness.com/api-reference/orders/status.md#list-orders) also carry `accessionId` next to your
  `placerId`.

> [!NOTE]
>
> **WIP — coming soon:** [looking up an order by `accessionId`](https://developers.vibrant-wellness.com/api-reference/orders/status#look-up-by-accessionid)
> in Get orders, for orders placed through this API. An order placed in the Vibrant Portal will
> return `403` (`not_placed_via_api`); use its `accessionId` with the
> [Report endpoint](https://developers.vibrant-wellness.com/api-reference/reports/get.md) instead. Until the lookup is available, use the
> Report endpoint, or find the order in the [order list](https://developers.vibrant-wellness.com/api-reference/orders/status.md#list-orders).

## Authentication for the management API

The management API uses the same OAuth client as the rest of the Portal API: your existing client
ID and client secret. Request the access token with `algorithm=RS256`. Tokens signed with any other
algorithm are rejected with `401`.

```bash theme={null}
curl -X POST https://api-sandbox.vibrant-america.com/v1/oauth2/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "client_id=$VW_CLIENT_ID" \
  --data-urlencode "client_secret=$VW_CLIENT_SECRET" \
  --data-urlencode "algorithm=RS256"
```

Send it as `Authorization: Bearer <access_token>`. Request a new token when the current one
expires or a call returns `401`. Only client-credentials tokens can use this API; a token from a
user sign-in flow returns `403` with `details.reason: "client_credentials_required"`.

| | Sandbox | Production |
| :- | :- | :- |
| Management API | `https://api-sandbox.vibrant-america.com/v1/webhooks` | `https://api.vibrant-america.com/v1/webhooks` |
| `environment` in every event | `sandbox` | `production` |
| [`simulate`](#simulate-an-order-in-sandbox) | Available | Not available (`404`) |

Sandbox and production are fully separate. Endpoints, secrets, tokens, and delivery logs exist only
in the environment where you created them.

## Manage endpoints

| Method | Path | Operation |
| :- | :- | :- |
| `POST` | `/v1/webhooks` | [Create an endpoint](#create-an-endpoint) |
| `GET` | `/v1/webhooks` | List endpoints (`page`, `perPage`, optional `status`) |
| `GET` | `/v1/webhooks/{webhookId}` | Get an endpoint, with an `ETag` header |
| `PATCH` | `/v1/webhooks/{webhookId}` | [Update, disable, or re-enable](#update-disable-or-delete-an-endpoint) |
| `DELETE` | `/v1/webhooks/{webhookId}` | [Delete an endpoint](#update-disable-or-delete-an-endpoint) |
| `POST` | `/v1/webhooks/{webhookId}/rotate-secret` | [Rotate the signing secret](#rotate-the-signing-secret) |
| `POST` | `/v1/webhooks/{webhookId}/test` | [Send a test event](#send-a-test-event) |
| `POST` | `/v1/webhooks/{webhookId}/resend` | [Re-send the current state of orders](#re-send-the-current-state-of-orders) |
| `GET` | `/v1/webhooks/{webhookId}/deliveries` | [List deliveries](#delivery-log) |
| `POST` | `/v1/webhooks/{webhookId}/deliveries/search` | [Find the deliveries of one order](#delivery-log) |
| `GET` | `/v1/webhooks/{webhookId}/deliveries/{deliveryId}` | [Get a delivery](#delivery-log) |
| `POST` | `/v1/webhooks/{webhookId}/deliveries/{deliveryId}/redeliver` | [Redeliver a delivery](#redeliver-a-delivery) |
| `POST` | `/v1/webhooks/{webhookId}/recover` | [Recover after an outage](#recover-after-an-outage) |
| `POST` | `/v1/webhooks/{webhookId}/simulate` | [Simulate an order](#simulate-an-order-in-sandbox) (sandbox only) |

Request bodies are JSON (UTF-8, at most 16 KiB). Fields are camelCase; timestamps are RFC 3339 in
UTC with milliseconds. IDs are prefixed strings: `whk_` (endpoint), `whsk_` (signing secret),
`evt_` (event), `dlv_` (delivery). An unknown field or query parameter returns `400`, and so does a
`clinicId` or `customerId` anywhere in the request. Lists take `page` and `perPage` (default 20,
maximum 100) and return `items`, `count`, `page`, and `perPage`, newest first.

Accession IDs never appear in management API URLs. To find the deliveries of one order, send its
`accessionId` in the body of `POST …/deliveries/search`.

### Create an endpoint

```bash theme={null}
curl -X POST https://api-sandbox.vibrant-america.com/v1/webhooks \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://ehr.example-clinic.com/hooks/vibrant", "description": "EHR integration (sandbox)"}'
```

| Body field | Required | Description |
| :- | :- | :- |
| `url` | Yes | HTTPS URL, at most 2,048 characters. See [URL requirements](#url-requirements). |
| `description` | No | Your label, up to 255 characters. |
| `eventTypes` | No | Default `null`. See [Choose event types](#choose-event-types). |
| `apiVersion` | No | Payload version. Default: the current version, `2026-11-01`. |

The `201 Created` response is the endpoint object plus its signing `secret`. **The secret is never
returned again**; if you lose it, rotate it.

```json Response theme={null}
{
  "id": "whk_01JA6Z0Y5T3K1R8W2N7C4V9B0D",
  "url": "https://ehr.example-clinic.com/hooks/vibrant",
  "description": "EHR integration (sandbox)",
  "eventTypes": null,
  "apiVersion": "2026-11-01",
  "status": "active",
  "disabledReason": null,
  "secrets": [
    { "id": "whsk_01JA6Z0Y8D2M4P6R8T0V2X4Z6B", "fingerprint": "9f2c41ab", "createdAt": "2026-10-01T09:00:00.000Z", "expiresAt": null }
  ],
  "health": { "failureStreak": 0, "lastSuccessAt": null, "lastFailureAt": null, "failingSince": null, "disablesAt": null },
  "createdAt": "2026-10-01T09:00:00.000Z",
  "updatedAt": "2026-10-01T09:00:00.000Z",
  "version": 1,
  "secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx="
}
```

A new endpoint is `active` and receives events for changes from then on. It does not replay
history; see [Load orders already in progress](#load-orders-already-in-progress).

Your account can have at most **10 endpoints**, and each URL can be registered once. Creating the
same URL again returns `409` with `details.existingId`, so a retried create is safe.

### URL requirements

URLs are normalized before they are stored and compared: lower-case host, internationalized names in
punycode, no explicit `:443`, and an empty path becomes `/`. A URL that breaks a rule returns `422
URL_NOT_ALLOWED` with one of these `details.reason` values:

| Rule | `details.reason` |
| :- | :- |
| A well-formed absolute URL without spaces, control characters, or backslashes | `malformed_url` |
| At most 2,048 characters | `url_too_long` |
| Scheme `https` | `scheme_not_https` |
| Port absent or 443 | `port_not_443` |
| No user name or password in the URL | `userinfo_not_allowed` |
| No fragment (`#…`) | `fragment_not_allowed` |
| The host is a DNS name, not an IP address | `ip_literal_not_allowed` |
| A valid DNS name with at least one dot, at most 253 characters | `invalid_host` |
| Not a reserved or internal name (for example `localhost`, `*.local`, `*.internal`, `*.test`, `*.example`) and not a Vibrant domain | `host_not_allowed` |
| The host resolves in DNS | `host_not_found`, `dns_resolution_failed` |
| The host has at least one public IPv4 address (IPv6-only hosts are not supported yet) | `ipv6_only_not_supported` |
| Every resolved IPv4 address is public | `resolves_to_blocked_address` |

Query strings are allowed, for example to route requests to a tenant, but they are not secret: the
management API returns the full URL. Never put PHI or credentials in the URL. The address rules are
checked again on every delivery attempt. Your server must present a certificate from a publicly
trusted certificate authority and support TLS 1.2 or later. Redirects are never followed.

### Choose event types

`eventTypes: null` (the default) subscribes to `order.created`, `order.status_changed`, and
`order.access_granted`. To receive fewer, send a non-empty list of those types without duplicates.
`order.access_revoked` and `order.deleted` are always delivered, whatever the filter, so you always
learn when to stop showing an order.

### Update, disable, or delete an endpoint

`PATCH /v1/webhooks/{webhookId}` takes only the fields to change: `url` (the signing secret is
kept), `description`, `eventTypes`, `apiVersion`, or `status`. `status: "disabled"` pauses
deliveries; `status: "active"` re-enables a disabled endpoint and resets its health.

`GET` returns an `ETag` with the endpoint's `version`. Send it as `If-Match` on `PATCH` or `DELETE`
to avoid overwriting a concurrent change; a mismatch returns `412` with `details.currentVersion`.
Status and health changes made by Vibrant, and secret rotations, do not change the version.

`DELETE /v1/webhooks/{webhookId}` returns `204`. Its signing secrets are destroyed immediately,
waiting deliveries are canceled, and its delivery log is no longer available.

### Rotate the signing secret

`POST /v1/webhooks/{webhookId}/rotate-secret` creates a new current secret and returns it **once**.
The previous secret stays valid for an overlap period, set with `previousSecretExpiresInSeconds`
(0 to 604,800; default 86,400, or 24 hours; `0` revokes it at once). During the overlap, every event
carries two signatures, new first.

```json Response theme={null}
{
  "secret": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=",
  "secretId": "whsk_01JB2C4E6G8J0K2M4N6P8Q0R2S",
  "previousSecretExpiresAt": "2026-10-14T09:00:00.000Z"
}
```

The endpoint's `secrets` array lists each valid secret's `fingerprint`: the first 8 hex digits of
the SHA-256 of the decoded key. Use it to check which secret your verifier holds.

### Monitor endpoint health

| `status` | Meaning |
| :- | :- |
| `active` | Healthy; deliveries flow normally. |
| `failing` | Recent attempts failed. Deliveries continue, one request at a time. Any `2xx` makes it `active` again. |
| `disabled` | Paused. Nothing is sent except test events. New events are held and keep their 72-hour retry window. |

A failing endpoint is disabled automatically (`disabledReason: "sustained_failure"`) once it has
been failing for 5 days with a failed attempt in the last 24 hours; `health.disablesAt` shows when.
An endpoint that answers `410` is disabled at once (`gone`). Other reasons are `manual` (you disabled
it) and `ops` (Vibrant support; contact us to re-enable). Vibrant does not send email alerts about
endpoint health, so check `status` and `health` with a periodic `GET`.

## Events

### Event types

| Type | Sent when | `data` contains |
| :- | :- | :- |
| `order.created` | An order becomes visible to your clinic for the first time: a new order, a new order for an accession after `order.deleted`, or an existing order assigned to your clinic for the first time. | Status snapshot |
| `order.status_changed` | A notifying status field changed. See [What triggers an event](#what-triggers-an-event). | Snapshot, `changes`, `previous`, `previousSequence` |
| `order.access_granted` | An existing order becomes visible to your clinic, for the first time or again. Insert or update it. | Status snapshot |
| `order.access_revoked` | The order no longer belongs to your clinic. You receive nothing more about it unless it comes back. Always sent. | `accessionId`, `sequence`, `occurredAt` |
| `order.deleted` | The order was removed (`reason: "deleted"`), or its accession was detached from the order or the sample was deleted (`reason: "unlinked"`). Always sent. | `accessionId`, `sequence`, `occurredAt`, `reason` |
| `order.snapshot` | Reply to [resend](#re-send-the-current-state-of-orders); sent only to the endpoint that asked. | Status snapshot, `changes: []` |
| `webhook.test` | Reply to a [test](#send-a-test-event). | `webhookId`, `message` |

Ignore event types you do not recognize.

### Envelope

| Field | Description |
| :- | :- |
| `id` | Event ID: `evt_` plus 26 characters. Equals the `webhook-id` header. |
| `type` | Event type. |
| `apiVersion` | Payload version, for example `2026-11-01`: your endpoint's version. |
| `environment` | `sandbox` or `production`. |
| `timestamp` | When Vibrant created the event. |
| `data` | Depends on the type. |

### Order data

| Field | In | Description |
| :- | :- | :- |
| `accessionId` | All order events | The order's accession ID (string). |
| `sequence` | All order events | Strictly increases per accession across all event types and the whole life of the accession, including deletion and re-creation. An opaque integer that fits in 53 bits; it resembles a millisecond timestamp but is not a time. |
| `occurredAt` | All order events | When the newest change included in the event happened at Vibrant. |
| `changes` | Status events | The notifying fields that changed, in this order: `orderStatus`, `kitStatus`, `reportStatus`, `reports`, `unifiedStatus`, `issues`, then the [report workflow](#report-workflow) reasons `reportComposition` and `reportReady` (coming soon). Empty for `order.created`, `order.access_granted`, and `order.snapshot`; at least one entry for `order.status_changed`. |
| `status` | Status events | The complete current status (below). |
| `previous` | `order.status_changed` | The status block of the preceding status event for this order and your clinic. |
| `previousSequence` | `order.status_changed` | The `sequence` of that preceding event, whether or not you received it. `0` if there was no earlier event; `previous` is then the first state Vibrant observed. |
| `reason` | `order.deleted` | `deleted` or `unlinked`. |
| `simulated` | Sandbox simulations | `true` on events produced by [simulate](#simulate-an-order-in-sandbox); absent otherwise. |

Status events are `order.created`, `order.status_changed`, `order.access_granted`, and
`order.snapshot`. If `previousSequence` differs from the last `sequence` you stored for the
accession, you missed one or more events; `status` is still complete.

### Status block

| Field | Type | Description |
| :- | :- | :- |
| `orderStatus` | string | Order status. |
| `kitStatus` | string | Kit status. |
| `reportStatus` | string | Report status. |
| `reports.total` | integer | Number of reports expected for the order (`0` if not known). |
| `reports.generated` | integer | Number of reports finalized. |
| `reports.viewed` | integer | Number of reports viewed in the provider portal. |
| `unifiedStatus` | string or null | Overall progress of the order, as the provider portal shows it. `null` if not derived yet. |
| `issues` | array of strings | Open [issue codes](#issues), sorted and without duplicates. Empty when there are none, and always empty while the order is canceled. |
| `reportWorkflow` | object, optional | Coming soon: report membership and blocking/access snapshot. See [Report workflow](#report-workflow). |

> [!WARNING]
>
> **These status values are not the values of Get orders or the Report endpoint.** Do not compare
> them across APIs. In particular, `processing` here means the order is in progress, while in Get
> orders it means placement has not completed. Webhooks spell cancellation `canceled`; Get orders
> and the Report endpoint use `cancelled`. Webhook issue codes are not the exception types of Get
> orders either.

## Status values

Every vocabulary can grow. Treat unknown values as valid and fall back to a generic display.
`orderStatus`, `kitStatus`, `reportStatus`, and `unifiedStatus` can also be `unknown`: Vibrant could
not classify the current value. `issues` has no `unknown` code: an issue is either listed or absent.

### orderStatus

| Value | Meaning |
| :- | :- |
| `received` | The order has been received; nothing has started at the lab. |
| `processing` | The order is in progress: kit or sample handling, or testing. |
| `completed` | The order is complete. |
| `redraw_requested` | The lab requested a new specimen. |
| `canceled` | The order was canceled. |
| `unknown` | Could not be classified. |

### kitStatus

| Value | Meaning |
| :- | :- |
| `preparing` | The collection kit is being prepared or waiting for shipment. |
| `shipped_to_patient` | The kit is on its way to the patient. |
| `delivered_to_patient` | The patient has the kit (also used when the office provided the kit). |
| `shipped_to_lab` | The sample is on its way back to the lab. |
| `received_by_lab` | The lab received the sample. After a redraw request a new kit cycle can start, so do not assume it never changes. |
| `delivery_exception` | The carrier reported a delivery problem. |
| `canceled` | The kit shipment was voided. |
| `unknown` | Could not be classified. |

Canceling an order does not change `kitStatus` to `canceled`; the cancellation shows in
`orderStatus` and `unifiedStatus`.

### reportStatus and reports

| Value | Meaning |
| :- | :- |
| `awaiting_sample` | Results cannot start: the lab has not received the sample. |
| `analyzing` | The lab has the sample; results are pending. |
| `available` | Results are available. Viewing a report does not change this value. |
| `amended` | An amended report was issued. |
| `unknown` | Could not be classified. |

The provider portal's "N of M reports available" is `reports.generated` of `reports.total`. Show it
only when `total` is greater than `0`: many orders have available results with `total: 0` because no
report count was recorded. An order has unread reports when `viewed` is less than `generated`.

### unifiedStatus

The single progress value the provider portal shows. Values are lower-case letters and underscores,
and new values can appear without a new API version.

| Value | Meaning |
| :- | :- |
| `awaiting_sample` | The order exists; no kit or sample movement yet. |
| `kit_not_shipped` | A shipping label exists; the kit has not been picked up yet. |
| `kit_provided_by_office` | The kit was provided by the office (in-office collection). Not emitted yet. |
| `kit_in_transit` | The kit is on its way to the patient. |
| `kit_with_patient` | The kit was delivered to the patient. |
| `partially_in_transit` | Some of several return packages are on their way to the lab. Not emitted yet. |
| `sample_in_transit` | The sample is on its way to the lab. |
| `sample_received` | The carrier delivered the sample to the lab; not yet checked in. |
| `analyzing` | The lab checked in the sample and is analyzing it. |
| `awaiting_additional_samples` | The lab is waiting for additional samples. Not emitted yet. |
| `results_partial` | Some, but not all, reports are available. |
| `results_ready` | All reports are available. |
| `redraw_required` | The lab requested a new specimen; the order restarts from the appropriate step. |
| `canceled` | The order was canceled. |
| `unknown` | Could not be classified. |
| `null` | No value has been derived yet (JSON `null`, not a string). |

Handle the values marked "Not emitted yet" now, so no change is needed when they start to appear.

### issues

| Code | Meaning |
| :- | :- |
| `billing` | A billing issue needs attention. |
| `formula_awaiting_approval` | A formula on the order is awaiting approval. |
| `incomplete_questionnaire` | A required questionnaire is incomplete. |
| `lab` | The lab reported an issue with the order or sample. |
| `missing_information` | Required order information is missing. |
| `missing_optional_tube` | An optional tube was not received. |
| `missing_tubes` | Required tubes are missing from the sample. |
| `ny_waiver_form` | A New York waiver form is required. |
| `pediatric_consent_pending` | Pediatric consent is pending. |
| `shipping` | There is a shipping issue. |
| `test_not_performed` | One or more tests could not be performed. |

An issue disappears from the array when it is resolved. While `orderStatus` is `canceled`, `issues`
is always empty. Some issue codes can reveal patient attributes indirectly, which is one more reason
to handle every payload as PHI. To see whether an issue blocks the report, read the issue flags from
[Get orders](https://developers.vibrant-wellness.com/api-reference/orders/status.md) or the [Report endpoint](https://developers.vibrant-wellness.com/api-reference/reports/get.md).

## What triggers an event

An `order.status_changed` is sent when any of these change: `orderStatus`, `kitStatus`,
`reportStatus`, `reports.total`, `reports.generated`, `unifiedStatus`, or the set of `issues` (order
does not matter).

Other changes ride along: they do not trigger an event on their own, but the next event carries
their current values, because every event contains the full status. These include `reports.viewed`
(someone viewed a report) and changes inside Vibrant that do not change any field in the payload.

Several changes made in quick succession may be combined into one event; `changes` then lists every
field that differs from `previous`. Vibrant does not guarantee one event per internal change.

### Report updates

There is no separate report event. When a report is finalized or amended, you receive an
`order.status_changed` with `reportStatus` or `reports` in `changes`.

> [!NOTE]
>
> **WIP — amendment notifications.** Every amendment produces a notification, including another
> amendment of a report that is already `amended`. In that case `reportStatus` and the report counts
> can stay the same; which fields `changes` lists is being confirmed.

The notification does not say which report changed (coming soon:
[`reportWorkflow.reportNames`](#report-workflow) lists the report names). Fetch the accession from the
[Report endpoint](https://developers.vibrant-wellness.com/api-reference/reports/get.md) and replace the results you stored: the endpoint
always returns the latest content of every report under the accession. Handle fetches for the same
accession one at a time, so a slower, earlier fetch cannot overwrite newer results.

A blocking issue can withhold result content even when results are available; see
[Exceptions](https://developers.vibrant-wellness.com/concepts/exceptions.md). The event does not say whether an issue blocks the report. When
an issue is resolved, its code leaves `issues` and you receive an `order.status_changed` with
`issues` in `changes`: if your last fetch came back withheld, fetch the report again. Coming soon:
a separate [`reportReady`](#report-workflow) reason once all report-blocking issues are resolved and
results are accessible.

### Report workflow

> [!NOTE]
>
> **WIP — coming soon.** The `reportComposition` and `reportReady` reasons and the `reportWorkflow`
> object are not delivered yet, and their shape may change.

Two more reasons can appear in `changes` of `order.status_changed`. There is no new event type and
no new subscription, and `apiVersion` stays `2026-11-01`. Ignore `changes` values you do not
recognize.

| Reason | Sent when |
| :- | :- |
| `reportComposition` | The set of reports in the order changes, including when one report replaces another and `reports.total` and `reports.generated` stay the same. A change of order alone does not count. |
| `reportReady` | All report-blocking issues that were open have been resolved, and results have become accessible, including at least one finalized report. Not every report needs to be generated. It can be sent even when the report status, counts, and content stay the same. |

Issue notifications stay independent: resolving only some blocking issues can still notify through
`issues`, and one event can carry both `issues` and `reportReady`.

When available, `status.reportWorkflow`, and `previous.reportWorkflow` where available, carry:

| Field | Type | Description |
| :- | :- | :- |
| `reportNames` | array of strings | The reports in the order, by the full report names that the [Report endpoint](https://developers.vibrant-wellness.com/api-reference/reports/get.md) returns. Compare as a set: order and duplicates alone mean nothing. |
| `blockingIssueCount` | integer | Report-blocking issues open in the observed report snapshot; `0` means none remain. |
| `resultsAccessible` | boolean | Whether accessible results, including at least one finalized report, were observed for this snapshot. |
| `compositionGeneration` | integer | A counter that increases with each observed change in the set of reports. |
| `readyGeneration` | integer | A counter that increases with each observed move from blocked to accessible results. A new `reportReady` requires it to increase, with `blockingIssueCount: 0` and `resultsAccessible: true`. |

* `reportWorkflow` can be absent. Its absence does not mean that there are no reports or no blocking
  issues.
* The two counters are not content versions and are independent of `sequence`. Compare them with the
  last snapshot you applied to catch changes that were combined into one event. A later event can
  carry the same counters even if its `changes` lists only order or issue fields.
* The first snapshot for an order sets a baseline; it does not report a past change.
* `reports` and `reportComposition` can arrive in one event or in two. Do not require both in the
  same event.
* Keep fetching current results, PDFs, and issues from the Report endpoint. Amendments are notified
  as described in [Report updates](#report-updates), not through these reasons.

| Change | `reportComposition`? |
| :- | :- |
| Reports A, B, C → C, B, D: D replaces A, counts unchanged | Yes |
| Reports A, B, C → C, B, A: order only | No |
| Reports A, B, C → A, B, C, D: D added, `total` increases | Yes, alongside `reports` (in the same event or a separate one) |

| Change in report-blocking issues | `reportReady`? |
| :- | :- |
| 2 → 1 | No; blocking issues remain. |
| 1 → 0, results not yet accessible | No; access has not been restored. |
| 1 → 0, results accessible | Yes, even if the report status and counts are unchanged. |
| Only non-blocking issues change | No; issue notifications stay independent. |

The examples below show only the relevant fields. Other status fields are omitted, and so are the
other `reportWorkflow` fields in the first two examples: when `reportWorkflow` is present, it
carries all five fields.

```json One report replaced, counts unchanged theme={null}
{
  "type": "order.status_changed",
  "data": {
    "changes": ["reportComposition"],
    "previous": {
      "reports": { "total": 3, "generated": 2, "viewed": 0 },
      "reportWorkflow": { "reportNames": ["Gut Zoomer 5.0", "Organic Acids", "Wheat Zoomer"] }
    },
    "status": {
      "reports": { "total": 3, "generated": 2, "viewed": 0 },
      "reportWorkflow": { "reportNames": ["Food Sensitivity", "Organic Acids", "Wheat Zoomer"] }
    }
  }
}
```

```json One report added theme={null}
{
  "type": "order.status_changed",
  "data": {
    "changes": ["reports", "reportComposition"],
    "previous": {
      "reports": { "total": 3, "generated": 2, "viewed": 0 },
      "reportWorkflow": { "reportNames": ["Gut Zoomer 5.0", "Organic Acids", "Wheat Zoomer"] }
    },
    "status": {
      "reports": { "total": 4, "generated": 2, "viewed": 0 },
      "reportWorkflow": { "reportNames": ["Food Sensitivity", "Gut Zoomer 5.0", "Organic Acids", "Wheat Zoomer"] }
    }
  }
}
```

```json Access restored after blocking issues resolve theme={null}
{
  "type": "order.status_changed",
  "data": {
    "changes": ["reportReady"],
    "previous": {
      "reports": { "total": 3, "generated": 2, "viewed": 0 },
      "reportWorkflow": {
        "reportNames": ["Gut Zoomer 5.0", "Organic Acids", "Wheat Zoomer"],
        "blockingIssueCount": 1,
        "resultsAccessible": false,
        "compositionGeneration": 10,
        "readyGeneration": 7
      }
    },
    "status": {
      "reports": { "total": 3, "generated": 2, "viewed": 0 },
      "reportWorkflow": {
        "reportNames": ["Gut Zoomer 5.0", "Organic Acids", "Wheat Zoomer"],
        "blockingIssueCount": 0,
        "resultsAccessible": true,
        "compositionGeneration": 10,
        "readyGeneration": 8
      }
    }
  }
}
```

### Cancellation

A cancellation arrives as `order.status_changed` with `orderStatus: "canceled"` and
`unifiedStatus: "canceled"`.

### Examples

These payloads are pretty-printed for reading. On the wire, the body is compact JSON without spaces
or a trailing newline, so always verify the signature on the exact bytes you received. The examples
illustrate production events; [simulated](#simulate-an-order-in-sandbox) sandbox events can carry
different values, for example `orderStatus: "received"` when the kit ships.

```json order.status_changed (kit shipped to the patient) theme={null}
{
  "id": "evt_01JA8Z6X1Q4M0V5T2R7S9K3B8C",
  "type": "order.status_changed",
  "apiVersion": "2026-11-01",
  "environment": "production",
  "timestamp": "2026-10-12T17:03:14.512Z",
  "data": {
    "accessionId": "2508088888",
    "sequence": 1791824594512,
    "previousSequence": 1791813603981,
    "occurredAt": "2026-10-12T17:03:11.123Z",
    "changes": ["orderStatus", "kitStatus", "unifiedStatus"],
    "status": {
      "orderStatus": "processing",
      "kitStatus": "shipped_to_patient",
      "reportStatus": "awaiting_sample",
      "reports": { "total": 0, "generated": 0, "viewed": 0 },
      "unifiedStatus": "kit_in_transit",
      "issues": []
    },
    "previous": {
      "orderStatus": "received",
      "kitStatus": "preparing",
      "reportStatus": "awaiting_sample",
      "reports": { "total": 0, "generated": 0, "viewed": 0 },
      "unifiedStatus": "awaiting_sample",
      "issues": []
    }
  }
}
```

```json order.status_changed (1 of 3 reports available) theme={null}
{
  "id": "evt_01JA7QB9M0P4Z6C2X8V1N3K5RT",
  "type": "order.status_changed",
  "apiVersion": "2026-11-01",
  "environment": "production",
  "timestamp": "2026-10-14T21:10:07.120Z",
  "data": {
    "accessionId": "2508088888",
    "sequence": 1792012207120,
    "previousSequence": 1792004000017,
    "occurredAt": "2026-10-14T21:10:03.877Z",
    "changes": ["reportStatus", "reports", "unifiedStatus"],
    "status": {
      "orderStatus": "processing",
      "kitStatus": "received_by_lab",
      "reportStatus": "available",
      "reports": { "total": 3, "generated": 1, "viewed": 0 },
      "unifiedStatus": "results_partial",
      "issues": []
    },
    "previous": {
      "orderStatus": "processing",
      "kitStatus": "received_by_lab",
      "reportStatus": "analyzing",
      "reports": { "total": 3, "generated": 0, "viewed": 0 },
      "unifiedStatus": "analyzing",
      "issues": []
    }
  }
}
```

```json order.status_changed (order canceled) theme={null}
{
  "id": "evt_01JA7QF3D5H8K2M4N6P8R0S2T4",
  "type": "order.status_changed",
  "apiVersion": "2026-11-01",
  "environment": "production",
  "timestamp": "2026-10-15T09:30:00.250Z",
  "data": {
    "accessionId": "2508088888",
    "sequence": 1792056600250,
    "previousSequence": 1792012207120,
    "occurredAt": "2026-10-15T09:29:57.004Z",
    "changes": ["orderStatus", "unifiedStatus", "issues"],
    "status": {
      "orderStatus": "canceled",
      "kitStatus": "received_by_lab",
      "reportStatus": "analyzing",
      "reports": { "total": 3, "generated": 0, "viewed": 0 },
      "unifiedStatus": "canceled",
      "issues": []
    },
    "previous": {
      "orderStatus": "processing",
      "kitStatus": "received_by_lab",
      "reportStatus": "analyzing",
      "reports": { "total": 3, "generated": 0, "viewed": 0 },
      "unifiedStatus": "analyzing",
      "issues": ["billing"]
    }
  }
}
```

```json order.created theme={null}
{
  "id": "evt_01JA7Q2C1V3W0D7N8J5K9P4XTE",
  "type": "order.created",
  "apiVersion": "2026-11-01",
  "environment": "production",
  "timestamp": "2026-10-12T14:00:03.981Z",
  "data": {
    "accessionId": "2508088888",
    "sequence": 1791813603981,
    "occurredAt": "2026-10-12T14:00:00.512Z",
    "changes": [],
    "status": {
      "orderStatus": "received",
      "kitStatus": "preparing",
      "reportStatus": "awaiting_sample",
      "reports": { "total": 0, "generated": 0, "viewed": 0 },
      "unifiedStatus": "awaiting_sample",
      "issues": []
    }
  }
}
```

```json order.access_revoked theme={null}
{
  "id": "evt_01JA7QK6E2W9C3T1B8M0R5Z7YC",
  "type": "order.access_revoked",
  "apiVersion": "2026-11-01",
  "environment": "production",
  "timestamp": "2026-10-20T17:00:04.001Z",
  "data": {
    "accessionId": "2508088888",
    "sequence": 1792515604001,
    "occurredAt": "2026-10-20T17:00:00.880Z"
  }
}
```

```json order.deleted theme={null}
{
  "id": "evt_01JA7R0M8D4X2V6N1C9T3K7QWB",
  "type": "order.deleted",
  "apiVersion": "2026-11-01",
  "environment": "production",
  "timestamp": "2026-10-21T08:12:44.210Z",
  "data": {
    "accessionId": "2503011234",
    "sequence": 1792570364210,
    "occurredAt": "2026-10-21T08:12:40.511Z",
    "reason": "deleted"
  }
}
```

```json webhook.test theme={null}
{
  "id": "evt_01JA9ZK3T6Q8W2N5V7X4B1C0DE",
  "type": "webhook.test",
  "apiVersion": "2026-11-01",
  "environment": "sandbox",
  "timestamp": "2026-10-11T18:32:31.000Z",
  "data": {
    "webhookId": "whk_01JA9Y0000000000000000TEST",
    "message": "Test event from Vibrant America webhooks."
  }
}
```

Event IDs, accession IDs, times, and sequences differ on every event.

## Receive and verify events

### HTTP request

Each event is an HTTP `POST` to your URL with a JSON body, usually 0.5 to 1.2 KiB and never larger
than 64 KiB. The format follows [Standard Webhooks](https://www.standardwebhooks.com/) v1, so any
official `standardwebhooks` library (Node.js, Python, Go, Java, C#, PHP, Ruby, Rust) can verify it.

| Header | Value |
| :- | :- |
| `content-type` | `application/json` |
| `user-agent` | `VibrantAmerica-Webhooks/1.0 (+https://docs.vibrant-america.com/webhooks)` |
| `webhook-id` | The event ID (`evt_…`), equal to the body's `id`. The same on every retry and redelivery. Use it to deduplicate. |
| `webhook-timestamp` | Unix time in seconds of this attempt. Each retry is signed again with a fresh timestamp. |
| `webhook-signature` | `v1,<base64>`; two space-separated entries during a secret rotation. |

Requests carry no cookies, no `Authorization` header, and no custom headers. They are never
compressed and do not follow redirects. The signature is the authentication: always verify it.

Requests for different orders can arrive concurrently; requests for the same order never do.

### Verify the signature

* **Secret.** `whsec_` followed by the base64 encoding of 32 random bytes. The HMAC key is the
  base64-decoded part after `whsec_`, not the string itself.
* **Signed content.** `{webhook-id}.{webhook-timestamp}.{raw body}`: the two header values and the
  exact body bytes, joined with full stops.
* **Signature.** `v1,` followed by `base64(HMAC-SHA256(key, signed content))`.
* **Header.** `webhook-signature` holds one or more space-separated entries. Accept the request if
  any `v1` entry matches; ignore entries with other version prefixes.
* **Timestamp.** Reject the request if `webhook-timestamp` is more than 5 minutes (300 seconds) away
  from your clock, in either direction. Keep your server clock synchronized.

Verify against the raw request body before parsing it: re-serialized JSON will not match. Compare
signatures in constant time.

```python Python theme={null}
import base64, hashlib, hmac, time

def verify(secret: str, headers: dict, raw_body: bytes) -> None:
    key = base64.b64decode(secret.removeprefix("whsec_"))
    msg_id, ts = headers["webhook-id"], headers["webhook-timestamp"]
    if abs(time.time() - int(ts)) > 300:
        raise ValueError("timestamp outside tolerance")
    signed = f"{msg_id}.{ts}.".encode() + raw_body
    expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
    for entry in headers["webhook-signature"].split(" "):
        version, _, signature = entry.partition(",")
        if version == "v1" and hmac.compare_digest(signature, expected):
            return
    raise ValueError("no matching signature")
```

#### Test vector

Use this vector in a unit test of your verifier. With these inputs, your code must compute exactly
this signature. Evaluate the timestamp check at time `1791743551`, or skip it in the test.

| Input | Value |
| :- | :- |
| Secret | `whsec_dmlicmFudC13ZWJob29rcy10ZXN0LXZlY3Rvci1rMDE=` (key: the 32 ASCII bytes `vibrant-webhooks-test-vector-k01`; fingerprint `2b76f8ce`) |
| `webhook-id` | `evt_01JA9ZK3T6Q8W2N5V7X4B1C0DE` |
| `webhook-timestamp` | `1791743551` (2026-10-11T18:32:31Z) |
| Body | The 258 bytes below, with no trailing newline |
| `webhook-signature` | `v1,asCCJ+oojStj/w9Kaa+P6H6UCEMaRbEkQJv4IHLWTMc=` |

```json theme={null}
{"id":"evt_01JA9ZK3T6Q8W2N5V7X4B1C0DE","type":"webhook.test","apiVersion":"2026-11-01","environment":"sandbox","timestamp":"2026-10-11T18:32:31.000Z","data":{"webhookId":"whk_01JA9Y0000000000000000TEST","message":"Test event from Vibrant America webhooks."}}
```

During a rotation, with `whsec_dmlicmFudC13ZWJob29rcy10ZXN0LXZlY3Rvci1rMDI=` as the new current
secret, the header is `v1,f3CcXQrq/Eh3a+9mNt/qGl+5lIWdIWV4ClK+Ixangag= v1,asCCJ+oojStj/w9Kaa+P6H6UCEMaRbEkQJv4IHLWTMc=`,
and a receiver holding either secret accepts it. Also test that a body changed by a single byte, and
a timestamp more than 300 seconds away, are rejected.

### Respond and retry

Answer `2xx` after you have verified the request and reliably saved or queued the event. The
response body is ignored. Run your business logic, including report retrieval, asynchronously.

Each attempt is limited to 5 seconds to connect, 5 seconds for the TLS handshake, 10 seconds for
response headers after the request is sent, and 15 seconds in total.

| Your response | What Vibrant does |
| :- | :- |
| Any `2xx` | Delivered. A failing endpoint becomes active again. |
| `410 Gone` | Stops the delivery and disables the endpoint at once. Use it only to say "never send here again". |
| `429 Too Many Requests` | Retried. The whole endpoint is paused for `Retry-After` (at most 1 hour; 30 seconds if absent). Not counted as a failure. |
| `503 Service Unavailable` | Retried. If `Retry-After` is present, the endpoint is paused for it (at most 1 hour). Counted as a failure. |
| `3xx` | Retried. Redirects are never followed: register the final URL. |
| Any other status | Retried. |
| Timeout, connection, DNS, or TLS error | Retried. |

Automatic deliveries are retried for up to **72 hours** after the event was created, with up to
18 attempts. Each delay counts from the end of the previous attempt and varies by ±20%, but never
exceeds 6 hours:

| Attempt | Delay after the previous failure | Nominal time since the first attempt |
| :- | :- | :- |
| 1 | — | 0:00:00 |
| 2 | 30 seconds | 0:00:30 |
| 3 | 2 minutes | 0:02:30 |
| 4 | 10 minutes | 0:12:30 |
| 5 | 30 minutes | 0:42:30 |
| 6 | 1 hour | 1:42:30 |
| 7 | 2 hours | 3:42:30 |
| 8 | 4 hours | 7:42:30 |
| 9 to 18 | 6 hours each | 13:42:30, 19:42:30, … 67:42:30 |

When the attempts are used up, or the next attempt would fall after the 72-hour window, the
delivery ends as failed with outcome `expired`. Use [recover](#recover-after-an-outage) (within
7 days) or [resend](#re-send-the-current-state-of-orders) to fill the gap. Simulated deliveries are
retried for 24 hours; test events get a single attempt.

### Delivery guarantees

* **At least once.** An event can arrive more than once. `webhook-id` is identical on every retry
  and redelivery, and across your endpoints; deduplicate on it.
* **Order.** Automatic deliveries for one order to one endpoint are made one at a time, and an older
  event is never sent after a newer one has been sent. There is no ordering across orders.
  Redeliveries and recovered events repeat older events and can arrive late: discard an event whose
  `sequence` is lower than the last one you stored for the accession.
* **Superseded.** If a newer event for the same order is created while an older one is still waiting
  for its next attempt, only the newer one is delivered. No information is lost, because every
  status event carries the complete status.
* **Ownership.** You only receive events for orders that currently belong to your clinic.

## Recover missed events

### Delivery log

Every delivery, with all its attempts, is kept for **30 days**.

* `GET …/deliveries` lists deliveries newest first. Filter by `status`, `eventType`, `kind`
  (`event`, `redelivery`, `test`, `simulated`), and `createdFrom` / `createdTo` (a window of at most
  30 days; default the last 7 days).
* `POST …/deliveries/search` with `{"accessionId": "2508088888"}` lists the deliveries of one order.
* `GET …/deliveries/{deliveryId}` returns one delivery with its `attempts` (`at`, `durationMs`,
  `statusCode`, `error`) and the exact `payload` sent.

A delivery's `status` is `pending`, `sending`, `delivered`, `failed`, `superseded`, or `canceled`.
A delivery that ended without success has an `outcome`: `expired`, `gone`, `single_attempt`,
`access_revoked` / `not_routed`, `deleted`, or `endpoint_deleted`. Attempt `error` values are
`timeout`, `dns`, `connect`, `tls`, `blocked_destination`, `redirect`, `http`, and `lease_expired`
(the result could not be confirmed in time, so the delivery is retried and may arrive twice). Your
endpoint's response bodies and headers are never stored.

### Redeliver a delivery

`POST …/deliveries/{deliveryId}/redeliver` sends the same event again, with the same `eventId` and
exactly the same bytes: immediately, then after about 30 seconds and 2 minutes if needed. It works
for deliveries that are `delivered`, `failed`, or `superseded`, within the 30-day retention.
`409 NOT_REDELIVERABLE` gives a `details.reason`: `access_changed`, `in_progress`,
`superseded_by_newer`, or `original_unavailable` (use resend instead).

### Recover after an outage

`POST …/recover` with `since` (within the last 7 days) and optional `until` re-queues events your
endpoint never received because their 72-hour window ran out. For each order whose newest delivery
in the window ended `expired`, one redelivery is queued on the automatic retry schedule with a new
72-hour window. At most 1,000 orders are re-queued per call; if the response has `truncated: true`,
call again with the same `since` and `until`.

```json Response theme={null}
{ "requeued": 37, "truncated": false }
```

### Re-send the current state of orders

`POST …/resend` with up to 50 `accessionIds` sends each order's current status to this endpoint
only, as an `order.snapshot`, whatever its `eventTypes`. If the order changed since its last event,
an `order.status_changed` is sent instead, to every subscribed endpoint. An accession that is
unknown, belongs to another clinic, or has no order returns `not_found`; the three cases are
deliberately indistinguishable.

```bash theme={null}
curl -X POST https://api-sandbox.vibrant-america.com/v1/webhooks/whk_01JA6Z0Y5T3K1R8W2N7C4V9B0D/resend \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"accessionIds": ["2508088888", "2503011234"]}'
```

```json Response theme={null}
{
  "items": [
    { "accessionId": "2508088888", "result": "queued" },
    { "accessionId": "2503011234", "result": "not_found" }
  ]
}
```

### Load orders already in progress

Creating an endpoint does not replay history. At go-live, take your open orders from the
[order list](https://developers.vibrant-wellness.com/api-reference/orders/status.md#list-orders) and resend their `accessionId`s to receive
their current state.

## Test your integration

### Send a test event

`POST …/test` sends one signed `webhook.test` event to the endpoint. It makes one attempt, works on
disabled endpoints, and never changes the endpoint's health. The response is `200` with `status`,
`statusCode`, and `durationMs` if the attempt finished within 10 seconds, or `202` with `status:
"pending"` otherwise; read the outcome from the delivery log.

### Simulate an order in sandbox

`POST …/simulate` plays a scripted order lifecycle to this endpoint only, through the same status
logic as real orders. Each run creates a new simulated accession: `SIM` followed by 10 digits.
Simulated events carry `data.simulated: true`, and their deliveries have `kind: "simulated"`.
A simulated accession exists only in these events: Get orders and the Report endpoint do not
return it. To move an order you placed yourself and query it, use the
[order simulator](https://developers.vibrant-wellness.com/platform/sandbox-simulator.md) (coming soon).

| Body field | Required | Description |
| :- | :- | :- |
| `scenario` | Yes | A scenario from the table below. |
| `stepIntervalSeconds` | No | Seconds between events, 5 to 60. Default 10. |

| `scenario` | Events you receive |
| :- | :- |
| `kit_to_results` | `order.created` → kit shipped (`kit_in_transit`) → kit delivered (`kit_with_patient`) → sample shipped (`sample_in_transit`) → lab receipt (`sample_received`) → `analyzing` → 1 of 3 reports (`results_partial`) → 3 of 3 (`results_ready`). A final step only marks the reports as viewed and sends no event, to show ride-along fields. 8 events. |
| `in_office_to_results` | `order.created` with the kit already with the patient → lab receipt → `analyzing` → `results_ready`. 4 events. |
| `redraw` | Created → kit shipped → lab receipt → partial results → `redraw_requested` (`redraw_required`) → new kit shipped → sample shipped → analyzing → `results_ready`. 9 events. |
| `cancel` | Created → kit shipped with a `shipping` issue → canceled (issues emptied). 3 events. |
| `issues` | Created → `billing` raised → `missing_tubes` raised → both resolved. 4 events. |
| `transfer_out` | Created → processing → `order.access_revoked`. 3 events. |
| `delete_and_recreate` | Created → kit shipped → `order.deleted` → `order.created` → kit shipped. The status starts over while `sequence` keeps increasing. 5 events. |

To run one, create an endpoint in sandbox, then call `simulate` with its `webhookId` and a
scenario. The events arrive at that endpoint only, and appear in its
[delivery log](#delivery-log) with `kind: "simulated"`.

```bash theme={null}
curl -X POST https://api-sandbox.vibrant-america.com/v1/webhooks/whk_01JA6Z0Y5T3K1R8W2N7C4V9B0D/simulate \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scenario": "issues", "stepIntervalSeconds": 5}'
```

```json Response theme={null}
{
  "accessionId": "SIM2610120001",
  "events": [
    { "eventId": "evt_01JA9S0Z8Y7X6W5V4T3S2R1Q0P", "type": "order.created", "scheduledAt": "2026-10-12T18:00:00.000Z" },
    { "eventId": "evt_01JA9S1M0A2B3C4D5E6F7G8H9J", "type": "order.status_changed", "scheduledAt": "2026-10-12T18:00:05.000Z" },
    { "eventId": "evt_01JA9S2N1B3C4D5E6F7G8H9J0K", "type": "order.status_changed", "scheduledAt": "2026-10-12T18:00:10.000Z" },
    { "eventId": "evt_01JA9S3P2C4D5E6F7G8H9J0K1M", "type": "order.status_changed", "scheduledAt": "2026-10-12T18:00:15.000Z" }
  ]
}
```

The `202` response lists the simulated `accessionId` and each scheduled event's `eventId`, `type`,
and `scheduledAt`. The first event is due immediately. You can run 10 simulations per hour, with
at most 20 simulated orders in progress. `simulate` returns `404` in production.

### Before you go live

* Your verifier passes the [test vector](#test-vector) and rejects a changed body and a stale
  timestamp.
* A duplicate delivery is ignored (`webhook-id`), and an event with a lower `sequence` than the one
  you stored does not overwrite newer state.
* A report notification leads to a fetch from the Report endpoint that replaces the stored results.
* Your receiver ignores `changes` values it does not recognize and works when `reportWorkflow` is
  absent.
* An event that changes only `issues` (`issues`), a canceled order (`cancel`), an order that leaves
  your clinic (`transfer_out`), and a deleted and re-created accession (`delete_and_recreate`) are
  handled.
* A failed delivery (`500` or a timeout) is retried, and your endpoint recovers when it answers
  `2xx` again.

## Rate limits

Limits apply per account, and per endpoint where noted. Responses carry `X-RateLimit-Limit`,
`X-RateLimit-Remaining`, and `X-RateLimit-Reset`; a `429` adds `Retry-After` (seconds). The token
endpoint allows 10 requests per minute per client, so cache the token for its whole lifetime.

| Class | Operations | Limit | Burst |
| :- | :- | :- | :- |
| read | `GET` operations and `deliveries/search` | 120 per minute | 30 |
| write | Create, update, delete, rotate secret | 30 per minute | 10 |
| test | `POST …/test` | 10 per hour per endpoint | 3 |
| resend | `POST …/resend` | 500 accession IDs per hour | 100 |
| redeliver | `POST …/redeliver` | 60 per hour | 10 |
| recover | `POST …/recover` | 5 per hour per endpoint | 2 |
| simulate (sandbox) | `POST …/simulate` | 10 per hour; at most 20 simulated orders in progress | 2 |

## Errors

Management API errors use this envelope. `details` is present only when there is something to add.

```json theme={null}
{
  "error": {
    "code": "URL_NOT_ALLOWED",
    "message": "This URL cannot receive webhooks.",
    "requestId": "0192f4a1-6c2e-7b3d-9a51-3e7c0d2b8f14",
    "details": { "reason": "resolves_to_blocked_address" }
  }
}
```

| HTTP | `code` | When | `details` |
| :- | :- | :- | :- |
| 400 | `BAD_REQUEST` | Malformed JSON, an unknown or invalid field, invalid paging or filter values, a repeated query parameter. | `field` |
| 400 | `UNSUPPORTED_PARAMETER` | An unknown query parameter, or `clinicId` / `customerId` in the query or body. | `unsupported` |
| 400 | `UNKNOWN_SCENARIO` | `simulate` with a scenario that does not exist. | `scenarios` |
| 401 | `UNAUTHORIZED` | Missing, malformed, expired, or revoked token, or a token not signed with RS256. | — |
| 403 | `FORBIDDEN` | `client_credentials_required`: a token from a user sign-in flow. `not_enabled`: webhooks are not enabled for your account yet. | `reason` |
| 404 | `NOT_FOUND` | Unknown ID, an ID of another account (indistinguishable on purpose), a delivery older than 30 days, an unknown path, or `simulate` in production. | — |
| 409 | `CONFLICT` | The URL is already registered, or re-enabling an endpoint that Vibrant support disabled. | `existingId` or `reason` |
| 409 | `ENDPOINT_DISABLED` | `resend`, `redeliver`, `recover`, or `simulate` on a disabled endpoint. Re-enable it first. | — |
| 409 | `NOT_REDELIVERABLE` | The delivery cannot be sent again. | `reason` |
| 412 | `PRECONDITION_FAILED` | `If-Match` does not match the endpoint's current version. | `currentVersion` |
| 413 | `PAYLOAD_TOO_LARGE` | Request body larger than 16 KiB. | — |
| 415 | `UNSUPPORTED_MEDIA_TYPE` | Body is not `application/json` or not UTF-8. | — |
| 422 | `URL_NOT_ALLOWED` | The URL breaks a [URL requirement](#url-requirements). | `reason` |
| 422 | `UNSUPPORTED_EVENT_TYPE` | `eventTypes` contains a type that cannot be filtered on. | `field` |
| 422 | `UNSUPPORTED_API_VERSION` | Unknown `apiVersion`. | `supported` |
| 422 | `ENDPOINT_LIMIT_REACHED` | Your account already has 10 endpoints. | `limit` |
| 429 | `RATE_LIMITED` | A rate limit was exceeded, or too many simulations are running. Wait for `Retry-After`. | `class` or `reason` |
| 500 | `INTERNAL_ERROR` | Unexpected error. Retry with backoff; contact support with the `requestId` if it persists. | — |
| 503 | `SERVICE_UNAVAILABLE` | A dependency is temporarily unavailable, or another change to your endpoints is in progress. Retry with backoff. | — |

Every response carries `X-Request-Id`. If you send `X-Request-Id` or `X-Correlation-Id` (up to 128
visible ASCII characters), it is echoed back. Quote it when you contact support.

## Versioning

Payloads are versioned by date. The current version is `2026-11-01`. Each endpoint is pinned to the
version it was created with, shown in `apiVersion` on the endpoint and in every event. When a new
version is released, test it and move your endpoint with `PATCH {"apiVersion": "…"}`.

These changes can happen within a version, without notice: new fields in any object; new values in
any status, issue, or `changes` vocabulary; new event types; and new HTTP headers. Removing or renaming a
field, changing a field's type or meaning, or changing the `sequence` or signature semantics happens
only in a new `apiVersion`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.