-
Notifications
You must be signed in to change notification settings - Fork 16
/
webhooks.ai.rpt.dev.yaml
169 lines (156 loc) · 4.38 KB
/
webhooks.ai.rpt.dev.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
openapi: 3.1.0
info:
version: 0.0.1
title: Webhooks API
description: An API list, create, edit, or delete Webhooks.
paths:
/webhooks:
get:
operationId: getWebhooks
description:
Returns a list of webhooks, always format them into a table, and remember to include the ID for any subsequent operations.
As the first column of the table, use incrementing numbers, starting from 1.
responses:
'200':
description: a list of webhooks
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Webhook'
'400':
$ref: '#/components/responses/ErrorResponse'
post:
operationId: createWebhook
description: Create a new webhook. You must always include name and script fields.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Webhook'
responses:
'200':
description: successfully created webhook
'400':
$ref: '#/components/responses/ErrorResponse'
/webhooks/{webhookId}:
get:
operationId: getWebhook
description: Returns a webhook by id
# parameters:
# - $ref: '#/components/parameters/WebhookId'
parameters:
- name: webhookId
in: path
required: true
schema:
type: string
responses:
'200':
description: a webhook data
content:
application/json:
schema:
$ref: '#/components/schemas/Webhook'
'400':
$ref: '#/components/responses/ErrorResponse'
put:
operationId: updateWebhook
description: Update a webhook. You must always include name and script fields.
parameters:
- name: webhookId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Webhook'
responses:
'200':
description: successfully updated webhook
'400':
$ref: '#/components/responses/ErrorResponse'
delete:
operationId: deleteWebhook
description: Delete a webhook
parameters:
- name: webhookId
in: path
required: true
schema:
type: string
responses:
'200':
description: successfully deleted webhook
'400':
$ref: '#/components/responses/ErrorResponse'
/webhooks/{webhookId}/script:
get:
operationId: getWebhookScript
description: Returns a webhook script code by id
parameters:
- name: webhookId
in: path
required: true
schema:
type: string
responses:
'200':
description: returns a webhook script code
content:
application/json:
schema:
$ref: '#/components/schemas/Webhook'
'400':
$ref: '#/components/responses/ErrorResponse'
components:
schemas:
Webhook:
type: object
required:
- script
- name
properties:
id:
type: string
name:
type: string
description: The name of the webhook, if no name is provided, use random pet name, consisting of max 4 words
url:
type: string
description: The URL of the webhook, always use markdown to format it as a link.
script:
type: string
description: "
The format of script must be in ES Modules syntax, with fetch handler.
Script must not import any external modules, it is not supported yet.
For example, a hello world worker would like like:
export default {
fetch: async (request) => {
return new Response('Hello world!')
}
};
"
parameters:
WebhookId:
name: webhookId
in: path
required: true
schema:
type: string
responses:
ErrorResponse:
description: Invalid request
content:
application/json:
schema:
type: object
properties:
message:
type: string