# /webhook/test

Sends a test webhook delivery to verify connectivity and signature verification.
## Purpose
Allows a partner to trigger a test delivery to their configured webhook endpoint. This verifies that the endpoint is reachable, responds within the timeout, and can process the webhook payload correctly.
## When to use
Use this endpoint to:
- Verify initial webhook integration before going live
- Test connectivity after changing the webhook URL
- Debug delivery issues by triggering a controlled delivery
- Verify signature verification logic is working correctly

## What happens next
1. The webhook configuration is validated (must be active with a signing secret)
2. A test event payload is constructed and signed with the current webhook_secret
3. The payload is delivered via HTTP POST to the configured webhook_url
4. The delivery result (status code, response time, any failure) is returned immediately

## Authentication
Requires `x-client-id` and `x-secret-key` headers.
## Notes
- The test delivery uses event_type `webhook.test` which is not a real event
- The test delivery is NOT logged in the delivery history
- The webhook must be active and have a signing secret configured
- Connection timeout: 5 seconds, read timeout: 10 seconds
- Returns the full delivery result synchronously (no retries for test deliveries)

## Common errors
- `400` Webhook is inactive or missing signing secret
- `401` Invalid credentials
- `404` Webhook not found for the given webhook_id
- `500` Internal error during test delivery

Endpoint: POST /webhook/test
Version: 1.0.0

## Header parameters:

  - `x-client-id` (string, required)
    Unique identifier assigned to the integrating client.

Error codes: required=400001, type=400002, minLength=400003, maxLength=400004

  - `x-secret-key` (string, required)
    Secret authentication key associated with the client.

Error codes: required=400001, type=400002, minLength=400003, maxLength=400004

## Request fields (application/json):

  - `webhook_id` (string, required)
    UUID v4 identifier of the webhook to send a test delivery to.
Error codes: required=400001, type=400002

## Response 200 fields (application/json):

  - `status` (string)
    Response status (success)

  - `data` (object)
    Test delivery result

  - `data.test_event_id` (string)
    UUID v4 identifier for the test event

  - `data.delivery_status` (string)
    Delivery result: success or failed

  - `data.http_status_code` (number)
    HTTP status code returned by the partner endpoint (null if connection failed)

  - `data.response_time_ms` (number)
    Response time in milliseconds

  - `data.failure_reason` (string)
    Reason for failure (null on success). E.g. connection_timeout, read_timeout, http_status_500

  - `data.webhook_url` (string)
    The webhook URL the test was delivered to

  - `data.signature_header` (string)
    The X-Webhook-Signature header value sent with the test delivery (for verification debugging)

## Response 400 fields (application/json):

  - `errors` (array)
    List of validation errorsError catalog for 400 (click to expand)CodeDescription400001Webhook is inactive — must be active to send test delivery400002Webhook does not have a signing secret configured

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

## Response 401 fields (application/json):

  - `errors` (array)
    List of authentication errorsError catalog for 401 (click to expand)CodeDescription401000Invalid credentials

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

## Response 404 fields (application/json):

  - `errors` (array)
    List of not found errorsError catalog for 404 (click to expand)CodeDescription404000No webhook found for the given webhook_id

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

## Response 500 fields (application/json):

  - `errors` (array)
    List of server errorsError catalog for 500 (click to expand)CodeDescription500000Internal server error during test delivery

  - `errors.status` (string)

  - `errors.code` (number)

  - `errors.message` (string)

