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

# Test Webhook V1

> Send a probe POST to verify a webhook URL is reachable. The probe carries the **same envelope shape and headers as a real job.completed delivery** (with a…

Send a probe POST to verify a webhook URL is reachable.

The probe carries the **same envelope shape and headers as a
real `job.completed` delivery** (with a synthetic flat payload
underneath), so the receiver is tested end-to-end before a real
job is queued. Returns delivery status and round-trip latency.

Envelope fields (`event_id`, `event_type`, `event_timestamp`,
`api_version`) are stamped exactly like production deliveries —
tenants writing receivers against this probe see the same shape
they'll see when a real job completes.

### Request body

`WebhookTestRequest`

<ParamField body="url" type="string" required>
  Webhook URL to probe. http or https only.
</ParamField>

<ParamField body="secret" type="string,null">
  Optional shared secret. When set, the probe carries an `X-Webhook-Signature` header signed with the same scheme as production deliveries.
</ParamField>

### Response

`WebhookTestResponse`

<ResponseField name="delivered" type="boolean" required>
  True iff the receiver returned 2xx.
</ResponseField>

<ResponseField name="status_code" type="integer,null">
  HTTP status the receiver returned. None when the request could not complete (network error, timeout).
</ResponseField>

<ResponseField name="duration_ms" type="integer" required>
  Wall-clock time the probe took, in milliseconds.
</ResponseField>

<ResponseField name="error" type="string,null">
  Network / timeout error message when delivery failed.
</ResponseField>

### Status codes

| Code  | Meaning             |
| ----- | ------------------- |
| `200` | Successful Response |
| `422` | Validation Error    |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.computer.stateset.app/api/v1/webhook-test' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "url": "https://example.com/webhooks/stateset",
    "secret": "YOUR_API_KEY"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "delivered": true,
    "status_code": 1,
    "duration_ms": 8,
    "error": "string"
  }
  ```
</ResponseExample>
