resources/webhooks/methods/test/index.md +0 −102 deleted
File Deleted View Diff
1## Test Webhook Endpoint
2
3**post** `/webhook_endpoints/{webhook_endpoint_id}/test`
4
5Sends a sample event to a webhook endpoint for the authenticated project.
6
7### Path Parameters
8
9- `webhook_endpoint_id: string`
10
11### Body Parameters
12
13- `event_type: "batch.completed" or "batch.failed" or "batch.expired" or 15 more`
14
15 The event type to send as a sample delivery.
16
17 - `"batch.completed"`
18
19 - `"batch.failed"`
20
21 - `"batch.expired"`
22
23 - `"batch.cancelled"`
24
25 - `"response.completed"`
26
27 - `"response.failed"`
28
29 - `"response.cancelled"`
30
31 - `"response.incomplete"`
32
33 - `"eval.run.succeeded"`
34
35 - `"eval.run.failed"`
36
37 - `"eval.run.canceled"`
38
39 - `"fine_tuning.job.succeeded"`
40
41 - `"fine_tuning.job.failed"`
42
43 - `"fine_tuning.job.cancelled"`
44
45 - `"realtime.call.incoming"`
46
47 - `"video.completed"`
48
49 - `"video.failed"`
50
51 - `"safety.alert.created"`
52
53### Returns
54
55- `WebhookEndpointTestResult object { event_type, object, status_code, 2 more }`
56
57 - `event_type: string`
58
59 The event type sent in the test.
60
61 - `object: "webhook_endpoint.test"`
62
63 The object type, which is always webhook_endpoint.test.
64
65 - `"webhook_endpoint.test"`
66
67 - `status_code: number`
68
69 The HTTP status code returned by the endpoint.
70
71 - `success: true`
72
73 Whether the test request completed. Always true for returned results; use status_code to determine the endpoint response.
74
75 - `true`
76
77 - `webhook_endpoint_id: string`
78
79 The ID of the webhook endpoint that received the test.
80
81### Example
82
83```http
84curl https://api.openai.com/v1/webhook_endpoints/$WEBHOOK_ENDPOINT_ID/test \
85 -H 'Content-Type: application/json' \
86 -H "Authorization: Bearer $OPENAI_API_KEY" \
87 -d '{
88 "event_type": "batch.completed"
89 }'
90```
91
92#### Response
93
94```json
95{
96 "event_type": "event_type",
97 "object": "webhook_endpoint.test",
98 "status_code": 0,
99 "success": true,
100 "webhook_endpoint_id": "webhook_endpoint_id"
101}
102```