# 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) What Gets Tested: - URL accessibility and response time - Challenge verification (for direct mode) - Complete delivery pipeline (for full mode) - Signature generation and headers 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) Subscription ID that was tested Example: "507f1f77bcf86cd799439011" - `subscriptionName` (string) Name of the subscription Example: "My Test Webhook" - `url` (string, required) Webhook URL that was tested Example: "https://example.com/webhook" - `mode` (string, required) Test mode used Enum: "direct", "kafka", "full" - `flowCheck` (object) Results of the test - `flowCheck.success` (boolean) Example: true - `flowCheck.statusCode` (integer) Example: 200 - `flowCheck.durationMs` (integer) Example: 150 - `testPayload` (object) Test payload that was sent - `testPayload.entityType` (string) Example: "contact" - `testPayload.signalType` (string) Example: "promotion" - `testPayload.data` (object) - `isSuccess` (boolean, required) Overall test success Example: true - `timestamp` (string, required) When the test was executed 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"] ## Response 401 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"] ## Response 403 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"] ## Response 404 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"] ## Response 500 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"]