Skip to main content
POST
/
webhooks
/
{id}
/
test
Test Webhook
curl --request POST \
  --url https://api.example.com/webhooks/{id}/test \
  --header 'Authorization: <authorization>'
{
  "success": true,
  "deliveryId": "<string>",
  "httpStatus": 123,
  "durationMs": 123,
  "message": "<string>"
}
Sends a test ping event to verify webhook connectivity and signature validation.

Overview

Use this endpoint to verify that your webhook endpoint is correctly configured and can receive and validate webhook payloads. The test sends a ping event to your endpoint.
The webhook must be subscribed to the ping event for testing to work.

Authentication

Authorization
string
required
Bearer token with write:webhooks scope

Path Parameters

id
string
required
The webhook configuration ID (UUID v4)

Response

success
boolean
Whether the test was successful
deliveryId
string
Unique delivery ID for tracking (only on success)
httpStatus
number
HTTP status code returned by your endpoint (only on success)
durationMs
number
Request duration in milliseconds (only on success)
message
string
Human-readable result message

Example Request

curl -X POST https://api.instaview.sk/webhooks/550e8400-e29b-41d4-a716-446655440000/test \
  -H "Authorization: Bearer sk_your_key_here"

Example Responses

Successful Test

{
  "success": true,
  "data": {
    "success": true,
    "deliveryId": "delivery-uuid",
    "httpStatus": 200,
    "durationMs": 156,
    "message": "Webhook test successful!"
  }
}

Failed Test

{
  "success": true,
  "data": {
    "success": false,
    "message": "Webhook test failed: Connection timeout"
  }
}

Missing Ping Event Subscription

{
  "success": true,
  "data": {
    "success": false,
    "message": "Webhook is not subscribed to ping events. Add the ping event to the webhook configuration."
  }
}

Webhook Disabled

{
  "success": true,
  "data": {
    "success": false,
    "message": "No delivery was created. This may indicate the webhook is disabled or circuit breaker is open."
  }
}

Test Payload

Your endpoint will receive this payload during testing:
{
  "event": "ping",
  "timestamp": "2024-01-20T14:30:00.000Z",
  "deliveryId": "delivery-uuid",
  "data": {
    "message": "Test ping from InstaView webhook system"
  }
}

Verifying Signature in Test

Use the test to verify your signature validation is working correctly:
// Configure Express to preserve raw body for signature verification
app.post('/webhooks/instaview', 
  express.raw({ type: 'application/json' }),
  (req, res) => {
    const signature = req.headers['x-webhook-signature'];
    const payload = req.body.toString(); // Now this is the raw buffer
    
    if (!verifySignature(payload, signature, process.env.WEBHOOK_SECRET)) {
      console.error('Signature verification failed');
      return res.status(401).send('Invalid signature');
    }
    
    const event = JSON.parse(payload);
    
    if (event.event === 'ping') {
      console.log('Ping test received successfully');
      console.log('Message:', event.data.message);
    }
    
    res.status(200).send('OK');
  }
);

Troubleshooting

  • Ensure your endpoint is publicly accessible
  • Check if your firewall allows incoming connections
  • Verify your endpoint responds within 30 seconds
  • Verify the webhook URL is correct
  • Check if your server is running
  • Ensure the port is open and accessible
  • Check your custom Authorization header value
  • Verify your endpoint’s authentication logic
  • Ensure signature verification is working correctly
Add the ping event to your webhook:
await fetch(`/webhooks/${webhookId}`, {
  method: 'PATCH',
  headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    events: ["ping", "interview.completed", "analysis.completed"]
  })
});