# Test Subscription

Test a webhook subscription by sending a test signal. Supports three test modes.

Endpoint: (POST) https://api.lusha.com/api/subscriptions/{id}/test
---
Test Modes:
- direct - Quick HTTP check only (validates URL responds correctly)
- kafka - Fanout handler only (tests Kafka message processing)
- full - Complete Kafka flow (default - end-to-end test)

Important Notes:
- Test deliveries do NOT consume credits
- Test payloads use mock data
- Useful for verifying webhook configuration before going live

Endpoint: POST /api/subscriptions/{id}/test
Security: ApiKeyAuth

## Path parameters:

  - `id` (string, required)
    Subscription ID
    Example: "507f1f77bcf86cd799439011"

## Query parameters:

  - `mode` (string)
    Test mode
    Enum: "direct", "kafka", "full"

## Response 200 fields (application/json):

  - `subscriptionId` (string, required)
    Example: "507f1f77bcf86cd799439011"

  - `subscriptionName` (string)
    Example: "My Test Webhook"

  - `url` (string, required)
    Example: "https://example.com/webhook"

  - `mode` (string, required)
    Enum: "direct", "kafka", "full"

  - `flowCheck` (object)

  - `flowCheck.success` (boolean)
    Example: true

  - `flowCheck.statusCode` (integer)
    Example: 200

  - `flowCheck.durationMs` (integer)
    Example: 150

  - `testPayload` (object)

  - `testPayload.entityType` (string)
    Example: "contact"

  - `testPayload.signalType` (string)
    Example: "promotion"

  - `testPayload.data` (object)

  - `isSuccess` (boolean, required)
    Example: true

  - `timestamp` (string, required)
    Example: "2024-01-01T00:00:00.000Z"

## Response 400 fields (application/json):

  - `statusCode` (integer, required)
    HTTP status code
    Example: 400

  - `message` (string, required)
    Error message
    Example: "Validation failed"

  - `errors` (array)
    Detailed error messages (optional, only for validation errors)
    Example: ["entityType must be one of: contact, company"]


