Create Webhook Endpoint
client.webhooks.create(WebhookCreateParams { event_types, name, url } body, RequestOptionsoptions?): WebhookEndpointWithSecret { id, created_at, event_types, 6 more }
POST/webhook_endpoints
Create 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 webhookEndpointWithSecret = await client.webhooks.create({
event_types: ['batch.completed'],
name: 'x',
url: 'https://',
});
console.log(webhookEndpointWithSecret.id);{
"id": "id",
"created_at": 0,
"event_types": [
"string"
],
"name": "name",
"object": "webhook_endpoint",
"signing_secret": "signing_secret",
"signing_secret_hint": "signing_secret_hint",
"url": "url",
"updated_at": 0
}Returns Examples
{
"id": "id",
"created_at": 0,
"event_types": [
"string"
],
"name": "name",
"object": "webhook_endpoint",
"signing_secret": "signing_secret",
"signing_secret_hint": "signing_secret_hint",
"url": "url",
"updated_at": 0
}