Rotate Webhook Endpoint Signing Secret
client.webhooks.rotateSecret(stringwebhookEndpointID, WebhookRotateSecretParams { keep_old_secret_active_for_24_hours } body?, RequestOptionsoptions?): WebhookEndpointWithSecret { id, created_at, event_types, 6 more }
POST/webhook_endpoints/{webhook_endpoint_id}/rotate_secret
Rotates the signing secret for a webhook endpoint in the authenticated project.
Rotate Webhook Endpoint Signing Secret
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.rotateSecret('whe_123');
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
}