---
title: "Create a test sink"
method: POST
path: "/v1/test-sinks"
---

# Create a test sink

`POST /v1/test-sinks`

## Request

- Base URL: `https://docs.greatwait.dev` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.greatwait.dev/v1/test-sinks`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer and API key in header `Greatwait-Environment` and API key in header `Greatwait-Project`

Creates a deterministic receiver for one callback endpoint so failures can be rehearsed before they happen in production. Test environments only: a live principal has no such operation, and there is no request field that could widen the organization, project, or environment the sink belongs to. The sink verifies deliveries with the bound endpoint's own signing keys, so key rotation and a wrong key behave here exactly as they would at the customer's receiver. It receives and never sends: no field names a destination and no configuration makes it forward a delivery. Point the endpoint at the returned url, and every attempt lands here.

## Request body

- object
  - `endpoint` string, required
  - `program` object
    - `behavior` 'client_error' | 'defer_abandon' | 'defer_fail' | 'defer_succeed' | 'delay' | 'disconnect' | 'duplicate' | 'invalid_signature' | 'rate_limited' | 'server_error' | 'success' | 'timeout', required
    - `completionDelayMs` integer
    - `delayMs` integer
    - `forDeliveries` integer
    - `retryAfterSeconds` integer
    - `status` integer
    - `then` 'client_error' | 'defer_abandon' | 'defer_fail' | 'defer_succeed' | 'delay' | 'disconnect' | 'duplicate' | 'invalid_signature' | 'rate_limited' | 'server_error' | 'success' | 'timeout'

## Response `201`

Create a test sink

- object
  - `createdAt` string, required
  - `deliveryCount` integer, required
  - `endpoint` string, required
  - `environmentKind` 'test', required
  - `id` string, required
  - `program` object, required
    - `behavior` 'client_error' | 'defer_abandon' | 'defer_fail' | 'defer_succeed' | 'delay' | 'disconnect' | 'duplicate' | 'invalid_signature' | 'rate_limited' | 'server_error' | 'success' | 'timeout', required
    - `completionDelayMs` integer
    - `delayMs` integer
    - `forDeliveries` integer
    - `retryAfterSeconds` integer
    - `status` integer
    - `then` 'client_error' | 'defer_abandon' | 'defer_fail' | 'defer_succeed' | 'delay' | 'disconnect' | 'duplicate' | 'invalid_signature' | 'rate_limited' | 'server_error' | 'success' | 'timeout'
  - `project` string, required
  - `updatedAt` string, required
  - `url` string, uri, required

## Other responses

- `400`: Problem document. Possible codes at this status: invalid_request.
- `401`: Problem document. Possible codes at this status: authentication_required, credential_expired, credential_revoked.
- `403`: Problem document. Possible codes at this status: scope_missing.
- `404`: Problem document. Possible codes at this status: not_found.
- `409`: Problem document. Possible codes at this status: plan_limit_reached, project_archived, state_conflict.
- `429`: Problem document. Possible codes at this status: rate_limited.
- `503`: Problem document. Possible codes at this status: capability_not_configured, service_unavailable.

---

[API](https://skmtc.dev/greatwait/apis/greatwait-v1.md) · [All operations](https://skmtc.dev/greatwait/apis/greatwait-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/greatwait/apis/greatwait-v1/revisions/6855bce23e72?raw)
