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

# Customer events and webhooks

> Publishing contracts, signature verification, delivery guarantees, limits, and endpoint lifecycle.

## Overview

Publish application events to subscribed HTTPS endpoints. Customer webhooks are a limited beta; ask support to enable your organization. They have a separate contract from audit destinations and snapshot callbacks. Start with [Receive customer events](https://docs.useshipd.com/operations/receive-customer-events.md).

## API

Every operation is a JSON POST under `/api/v1/rpc/`. Authenticate with an existing
management API key, service-account token, or dashboard session. Evaluation SDK
keys do not authorize this API. A service-account publisher only needs
`{ "customer_event": ["publish"] }` and can be bound to one project/environment.
Viewer/editor roles can inspect endpoints and deliveries; admin/owner roles can
manage endpoints and publish. Non-user credentials need corresponding explicit
scopes unless they are existing unrestricted management keys. Inspection scopes use
`{ "event_webhook": ["read"] }`; endpoint administration, tests, and redelivery
use `{ "event_webhook": ["manage"] }`. Scope credentials to the intended project
and environment. Successful results are wrapped in `{ "data": ... }`.

| Operation | Body | Result |
| - | - | - |
| `eventWebhook/create` | `environmentId`, `name`, `url`, `eventTypes` | Endpoint and signing secret, returned once |
| `eventWebhook/eventTypes` | `environmentId`, optional `after` | Up to 100 retained non-test types in `items`, with `nextCursor` |
| `eventWebhook/list` | `environmentId` | Active endpoints; no secrets |
| `eventWebhook/update` | `environmentId`, `endpointId`, optional `enabled`, `eventTypes`, `rotateSecret` | Endpoint; new secret only on rotation |
| `eventWebhook/delete` | `environmentId`, `endpointId` | Cancels pending work and soft-deletes endpoint |
| `event/publish` | `environmentId`, `type`, `data` | `202` receipt with `eventId`, `matchedEndpoints`, `acceptedAt` |
| `eventWebhook/test` | `environmentId`, `endpointId` | `202` receipt for a platform test event |
| `eventWebhook/deliveries` | `environmentId`, optional `eventId`, `limit` (1–100, default 50) | Most recent deliveries; no customer payloads |
| `eventWebhook/attempts` | `environmentId`, `deliveryId` | HTTP codes, sanitized errors, timing, attempt numbers |
| `eventWebhook/redeliver` | `environmentId`, `deliveryId` | `202` new delivery for the same event and endpoint |
| `eventWebhook/usage` | `environmentId` | Organization-wide usage and limits; additionally requires billing-read access |

Use exact event names in `eventTypes`, such as `["order.completed"]`, or `["*"]`
to subscribe to all customer events. Event names start with a letter and contain
letters, digits, underscores, periods, or hyphens, up to 120 characters. `data` is
a JSON object. Endpoint URLs must be HTTPS without embedded credentials or
fragments; endpoint URLs cannot be edited currently. Replace an endpoint to
change its URL. DNS/IP checks on every delivery prohibit private networks,
metadata addresses, HTTP, and redirects, independently of audit URL exceptions.

Publish, test, and redelivery require an `Idempotency-Key` header (1–256
characters). Publish keys are scoped to the organization/environment for 24
hours; JSON object key ordering is ignored. Reusing a key with different content
returns `409`. Idempotent retries return the original receipt without consuming
more usage or ingestion capacity. Redelivery keys are scoped to the
environment/redelivery operation and remain valid for the retained delivery's
lifetime. Test keys use a separate namespace. Use a new key for each distinct
operation.

```sh Publishing examples theme={null}
# Create an endpoint. Save the returned signingSecret privately.
curl "$SHIPD_API_URL/api/v1/rpc/eventWebhook/create" \
  -H "Authorization: Bearer $SHIPD_MANAGEMENT_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"environmentId":"env_123","name":"Orders","url":"https://example.com/shipd","eventTypes":["order.completed"]}'

# Publish an event with a stable key for retries of this application operation.
curl "$SHIPD_API_URL/api/v1/rpc/event/publish" \
  -H "Authorization: Bearer $SHIPD_MANAGEMENT_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: order-123-completed' \
  -d '{"environmentId":"env_123","type":"order.completed","data":{"orderId":"ord_123"}}'
```

## Usage and limits

Webhook allowances are separate from pooled SDK requests. New subscriptions receive
these organization-wide hard caps; Pro Annual and Teams Annual receive the same
monthly allowances as their monthly plans.

| Plan | Deliveries/month | Endpoints | Retention | Accepted requests/month | Requests/minute | Reserved storage |
| - | -: | -: | -: | -: | -: | -: |
| Free | 1,000 | 1 | 7 days | 2,000 | 60 | 16 MiB |
| Pro | 10,000 | 5 | 14 days | 20,000 | 300 | 128 MiB |
| Teams | 50,000 | 15 | 30 days | 100,000 | 1,000 | 512 MiB |
| Enterprise default | 100,000 | 100 | 30 days | 200,000 | 1,000 | 1,024 MiB |

Enterprise contracts can override grants. Operational ceilings remain 100 endpoints,
30 days of retention, 1,000 accepted requests per minute, and 1 GiB of reserved storage,
even for unlimited billing grants. Explicit zero grants are enforced; zero retention
prevents new events, tests, and redeliveries.

Existing subscriptions with explicit beta grants retain 1,000 deliveries, one endpoint,
and seven-day retention until migrated. Missing webhook grants fall back to the plan's
allowances above. Your organization's effective usage view shows the applicable limits.
Migration preserves month-to-date reservations and accepted work.

### Environment ingestion rates

Each environment also has a fixed UTC minute limit: **30 accepted requests/minute for
production**, **10 for development**. The `isProduction` mark selects the default;
free-form environment labels do not. The effective cap is the smaller of this value
and your organization's ingestion rate shown above. Environment buckets are independent;
the organization cap still protects total traffic and does not reserve capacity for any environment.

Set `webhookIngestionPerMinute` through `environment/create` or `environment/update`
to override the default with an integer from `0` to `1000`. Set it to `null` to restore
the default; `0` pauses new work in that environment. Existing environment management
permissions apply. Changing the production mark changes the default immediately;
an explicit override remains in effect. Changing a limit does not reset the current bucket.

Publishing, free tests, and manual redeliveries each consume one request from both
minute buckets and monthly ingestion. Automatic delivery retries and idempotent retries
consume no extra capacity. Admission is atomic across API instances: rejection stores
no event or delivery and charges no quota. `429 rate_limited` identifies the organization
or environment cap; `Retry-After` gives whole seconds (rounded up, minimum one) until
the rejected UTC minute ends. Wait before retrying with the same idempotency key.

`eventWebhook/usage` returns the organization cap as `ingestionLimitPerMinute` and the
requested environment's effective cap as `environmentIngestionLimitPerMinute`.
The existing organization webhook rollout gate applies before admission; disabling it
rejects new work without consuming capacity while accepted deliveries continue.

Reserved storage counts each stored UTF-8 envelope plus 1 KiB of event metadata and
8 KiB per logical delivery, including its complete automatic retry budget. This is a
storage allowance unit, not a physical disk measurement. Manual redelivery reserves
another 8 KiB. Events with no subscribers reserve their envelope and metadata too.
Expired records release storage when purged; storage does not reset
at the start of a month. Existing stored work can temporarily exceed a downgraded cap.

Each matching endpoint reserves one delivery unit in the acceptance transaction.
Retries are included, even if an endpoint never succeeds. Manual redelivery
reserves another unit. Platform test events and their redeliveries are free but
share monthly ingestion, ingestion rate, and storage caps. Events with no subscribers are accepted with zero
delivery units and still count against ingestion and reserved-storage limits. Event request bodies
are limited to 64 KiB.

All-or-nothing acceptance rejects a publish if its full fan-out would exceed the
allowance, returning `quota_exceeded` (`403`) with the exhausted allowance in the
message. Rejection stores no event or delivery and charges no usage. Check
`eventWebhook/usage` for `storageBytes`, `storageLimitBytes`, `ingested`, and
`ingestionLimitPerMonth`. Accepted deliveries continue after quota exhaustion or a downgrade.
Monthly delivery and ingestion counters reset at 00:00 UTC on the first day of each
calendar month, including annual subscriptions. Reservations survive event expiry and
endpoint deletion. If a downgrade leaves more endpoints than allowed, remove excess
endpoints before publishing, testing, or requesting new redeliveries. Existing endpoints
are not automatically disabled or deleted, and accepted work keeps its original expiry.
Idempotent retries of accepted requests still return their original receipt at the cap.
Paid webhook overage is not available; SDK additional-usage settings never authorize it.
New work refreshes your billing grants before admission. If billing cannot be reached,
new endpoint creation, publishing, tests, and manual redelivery return `503` until it
recovers. Reads and already accepted deliveries continue. A downgrade applies to
requests that observe the new active grant; work already being accepted can finish
under the grant it read. Check your organization's effective limits before rollout.

## Delivery and receiver verification

The immutable JSON envelope contains `id`, `specVersion: "1"`, `type`,
`organizationId`, `projectId`, `environmentId`, `acceptedAt`, `test`, and `data`.
Subscription matching happens once at acceptance. Later subscription edits only
affect future events. Test events have type `shipd.webhook.test`, `test: true`,
and are sent only to the selected enabled endpoint.

Delivery headers:

* `x-shipd-event-id`: stable across retries and manual redelivery.
* `x-shipd-delivery-id`: stable across automatic retries; new on manual redelivery.
* `x-shipd-timestamp`: Unix seconds, refreshed for each attempt.
* `x-shipd-signature`: `sha256=<hex>` HMAC-SHA256 of `timestamp.eventId.rawBody`.
* `x-shipd-signature-previous`: the same signature using the previous secret,
  supplied during a 24-hour rotation overlap.

Verify against the exact raw request bytes before parsing JSON. Reject timestamps
outside a five-minute tolerance, compare signature bytes in constant time, and
deduplicate processing using the event ID. Persist or enqueue the event before
acknowledging a `2xx` response. At-least-once delivery can produce duplicates;
ordering is not guaranteed. A successful webhook response records delivery, not
completion of the receiver's business workflow.

A rotation returns the new secret once. Receivers using the old secret can verify
the previous-signature header during the overlap while updating their stored
secret. Another rotation is rejected until the overlap ends. Never put signing
secrets or full customer payloads in logs.

Each endpoint has one leased in-flight delivery across workers. Attempts time
out after ten seconds. Network failures, `429`, and `5xx` retry with jitter around
5 seconds, 30 seconds, 2 minutes, 10 minutes, 30 minutes, 1 hour, and 2 hours.
There are at most eight claimed attempts, including attempts interrupted by a
worker crash. Other non-`2xx` HTTP statuses fail immediately. A dead worker's
30-second lease can be reclaimed; stale completions cannot overwrite a later
claim. Crash-interrupted attempts may have no HTTP result in attempt history.

Disabling an endpoint pauses queued work; re-enabling resumes retained work.
Deleting an endpoint cancels queued work. Already in-flight requests can finish
at the remote receiver. Archived projects/environments are not delivered until
restored. Pending work remains reserved while paused. Project transfer removes webhook endpoints and
customer event payloads before changing ownership; source usage stays charged.
Customers must configure new endpoints in the destination organization.

Expired event payloads and their delivery/attempt history are purged hourly by
the webhook worker once every delivery has completed, failed, or been cancelled.
Pending deliveries keep their payload past expiry and remain eligible for retries;
paused work can therefore fill the storage allowance and block new admission.
Resume or delete the endpoint to resolve paused work. Cleanup never evicts pending
work to make room. Changing retention affects new events only currently.

## Rollout availability

When customer webhooks are disabled for your organization, endpoint creation, publishing, tests, and manual redelivery return `403` without accepting work or reserving usage. Endpoint and delivery reads, attempt inspection, usage, endpoint updates, and deletion remain available under normal permissions. Previously accepted deliveries continue, and retention still applies. A hidden dashboard navigation entry does not mean existing deliveries stopped.

## Export delivery logs

Enterprise organizations can download retained delivery logs from **Webhooks** →
**Delivery history** → **Export logs** for the selected environment. The JSON file
includes delivery and event IDs, endpoint IDs, event types, test markers, statuses,
timestamps, and completed attempt results (HTTP status, error, and duration).
Payloads and signing secrets are excluded. You need `eventWebhook.read` access.

The typed management client exposes `eventWebhook.export({ environmentId, limit?,
cursor? })`. Each response contains `items` and `nextCursor`; pass `nextCursor`
unchanged as `cursor` until it is `null`. Pages default to 500 deliveries and allow
up to 1,000. Each exported page creates an audit event.

Pagination excludes deliveries created after the first page's cutoff. Statuses and
attempts reflect each page's read time; this is not a single database snapshot
across pages. Expired events are excluded and normal retention continues during
export. Export remains available when webhook publishing is disabled.


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