---
title: "Send a test delivery"
method: POST
path: "/webhook/{webhook}/delivery"
tags: ["webhook"]
---

# Send a test delivery

`POST /webhook/{webhook}/delivery`

## Request

- Base URL: `http://localhost:3030`
- URL: `http://localhost:3030/webhook/{webhook}/delivery`
- Auth: HTTP bearer

Sends a test event to the webhook, even if it is inactive.

The test is attempted once and never retried. Its body has `synthetic: true` and an empty
`data`.

## Path parameters

- `webhook` string, required: The webhook's id, `whk_...`.

## Request body

- DeliveryTest: The test event to send.
  - `event_type` 'permit.created' | 'case.created', required: The event type to send. Need not be one the webhook subscribes to.
  - `synthetic` true: Always `true`. Marks the delivery and its body as a test.

## Response `201`

The webhook delivery.

- Delivery
  - `object` 'webhook_delivery', required: The object's type. Always `webhook_delivery`.
  - `id` string, required: Unique identifier for the object. Also sent as the `webhook-id` header. A delivery can arrive more than once, so deduplicate on it.
  - `seq` integer, required: The delivery's position in the webhook's log. Use as `since`.
  - `event_type` 'permit.created' | 'case.created', required: The event type.
  - `synthetic` boolean, required: Whether this is a test delivery.
  - `subject` string, required: The id of the object the event is about.
  - `body` object, required: The JSON body, as signed.
  - `body_sha256` string, required: The SHA-256 hash of the body, in hex.
  - `state` 'pending' | 'delivered' | 'failed' | 'dead_lettered', required: One of `pending`, `delivered`, `failed` or `dead_lettered`. `failed` has retries remaining.
  - `attempt_count` integer, required: Attempts made so far.
  - `next_attempt_at` string, date-time, nullable, required: Time of the next attempt. Null unless `state` is `pending` or `failed`.
  - `delivered_at` string, date-time, nullable, required: Time at which the delivery succeeded. Null until it does.
  - `dead_lettered_at` string, date-time, nullable, required: Time at which retries stopped. Null unless `state` is `dead_lettered`.
  - `response_status` integer, nullable, required: The last attempt's HTTP status. Null when it got no response.
  - `response_body_head` string, nullable, required: The first kilobyte of the last attempt's response body. Null when it got no response.
  - `error` string, nullable, required: The last attempt's connection error. Null when it got a response.
  - `created_at` string, date-time, required: Time at which the object was created.
  - `attempt` DeliveryAttempt[], nullable, required: Every attempt, oldest first. Only on `GET /webhook/{webhook}/delivery/{delivery}`; null in a list.
    - `attempt` integer, required: The attempt's number, starting at 1.
    - `attempted_at` string, date-time, required: Time at which the attempt was made.
    - `duration_ms` integer, nullable: Time until the response, in milliseconds. Null when there was no response.
    - `timestamp` integer, required: The `webhook-timestamp` header sent.
    - `signature` string, required: The `webhook-signature` header sent.
    - `response_status` integer, nullable: The response's HTTP status. Null when there was no response.
    - `response_body_head` string, nullable: The first kilobyte of the response body. Null when there was no response.
    - `error` string, nullable: The connection error. Null when there was a response.

## Other responses

- `401`: `credential_missing`, `credential_invalid` or `credential_expired`. The request has no valid credential.
- `403`: `scope_missing`, `person_required`, `api_key_not_accepted` or `entitlement_missing`. The credential or plan does not allow this request. `detail` names the reason.
- `404`: `no_such_resource`. No object has that id.
- `422`: `parameter_invalid`, `id_malformed` or a cursor code. A parameter is missing or invalid. `errors` lists each one.
- `429`: `rate_limited`. Too many requests. Retry after the `Retry-After` interval. Nothing is charged.

---

[API](https://skmtc.dev/placestack/apis/placestack-api.md) · [All operations](https://skmtc.dev/placestack/apis/placestack-api/llms.txt) · [OpenAPI document](https://skmtc.dev/placestack/apis/placestack-api/revisions/0ccdf0882668?raw)
