Test Webhook Endpoint
client.webhooks.test(stringwebhookEndpointID, WebhookTestParams { event_type } body, RequestOptionsoptions?): WebhookEndpointTestResult { event_type, object, status_code, 2 more }
POST/webhook_endpoints/{webhook_endpoint_id}/test
Sends a sample event to a webhook endpoint for the authenticated project.
Test Webhook Endpoint
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const webhookEndpointTestResult = await client.webhooks.test('whe_123', {
event_type: 'batch.completed',
});
console.log(webhookEndpointTestResult.webhook_endpoint_id);{
"event_type": "event_type",
"object": "webhook_endpoint.test",
"status_code": 0,
"success": true,
"webhook_endpoint_id": "webhook_endpoint_id"
}Returns Examples
{
"event_type": "event_type",
"object": "webhook_endpoint.test",
"status_code": 0,
"success": true,
"webhook_endpoint_id": "webhook_endpoint_id"
}