resources/webhooks/methods/create/index.md +0 −130 deleted
File Deleted View Diff
1## Create Webhook Endpoint
2
3**post** `/webhook_endpoints`
4
5Creates a webhook endpoint for the authenticated project.
6
7### Body Parameters
8
9- `event_types: array of "batch.completed" or "batch.failed" or "batch.expired" or 15 more`
10
11 The event types that trigger deliveries to this endpoint.
12
13 - `"batch.completed"`
14
15 - `"batch.failed"`
16
17 - `"batch.expired"`
18
19 - `"batch.cancelled"`
20
21 - `"response.completed"`
22
23 - `"response.failed"`
24
25 - `"response.cancelled"`
26
27 - `"response.incomplete"`
28
29 - `"eval.run.succeeded"`
30
31 - `"eval.run.failed"`
32
33 - `"eval.run.canceled"`
34
35 - `"fine_tuning.job.succeeded"`
36
37 - `"fine_tuning.job.failed"`
38
39 - `"fine_tuning.job.cancelled"`
40
41 - `"realtime.call.incoming"`
42
43 - `"video.completed"`
44
45 - `"video.failed"`
46
47 - `"safety.alert.created"`
48
49- `name: string`
50
51 A human-readable name for the webhook endpoint.
52
53- `url: string`
54
55 The HTTPS URL that receives webhook deliveries.
56
57### Returns
58
59- `WebhookEndpointWithSecret object { id, created_at, event_types, 6 more }`
60
61 - `id: string`
62
63 The unique ID of the webhook endpoint.
64
65 - `created_at: number`
66
67 The Unix timestamp when the endpoint was created.
68
69 - `event_types: array of string`
70
71 The event types that trigger deliveries to this endpoint.
72
73 - `name: string`
74
75 The human-readable name of the endpoint.
76
77 - `object: "webhook_endpoint"`
78
79 The object type, which is always webhook_endpoint.
80
81 - `"webhook_endpoint"`
82
83 - `signing_secret: string`
84
85 The endpoint's signing secret. This is returned only when the endpoint is created or the secret is rotated.
86
87 - `signing_secret_hint: string or null`
88
89 A masked hint for the endpoint's signing secret.
90
91 - `url: string`
92
93 The HTTPS URL that receives webhook deliveries.
94
95 - `updated_at: optional number`
96
97 The Unix timestamp of the last endpoint configuration or signing-secret change. Initialized at creation; tests and unchanged updates do not advance it.
98
99### Example
100
101```http
102curl https://api.openai.com/v1/webhook_endpoints \
103 -H 'Content-Type: application/json' \
104 -H "Authorization: Bearer $OPENAI_API_KEY" \
105 -d '{
106 "event_types": [
107 "batch.completed"
108 ],
109 "name": "x",
110 "url": "https://"
111 }'
112```
113
114#### Response
115
116```json
117{
118 "id": "id",
119 "created_at": 0,
120 "event_types": [
121 "string"
122 ],
123 "name": "name",
124 "object": "webhook_endpoint",
125 "signing_secret": "signing_secret",
126 "signing_secret_hint": "signing_secret_hint",
127 "url": "url",
128 "updated_at": 0
129}
130```