resources/webhooks/methods/rotate_secret/index.md +0 −83 deleted
File Deleted View Diff
1## Rotate Webhook Endpoint Signing Secret
2
3**post** `/webhook_endpoints/{webhook_endpoint_id}/rotate_secret`
4
5Rotates the signing secret for a webhook endpoint in the authenticated project.
6
7### Path Parameters
8
9- `webhook_endpoint_id: string`
10
11### Body Parameters
12
13- `keep_old_secret_active_for_24_hours: optional boolean`
14
15 Whether to keep the previous signing secret valid for 24 hours after rotation. Defaults to false, which invalidates the previous secret immediately.
16
17### Returns
18
19- `WebhookEndpointWithSecret object { id, created_at, event_types, 6 more }`
20
21 - `id: string`
22
23 The unique ID of the webhook endpoint.
24
25 - `created_at: number`
26
27 The Unix timestamp when the endpoint was created.
28
29 - `event_types: array of string`
30
31 The event types that trigger deliveries to this endpoint.
32
33 - `name: string`
34
35 The human-readable name of the endpoint.
36
37 - `object: "webhook_endpoint"`
38
39 The object type, which is always webhook_endpoint.
40
41 - `"webhook_endpoint"`
42
43 - `signing_secret: string`
44
45 The endpoint's signing secret. This is returned only when the endpoint is created or the secret is rotated.
46
47 - `signing_secret_hint: string or null`
48
49 A masked hint for the endpoint's signing secret.
50
51 - `url: string`
52
53 The HTTPS URL that receives webhook deliveries.
54
55 - `updated_at: optional number`
56
57 The Unix timestamp of the last endpoint configuration or signing-secret change. Initialized at creation; tests and unchanged updates do not advance it.
58
59### Example
60
61```http
62curl https://api.openai.com/v1/webhook_endpoints/$WEBHOOK_ENDPOINT_ID/rotate_secret \
63 -X POST \
64 -H "Authorization: Bearer $OPENAI_API_KEY"
65```
66
67#### Response
68
69```json
70{
71 "id": "id",
72 "created_at": 0,
73 "event_types": [
74 "string"
75 ],
76 "name": "name",
77 "object": "webhook_endpoint",
78 "signing_secret": "signing_secret",
79 "signing_secret_hint": "signing_secret_hint",
80 "url": "url",
81 "updated_at": 0
82}
83```