@unkey/api 0.19.5 → 0.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1892 -1667
- package/dist/index.d.ts +1892 -1667
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -9,1189 +9,1656 @@ export { Flatten, and, or } from '@unkey/rbac';
|
|
|
9
9
|
|
|
10
10
|
interface paths {
|
|
11
11
|
"/v1/liveness": {
|
|
12
|
-
get:
|
|
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
|
-
|
|
12
|
+
get: operations["v1.liveness"];
|
|
13
|
+
};
|
|
14
|
+
"/v1/keys.getKey": {
|
|
15
|
+
get: operations["getKey"];
|
|
16
|
+
};
|
|
17
|
+
"/v1/keys.deleteKey": {
|
|
18
|
+
post: operations["deleteKey"];
|
|
19
|
+
};
|
|
20
|
+
"/v1/keys.createKey": {
|
|
21
|
+
post: operations["createKey"];
|
|
22
|
+
};
|
|
23
|
+
"/v1/keys.verifyKey": {
|
|
24
|
+
post: operations["verifyKey"];
|
|
25
|
+
};
|
|
26
|
+
"/v1/keys.updateKey": {
|
|
27
|
+
post: operations["updateKey"];
|
|
28
|
+
};
|
|
29
|
+
"/v1/keys.updateRemaining": {
|
|
30
|
+
post: operations["updateRemaining"];
|
|
31
|
+
};
|
|
32
|
+
"/v1/keys.getVerifications": {
|
|
33
|
+
get: operations["getVerifications"];
|
|
34
|
+
};
|
|
35
|
+
"/v1/apis.getApi": {
|
|
36
|
+
get: operations["getApi"];
|
|
37
|
+
};
|
|
38
|
+
"/v1/apis.createApi": {
|
|
39
|
+
post: operations["createApi"];
|
|
40
|
+
};
|
|
41
|
+
"/v1/apis.listKeys": {
|
|
42
|
+
get: operations["listKeys"];
|
|
43
|
+
};
|
|
44
|
+
"/v1/apis.deleteApi": {
|
|
45
|
+
post: operations["deleteApi"];
|
|
46
|
+
};
|
|
47
|
+
"/v1/ratelimits.limit": {
|
|
48
|
+
post: operations["limit"];
|
|
49
|
+
};
|
|
50
|
+
"/v1/migrations.createKeys": {
|
|
51
|
+
post: operations["v1.migrations.createKeys"];
|
|
52
|
+
};
|
|
53
|
+
"/v1/keys": {
|
|
54
|
+
post: operations["deprecated.createKey"];
|
|
55
|
+
};
|
|
56
|
+
"/v1/keys/verify": {
|
|
57
|
+
/** @deprecated */
|
|
58
|
+
post: operations["deprecated.verifyKey"];
|
|
59
|
+
};
|
|
60
|
+
"/v1/apis/{apiId}/keys": {
|
|
61
|
+
get: operations["deprecated.listKeys"];
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface components {
|
|
66
|
+
schemas: {
|
|
67
|
+
ErrBadRequest: {
|
|
68
|
+
error: {
|
|
69
|
+
/**
|
|
70
|
+
* @description A machine readable error code.
|
|
71
|
+
* @example BAD_REQUEST
|
|
72
|
+
* @enum {string}
|
|
73
|
+
*/
|
|
74
|
+
code: "BAD_REQUEST";
|
|
75
|
+
/**
|
|
76
|
+
* @description A link to our documentation with more details about this error code
|
|
77
|
+
* @example https://unkey.dev/docs/api-reference/errors/code/BAD_REQUEST
|
|
78
|
+
*/
|
|
79
|
+
docs: string;
|
|
80
|
+
/** @description A human readable explanation of what went wrong */
|
|
81
|
+
message: string;
|
|
82
|
+
/**
|
|
83
|
+
* @description Please always include the requestId in your error report
|
|
84
|
+
* @example req_1234
|
|
85
|
+
*/
|
|
86
|
+
requestId: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
ErrUnauthorized: {
|
|
90
|
+
error: {
|
|
91
|
+
/**
|
|
92
|
+
* @description A machine readable error code.
|
|
93
|
+
* @example UNAUTHORIZED
|
|
94
|
+
* @enum {string}
|
|
95
|
+
*/
|
|
96
|
+
code: "UNAUTHORIZED";
|
|
97
|
+
/**
|
|
98
|
+
* @description A link to our documentation with more details about this error code
|
|
99
|
+
* @example https://unkey.dev/docs/api-reference/errors/code/UNAUTHORIZED
|
|
100
|
+
*/
|
|
101
|
+
docs: string;
|
|
102
|
+
/** @description A human readable explanation of what went wrong */
|
|
103
|
+
message: string;
|
|
104
|
+
/**
|
|
105
|
+
* @description Please always include the requestId in your error report
|
|
106
|
+
* @example req_1234
|
|
107
|
+
*/
|
|
108
|
+
requestId: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
ErrForbidden: {
|
|
112
|
+
error: {
|
|
113
|
+
/**
|
|
114
|
+
* @description A machine readable error code.
|
|
115
|
+
* @example FORBIDDEN
|
|
116
|
+
* @enum {string}
|
|
117
|
+
*/
|
|
118
|
+
code: "FORBIDDEN";
|
|
119
|
+
/**
|
|
120
|
+
* @description A link to our documentation with more details about this error code
|
|
121
|
+
* @example https://unkey.dev/docs/api-reference/errors/code/FORBIDDEN
|
|
122
|
+
*/
|
|
123
|
+
docs: string;
|
|
124
|
+
/** @description A human readable explanation of what went wrong */
|
|
125
|
+
message: string;
|
|
126
|
+
/**
|
|
127
|
+
* @description Please always include the requestId in your error report
|
|
128
|
+
* @example req_1234
|
|
129
|
+
*/
|
|
130
|
+
requestId: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
ErrNotFound: {
|
|
134
|
+
error: {
|
|
135
|
+
/**
|
|
136
|
+
* @description A machine readable error code.
|
|
137
|
+
* @example NOT_FOUND
|
|
138
|
+
* @enum {string}
|
|
139
|
+
*/
|
|
140
|
+
code: "NOT_FOUND";
|
|
141
|
+
/**
|
|
142
|
+
* @description A link to our documentation with more details about this error code
|
|
143
|
+
* @example https://unkey.dev/docs/api-reference/errors/code/NOT_FOUND
|
|
144
|
+
*/
|
|
145
|
+
docs: string;
|
|
146
|
+
/** @description A human readable explanation of what went wrong */
|
|
147
|
+
message: string;
|
|
148
|
+
/**
|
|
149
|
+
* @description Please always include the requestId in your error report
|
|
150
|
+
* @example req_1234
|
|
151
|
+
*/
|
|
152
|
+
requestId: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
ErrConflict: {
|
|
156
|
+
error: {
|
|
157
|
+
/**
|
|
158
|
+
* @description A machine readable error code.
|
|
159
|
+
* @example CONFLICT
|
|
160
|
+
* @enum {string}
|
|
161
|
+
*/
|
|
162
|
+
code: "CONFLICT";
|
|
163
|
+
/**
|
|
164
|
+
* @description A link to our documentation with more details about this error code
|
|
165
|
+
* @example https://unkey.dev/docs/api-reference/errors/code/CONFLICT
|
|
166
|
+
*/
|
|
167
|
+
docs: string;
|
|
168
|
+
/** @description A human readable explanation of what went wrong */
|
|
169
|
+
message: string;
|
|
170
|
+
/**
|
|
171
|
+
* @description Please always include the requestId in your error report
|
|
172
|
+
* @example req_1234
|
|
173
|
+
*/
|
|
174
|
+
requestId: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
ErrTooManyRequests: {
|
|
178
|
+
error: {
|
|
179
|
+
/**
|
|
180
|
+
* @description A machine readable error code.
|
|
181
|
+
* @example TOO_MANY_REQUESTS
|
|
182
|
+
* @enum {string}
|
|
183
|
+
*/
|
|
184
|
+
code: "TOO_MANY_REQUESTS";
|
|
185
|
+
/**
|
|
186
|
+
* @description A link to our documentation with more details about this error code
|
|
187
|
+
* @example https://unkey.dev/docs/api-reference/errors/code/TOO_MANY_REQUESTS
|
|
188
|
+
*/
|
|
189
|
+
docs: string;
|
|
190
|
+
/** @description A human readable explanation of what went wrong */
|
|
191
|
+
message: string;
|
|
192
|
+
/**
|
|
193
|
+
* @description Please always include the requestId in your error report
|
|
194
|
+
* @example req_1234
|
|
195
|
+
*/
|
|
196
|
+
requestId: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
ErrInternalServerError: {
|
|
200
|
+
error: {
|
|
201
|
+
/**
|
|
202
|
+
* @description A machine readable error code.
|
|
203
|
+
* @example INTERNAL_SERVER_ERROR
|
|
204
|
+
* @enum {string}
|
|
205
|
+
*/
|
|
206
|
+
code: "INTERNAL_SERVER_ERROR";
|
|
207
|
+
/**
|
|
208
|
+
* @description A link to our documentation with more details about this error code
|
|
209
|
+
* @example https://unkey.dev/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR
|
|
210
|
+
*/
|
|
211
|
+
docs: string;
|
|
212
|
+
/** @description A human readable explanation of what went wrong */
|
|
213
|
+
message: string;
|
|
214
|
+
/**
|
|
215
|
+
* @description Please always include the requestId in your error report
|
|
216
|
+
* @example req_1234
|
|
217
|
+
*/
|
|
218
|
+
requestId: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
Key: {
|
|
222
|
+
/**
|
|
223
|
+
* @description The id of the key
|
|
224
|
+
* @example key_1234
|
|
225
|
+
*/
|
|
226
|
+
id: string;
|
|
227
|
+
/**
|
|
228
|
+
* @description The first few characters of the key to visually identify it
|
|
229
|
+
* @example sk_5j1
|
|
230
|
+
*/
|
|
231
|
+
start: string;
|
|
232
|
+
/**
|
|
233
|
+
* @description The id of the workspace that owns the key
|
|
234
|
+
* @example ws_1234
|
|
235
|
+
*/
|
|
236
|
+
workspaceId: string;
|
|
237
|
+
/**
|
|
238
|
+
* @description The id of the api that this key is for
|
|
239
|
+
* @example api_1234
|
|
240
|
+
*/
|
|
241
|
+
apiId?: string;
|
|
242
|
+
/**
|
|
243
|
+
* @description The name of the key, give keys a name to easily identify their purpose
|
|
244
|
+
* @example Customer X
|
|
245
|
+
*/
|
|
246
|
+
name?: string;
|
|
247
|
+
/**
|
|
248
|
+
* @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API.
|
|
249
|
+
* @example user_123
|
|
250
|
+
*/
|
|
251
|
+
ownerId?: string;
|
|
252
|
+
/**
|
|
253
|
+
* @description Any additional metadata you want to store with the key
|
|
254
|
+
* @example {
|
|
255
|
+
* "roles": [
|
|
256
|
+
* "admin",
|
|
257
|
+
* "user"
|
|
258
|
+
* ],
|
|
259
|
+
* "stripeCustomerId": "cus_1234"
|
|
260
|
+
* }
|
|
261
|
+
*/
|
|
262
|
+
meta?: {
|
|
263
|
+
[key: string]: unknown;
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* @description The unix timestamp in milliseconds when the key was created
|
|
267
|
+
* @example 0
|
|
268
|
+
*/
|
|
269
|
+
createdAt?: number;
|
|
270
|
+
/**
|
|
271
|
+
* @description The unix timestamp in milliseconds when the key was deleted. We don't delete the key outright, you can restore it later.
|
|
272
|
+
* @example 0
|
|
273
|
+
*/
|
|
274
|
+
deletedAt?: number;
|
|
275
|
+
/**
|
|
276
|
+
* @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring.
|
|
277
|
+
* @example 0
|
|
278
|
+
*/
|
|
279
|
+
expires?: number;
|
|
280
|
+
/**
|
|
281
|
+
* @description The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit.
|
|
282
|
+
* @example 1000
|
|
283
|
+
*/
|
|
284
|
+
remaining?: number;
|
|
285
|
+
/**
|
|
286
|
+
* @description Unkey allows you to refill remaining verifications on a key on a regular interval.
|
|
287
|
+
* @example {
|
|
288
|
+
* "interval": "daily",
|
|
289
|
+
* "amount": 10
|
|
290
|
+
* }
|
|
291
|
+
*/
|
|
292
|
+
refill?: {
|
|
293
|
+
/**
|
|
294
|
+
* @description Determines the rate at which verifications will be refilled.
|
|
295
|
+
* @example daily
|
|
296
|
+
* @enum {string}
|
|
297
|
+
*/
|
|
298
|
+
interval: "daily" | "monthly";
|
|
299
|
+
/**
|
|
300
|
+
* @description Resets `remaining` to this value every interval.
|
|
301
|
+
* @example 100
|
|
302
|
+
*/
|
|
303
|
+
amount: number;
|
|
304
|
+
/**
|
|
305
|
+
* @description The unix timestamp in miliseconds when the key was last refilled.
|
|
306
|
+
* @example 100
|
|
307
|
+
*/
|
|
308
|
+
lastRefillAt?: number;
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* @description Unkey comes with per-key ratelimiting out of the box.
|
|
312
|
+
* @example {
|
|
313
|
+
* "type": "fast",
|
|
314
|
+
* "limit": 10,
|
|
315
|
+
* "refillRate": 1,
|
|
316
|
+
* "refillInterval": 60
|
|
317
|
+
* }
|
|
318
|
+
*/
|
|
319
|
+
ratelimit?: {
|
|
320
|
+
/**
|
|
321
|
+
* @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.
|
|
322
|
+
* @default fast
|
|
323
|
+
* @enum {string}
|
|
324
|
+
*/
|
|
325
|
+
type?: "fast" | "consistent";
|
|
326
|
+
/** @description The total amount of burstable requests. */
|
|
327
|
+
limit: number;
|
|
328
|
+
/** @description How many tokens to refill during each refillInterval. */
|
|
329
|
+
refillRate: number;
|
|
330
|
+
/** @description Determines the speed at which tokens are refilled, in milliseconds. */
|
|
331
|
+
refillInterval: number;
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* @description All roles this key belongs to
|
|
335
|
+
* @example [
|
|
336
|
+
* "admin",
|
|
337
|
+
* "finance"
|
|
338
|
+
* ]
|
|
339
|
+
*/
|
|
340
|
+
roles?: string[];
|
|
341
|
+
/**
|
|
342
|
+
* @description All permissions this key has
|
|
343
|
+
* @example [
|
|
344
|
+
* "domain.dns.create_record",
|
|
345
|
+
* "finance.read_receipt"
|
|
346
|
+
* ]
|
|
347
|
+
*/
|
|
348
|
+
permissions?: string[];
|
|
349
|
+
/**
|
|
350
|
+
* @description Sets if key is enabled or disabled. Disabled keys are not valid.
|
|
351
|
+
* @example true
|
|
352
|
+
*/
|
|
353
|
+
enabled?: boolean;
|
|
354
|
+
};
|
|
355
|
+
V1KeysVerifyKeyResponse: {
|
|
356
|
+
/**
|
|
357
|
+
* @description The id of the key
|
|
358
|
+
* @example key_1234
|
|
359
|
+
*/
|
|
360
|
+
keyId?: string;
|
|
361
|
+
/**
|
|
362
|
+
* @description Whether the key is valid or not.
|
|
363
|
+
* A key could be invalid for a number of reasons, for example if it has expired, has no more verifications left or if it has been deleted.
|
|
364
|
+
* @example true
|
|
365
|
+
*/
|
|
366
|
+
valid: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* @description The name of the key, give keys a name to easily identifiy their purpose
|
|
369
|
+
* @example Customer X
|
|
370
|
+
*/
|
|
371
|
+
name?: string;
|
|
372
|
+
/**
|
|
373
|
+
* @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API.
|
|
374
|
+
* @example user_123
|
|
375
|
+
*/
|
|
376
|
+
ownerId?: string;
|
|
377
|
+
/**
|
|
378
|
+
* @description Any additional metadata you want to store with the key
|
|
379
|
+
* @example {
|
|
380
|
+
* "roles": [
|
|
381
|
+
* "admin",
|
|
382
|
+
* "user"
|
|
383
|
+
* ],
|
|
384
|
+
* "stripeCustomerId": "cus_1234"
|
|
385
|
+
* }
|
|
386
|
+
*/
|
|
387
|
+
meta?: {
|
|
388
|
+
[key: string]: unknown;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring.
|
|
392
|
+
* @example 123
|
|
393
|
+
*/
|
|
394
|
+
expires?: number;
|
|
395
|
+
/**
|
|
396
|
+
* @description The ratelimit configuration for this key. If this field is null or undefined, the key has no ratelimit.
|
|
397
|
+
* @example {
|
|
398
|
+
* "limit": 10,
|
|
399
|
+
* "remaining": 9,
|
|
400
|
+
* "reset": 3600000
|
|
401
|
+
* }
|
|
402
|
+
*/
|
|
403
|
+
ratelimit?: {
|
|
404
|
+
/**
|
|
405
|
+
* @description Maximum number of requests that can be made inside a window
|
|
406
|
+
* @example 10
|
|
407
|
+
*/
|
|
408
|
+
limit: number;
|
|
409
|
+
/**
|
|
410
|
+
* @description Remaining requests after this verification
|
|
411
|
+
* @example 9
|
|
412
|
+
*/
|
|
413
|
+
remaining: number;
|
|
414
|
+
/**
|
|
415
|
+
* @description Unix timestamp in milliseconds when the ratelimit will reset
|
|
416
|
+
* @example 3600000
|
|
417
|
+
*/
|
|
418
|
+
reset: number;
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* @description The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit.
|
|
422
|
+
* @example 1000
|
|
423
|
+
*/
|
|
424
|
+
remaining?: number;
|
|
425
|
+
/**
|
|
426
|
+
* @description A machine readable code why the key is not valid.
|
|
427
|
+
* Possible values are:
|
|
428
|
+
* - VALID: the key is valid and you should proceed
|
|
429
|
+
* - NOT_FOUND: the key does not exist or has expired
|
|
430
|
+
* - FORBIDDEN: the key is not allowed to access the api
|
|
431
|
+
* - USAGE_EXCEEDED: the key has exceeded its request limit
|
|
432
|
+
* - RATE_LIMITED: the key has been ratelimited
|
|
433
|
+
* - UNAUTHORIZED: the key is not authorized
|
|
434
|
+
* - DISABLED: the key is disabled
|
|
435
|
+
* - INSUFFICIENT_PERMISSIONS: you do not have the required permissions to perform this action
|
|
436
|
+
*
|
|
437
|
+
* @enum {string}
|
|
438
|
+
*/
|
|
439
|
+
code: "VALID" | "NOT_FOUND" | "FORBIDDEN" | "USAGE_EXCEEDED" | "RATE_LIMITED" | "UNAUTHORIZED" | "DISABLED" | "INSUFFICIENT_PERMISSIONS";
|
|
440
|
+
/** @description Sets the key to be enabled or disabled. Disabled keys will not verify. */
|
|
441
|
+
enabled?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* @description A list of all the permissions this key is connected to.
|
|
444
|
+
* @example [
|
|
445
|
+
* "dns.record.update",
|
|
446
|
+
* "dns.record.delete"
|
|
447
|
+
* ]
|
|
448
|
+
*/
|
|
449
|
+
permissions?: string[];
|
|
450
|
+
/**
|
|
451
|
+
* @description The environment of the key, this is what what you set when you crated the key
|
|
452
|
+
* @example test
|
|
453
|
+
*/
|
|
454
|
+
environment?: string;
|
|
455
|
+
};
|
|
456
|
+
V1KeysVerifyKeyRequest: {
|
|
457
|
+
/**
|
|
458
|
+
* @description The id of the api where the key belongs to. This is optional for now but will be required soon.
|
|
459
|
+
* The key will be verified against the api's configuration. If the key does not belong to the api, the verification will fail.
|
|
460
|
+
* @example api_1234
|
|
461
|
+
*/
|
|
462
|
+
apiId?: string;
|
|
463
|
+
/**
|
|
464
|
+
* @description The key to verify
|
|
465
|
+
* @example sk_1234
|
|
466
|
+
*/
|
|
467
|
+
key: string;
|
|
468
|
+
/** @description Perform RBAC checks */
|
|
469
|
+
authorization?: {
|
|
470
|
+
/**
|
|
471
|
+
* @description A query for which permissions you require
|
|
472
|
+
* @example {
|
|
473
|
+
* "or": [
|
|
474
|
+
* {
|
|
475
|
+
* "and": [
|
|
476
|
+
* "dns.record.read",
|
|
477
|
+
* "dns.record.update"
|
|
478
|
+
* ]
|
|
479
|
+
* },
|
|
480
|
+
* "admin"
|
|
481
|
+
* ]
|
|
482
|
+
* }
|
|
483
|
+
*/
|
|
484
|
+
permissions?: Record<string, never>;
|
|
485
|
+
};
|
|
486
|
+
ratelimit?: {
|
|
487
|
+
/**
|
|
488
|
+
* @description Override how many tokens are deducted during the ratelimit operation.
|
|
489
|
+
* @default 1
|
|
490
|
+
*/
|
|
491
|
+
cost?: number;
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
responses: never;
|
|
496
|
+
parameters: {
|
|
497
|
+
};
|
|
498
|
+
requestBodies: never;
|
|
499
|
+
headers: never;
|
|
500
|
+
pathItems: never;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
interface operations {
|
|
504
|
+
|
|
505
|
+
"v1.liveness": {
|
|
506
|
+
responses: {
|
|
507
|
+
/** @description The configured services and their status */
|
|
508
|
+
200: {
|
|
509
|
+
content: {
|
|
510
|
+
"application/json": {
|
|
511
|
+
/** @description The status of the server */
|
|
512
|
+
status: string;
|
|
513
|
+
services: {
|
|
514
|
+
/**
|
|
515
|
+
* @description The name of the connected metrics service
|
|
516
|
+
* @example AxiomMetrics
|
|
517
|
+
*/
|
|
518
|
+
metrics: string;
|
|
519
|
+
/**
|
|
520
|
+
* @description The name of the connected logger service
|
|
521
|
+
* @example AxiomLogger or ConsoleLogger
|
|
522
|
+
*/
|
|
523
|
+
logger: string;
|
|
524
|
+
/** @description The name of the connected ratelimit service */
|
|
525
|
+
ratelimit: string;
|
|
526
|
+
/** @description The name of the connected usagelimit service */
|
|
527
|
+
usagelimit: string;
|
|
528
|
+
/** @description The name of the connected analytics service */
|
|
529
|
+
analytics: string;
|
|
38
530
|
};
|
|
39
531
|
};
|
|
40
532
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
533
|
+
};
|
|
534
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
535
|
+
400: {
|
|
536
|
+
content: {
|
|
537
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
46
538
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
539
|
+
};
|
|
540
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
541
|
+
401: {
|
|
542
|
+
content: {
|
|
543
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
52
544
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
545
|
+
};
|
|
546
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
547
|
+
403: {
|
|
548
|
+
content: {
|
|
549
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
58
550
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
551
|
+
};
|
|
552
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
553
|
+
404: {
|
|
554
|
+
content: {
|
|
555
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
64
556
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
557
|
+
};
|
|
558
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
559
|
+
409: {
|
|
560
|
+
content: {
|
|
561
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
70
562
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
563
|
+
};
|
|
564
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
565
|
+
429: {
|
|
566
|
+
content: {
|
|
567
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
76
568
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
569
|
+
};
|
|
570
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
571
|
+
500: {
|
|
572
|
+
content: {
|
|
573
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
82
574
|
};
|
|
83
575
|
};
|
|
84
576
|
};
|
|
85
577
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
keyId: string;
|
|
91
|
-
};
|
|
578
|
+
getKey: {
|
|
579
|
+
parameters: {
|
|
580
|
+
query: {
|
|
581
|
+
keyId: string;
|
|
92
582
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
583
|
+
};
|
|
584
|
+
responses: {
|
|
585
|
+
/** @description The configuration for a single key */
|
|
586
|
+
200: {
|
|
587
|
+
content: {
|
|
588
|
+
"application/json": components["schemas"]["Key"];
|
|
99
589
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
590
|
+
};
|
|
591
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
592
|
+
400: {
|
|
593
|
+
content: {
|
|
594
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
105
595
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
596
|
+
};
|
|
597
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
598
|
+
401: {
|
|
599
|
+
content: {
|
|
600
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
111
601
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
602
|
+
};
|
|
603
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
604
|
+
403: {
|
|
605
|
+
content: {
|
|
606
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
117
607
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
608
|
+
};
|
|
609
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
610
|
+
404: {
|
|
611
|
+
content: {
|
|
612
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
123
613
|
};
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
614
|
+
};
|
|
615
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
616
|
+
409: {
|
|
617
|
+
content: {
|
|
618
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
129
619
|
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
620
|
+
};
|
|
621
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
622
|
+
429: {
|
|
623
|
+
content: {
|
|
624
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
135
625
|
};
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
626
|
+
};
|
|
627
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
628
|
+
500: {
|
|
629
|
+
content: {
|
|
630
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
141
631
|
};
|
|
142
632
|
};
|
|
143
633
|
};
|
|
144
634
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
keyId: string;
|
|
155
|
-
};
|
|
635
|
+
deleteKey: {
|
|
636
|
+
requestBody: {
|
|
637
|
+
content: {
|
|
638
|
+
"application/json": {
|
|
639
|
+
/**
|
|
640
|
+
* @description The id of the key to revoke
|
|
641
|
+
* @example key_1234
|
|
642
|
+
*/
|
|
643
|
+
keyId: string;
|
|
156
644
|
};
|
|
157
645
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
646
|
+
};
|
|
647
|
+
responses: {
|
|
648
|
+
/** @description The key was successfully revoked, it may take up to 30s for this to take effect in all regions */
|
|
649
|
+
200: {
|
|
650
|
+
content: {
|
|
651
|
+
"application/json": Record<string, never>;
|
|
164
652
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
653
|
+
};
|
|
654
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
655
|
+
400: {
|
|
656
|
+
content: {
|
|
657
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
170
658
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
659
|
+
};
|
|
660
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
661
|
+
401: {
|
|
662
|
+
content: {
|
|
663
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
176
664
|
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
665
|
+
};
|
|
666
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
667
|
+
403: {
|
|
668
|
+
content: {
|
|
669
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
182
670
|
};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
671
|
+
};
|
|
672
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
673
|
+
404: {
|
|
674
|
+
content: {
|
|
675
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
188
676
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
677
|
+
};
|
|
678
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
679
|
+
409: {
|
|
680
|
+
content: {
|
|
681
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
194
682
|
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
683
|
+
};
|
|
684
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
685
|
+
429: {
|
|
686
|
+
content: {
|
|
687
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
200
688
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
689
|
+
};
|
|
690
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
691
|
+
500: {
|
|
692
|
+
content: {
|
|
693
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
206
694
|
};
|
|
207
695
|
};
|
|
208
696
|
};
|
|
209
697
|
};
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
698
|
+
createKey: {
|
|
699
|
+
requestBody: {
|
|
700
|
+
content: {
|
|
701
|
+
"application/json": {
|
|
702
|
+
/**
|
|
703
|
+
* @description Choose an `API` where this key should be created.
|
|
704
|
+
* @example api_123
|
|
705
|
+
*/
|
|
706
|
+
apiId: string;
|
|
707
|
+
/**
|
|
708
|
+
* @description To make it easier for your users to understand which product an api key belongs to, you can add prefix them.
|
|
709
|
+
*
|
|
710
|
+
* For example Stripe famously prefixes their customer ids with cus_ or their api keys with sk_live_.
|
|
711
|
+
*
|
|
712
|
+
* The underscore is automatically added if you are defining a prefix, for example: "prefix": "abc" will result in a key like abc_xxxxxxxxx
|
|
713
|
+
*/
|
|
714
|
+
prefix?: string;
|
|
715
|
+
/**
|
|
716
|
+
* @description The name for your Key. This is not customer facing.
|
|
717
|
+
* @example my key
|
|
718
|
+
*/
|
|
719
|
+
name?: string;
|
|
720
|
+
/**
|
|
721
|
+
* @description The byte length used to generate your key determines its entropy as well as its length. Higher is better, but keys become longer and more annoying to handle. The default is 16 bytes, or 2^^128 possible combinations.
|
|
722
|
+
* @default 16
|
|
723
|
+
*/
|
|
724
|
+
byteLength?: number;
|
|
725
|
+
/**
|
|
726
|
+
* @description Your user’s Id. This will provide a link between Unkey and your customer record.
|
|
727
|
+
* When validating a key, we will return this back to you, so you can clearly identify your user from their api key.
|
|
728
|
+
* @example team_123
|
|
729
|
+
*/
|
|
730
|
+
ownerId?: string;
|
|
731
|
+
/**
|
|
732
|
+
* @description This is a place for dynamic meta data, anything that feels useful for you should go here
|
|
733
|
+
* @example {
|
|
734
|
+
* "billingTier": "PRO",
|
|
735
|
+
* "trialEnds": "2023-06-16T17:16:37.161Z"
|
|
736
|
+
* }
|
|
737
|
+
*/
|
|
738
|
+
meta?: {
|
|
739
|
+
[key: string]: unknown;
|
|
740
|
+
};
|
|
741
|
+
/**
|
|
742
|
+
* @description A list of roles that this key should have. If the role does not exist, an error is thrown
|
|
743
|
+
* @example [
|
|
744
|
+
* "admin",
|
|
745
|
+
* "finance"
|
|
746
|
+
* ]
|
|
747
|
+
*/
|
|
748
|
+
roles?: string[];
|
|
749
|
+
/**
|
|
750
|
+
* @description You can auto expire keys by providing a unix timestamp in milliseconds. Once Keys expire they will automatically be disabled and are no longer valid unless you enable them again.
|
|
751
|
+
* @example 1623869797161
|
|
752
|
+
*/
|
|
753
|
+
expires?: number;
|
|
754
|
+
/**
|
|
755
|
+
* @description You can limit the number of requests a key can make. Once a key reaches 0 remaining requests, it will automatically be disabled and is no longer valid unless you update it.
|
|
756
|
+
* @example 1000
|
|
757
|
+
*/
|
|
758
|
+
remaining?: number;
|
|
759
|
+
/**
|
|
760
|
+
* @description Unkey enables you to refill verifications for each key at regular intervals.
|
|
761
|
+
* @example {
|
|
762
|
+
* "interval": "daily",
|
|
763
|
+
* "amount": 100
|
|
764
|
+
* }
|
|
765
|
+
*/
|
|
766
|
+
refill?: {
|
|
272
767
|
/**
|
|
273
|
-
* @description Unkey
|
|
274
|
-
* @
|
|
275
|
-
* "interval": "daily",
|
|
276
|
-
* "amount": 100
|
|
277
|
-
* }
|
|
768
|
+
* @description Unkey will automatically refill verifications at the set interval.
|
|
769
|
+
* @enum {string}
|
|
278
770
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
771
|
+
interval: "daily" | "monthly";
|
|
772
|
+
/** @description The number of verifications to refill for each occurrence is determined individually for each key. */
|
|
773
|
+
amount: number;
|
|
774
|
+
};
|
|
775
|
+
/**
|
|
776
|
+
* @description Unkey comes with per-key ratelimiting out of the box.
|
|
777
|
+
* @example {
|
|
778
|
+
* "type": "fast",
|
|
779
|
+
* "limit": 10,
|
|
780
|
+
* "refillRate": 1,
|
|
781
|
+
* "refillInterval": 60
|
|
782
|
+
* }
|
|
783
|
+
*/
|
|
784
|
+
ratelimit?: {
|
|
288
785
|
/**
|
|
289
|
-
* @description
|
|
290
|
-
* @
|
|
291
|
-
*
|
|
292
|
-
* "limit": 10,
|
|
293
|
-
* "refillRate": 1,
|
|
294
|
-
* "refillInterval": 60
|
|
295
|
-
* }
|
|
786
|
+
* @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.
|
|
787
|
+
* @default fast
|
|
788
|
+
* @enum {string}
|
|
296
789
|
*/
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
790
|
+
type?: "fast" | "consistent";
|
|
791
|
+
/** @description The total amount of burstable requests. */
|
|
792
|
+
limit: number;
|
|
793
|
+
/** @description How many tokens to refill during each refillInterval. */
|
|
794
|
+
refillRate: number;
|
|
795
|
+
/** @description Determines the speed at which tokens are refilled, in milliseconds. */
|
|
796
|
+
refillInterval: number;
|
|
797
|
+
};
|
|
798
|
+
/**
|
|
799
|
+
* @description Sets if key is enabled or disabled. Disabled keys are not valid.
|
|
800
|
+
* @default true
|
|
801
|
+
* @example false
|
|
802
|
+
*/
|
|
803
|
+
enabled?: boolean;
|
|
804
|
+
/**
|
|
805
|
+
* @description Environments allow you to divide your keyspace.
|
|
806
|
+
*
|
|
807
|
+
* Some applications like Stripe, Clerk, WorkOS and others have a concept of "live" and "test" keys to
|
|
808
|
+
* give the developer a way to develop their own application without the risk of modifying real world
|
|
809
|
+
* resources.
|
|
810
|
+
*
|
|
811
|
+
* When you set an environment, we will return it back to you when validating the key, so you can
|
|
812
|
+
* handle it correctly.
|
|
813
|
+
*/
|
|
814
|
+
environment?: string;
|
|
815
|
+
};
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
responses: {
|
|
819
|
+
/** @description The configuration for an api */
|
|
820
|
+
200: {
|
|
821
|
+
content: {
|
|
822
|
+
"application/json": {
|
|
311
823
|
/**
|
|
312
|
-
* @description
|
|
313
|
-
* @
|
|
314
|
-
* @example false
|
|
824
|
+
* @description The id of the key. This is not a secret and can be stored as a reference if you wish. You need the keyId to update or delete a key later.
|
|
825
|
+
* @example key_123
|
|
315
826
|
*/
|
|
316
|
-
|
|
827
|
+
keyId: string;
|
|
317
828
|
/**
|
|
318
|
-
* @description
|
|
319
|
-
*
|
|
320
|
-
* Some applications like Stripe, Clerk, WorkOS and others have a concept of "live" and "test" keys to
|
|
321
|
-
* give the developer a way to develop their own application without the risk of modifying real world
|
|
322
|
-
* resources.
|
|
323
|
-
*
|
|
324
|
-
* When you set an environment, we will return it back to you when validating the key, so you can
|
|
325
|
-
* handle it correctly.
|
|
829
|
+
* @description The newly created api key, do not store this on your own system but pass it along to your user.
|
|
830
|
+
* @example prefix_xxxxxxxxx
|
|
326
831
|
*/
|
|
327
|
-
|
|
832
|
+
key: string;
|
|
328
833
|
};
|
|
329
834
|
};
|
|
330
835
|
};
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
"application/json": {
|
|
336
|
-
/**
|
|
337
|
-
* @description The id of the key. This is not a secret and can be stored as a reference if you wish. You need the keyId to update or delete a key later.
|
|
338
|
-
* @example key_123
|
|
339
|
-
*/
|
|
340
|
-
keyId: string;
|
|
341
|
-
/**
|
|
342
|
-
* @description The newly created api key, do not store this on your own system but pass it along to your user.
|
|
343
|
-
* @example prefix_xxxxxxxxx
|
|
344
|
-
*/
|
|
345
|
-
key: string;
|
|
346
|
-
};
|
|
347
|
-
};
|
|
348
|
-
};
|
|
349
|
-
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
350
|
-
400: {
|
|
351
|
-
content: {
|
|
352
|
-
"application/json": components["schemas"]["ErrBadRequest"];
|
|
353
|
-
};
|
|
836
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
837
|
+
400: {
|
|
838
|
+
content: {
|
|
839
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
354
840
|
};
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
841
|
+
};
|
|
842
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
843
|
+
401: {
|
|
844
|
+
content: {
|
|
845
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
360
846
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
847
|
+
};
|
|
848
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
849
|
+
403: {
|
|
850
|
+
content: {
|
|
851
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
366
852
|
};
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
853
|
+
};
|
|
854
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
855
|
+
404: {
|
|
856
|
+
content: {
|
|
857
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
372
858
|
};
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
859
|
+
};
|
|
860
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
861
|
+
409: {
|
|
862
|
+
content: {
|
|
863
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
378
864
|
};
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
865
|
+
};
|
|
866
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
867
|
+
429: {
|
|
868
|
+
content: {
|
|
869
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
384
870
|
};
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
871
|
+
};
|
|
872
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
873
|
+
500: {
|
|
874
|
+
content: {
|
|
875
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
390
876
|
};
|
|
391
877
|
};
|
|
392
878
|
};
|
|
393
879
|
};
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
880
|
+
verifyKey: {
|
|
881
|
+
requestBody: {
|
|
882
|
+
content: {
|
|
883
|
+
"application/json": components["schemas"]["V1KeysVerifyKeyRequest"];
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
responses: {
|
|
887
|
+
/** @description The verification result */
|
|
888
|
+
200: {
|
|
397
889
|
content: {
|
|
398
|
-
"application/json": components["schemas"]["
|
|
890
|
+
"application/json": components["schemas"]["V1KeysVerifyKeyResponse"];
|
|
399
891
|
};
|
|
400
892
|
};
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
"application/json": components["schemas"]["V1KeysVerifyKeyResponse"];
|
|
406
|
-
};
|
|
407
|
-
};
|
|
408
|
-
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
409
|
-
400: {
|
|
410
|
-
content: {
|
|
411
|
-
"application/json": components["schemas"]["ErrBadRequest"];
|
|
412
|
-
};
|
|
893
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
894
|
+
400: {
|
|
895
|
+
content: {
|
|
896
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
413
897
|
};
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
898
|
+
};
|
|
899
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
900
|
+
401: {
|
|
901
|
+
content: {
|
|
902
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
419
903
|
};
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
904
|
+
};
|
|
905
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
906
|
+
403: {
|
|
907
|
+
content: {
|
|
908
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
425
909
|
};
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
910
|
+
};
|
|
911
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
912
|
+
404: {
|
|
913
|
+
content: {
|
|
914
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
431
915
|
};
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
916
|
+
};
|
|
917
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
918
|
+
409: {
|
|
919
|
+
content: {
|
|
920
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
437
921
|
};
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
922
|
+
};
|
|
923
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
924
|
+
429: {
|
|
925
|
+
content: {
|
|
926
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
443
927
|
};
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
928
|
+
};
|
|
929
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
930
|
+
500: {
|
|
931
|
+
content: {
|
|
932
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
449
933
|
};
|
|
450
934
|
};
|
|
451
935
|
};
|
|
452
936
|
};
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
ratelimit?: ({
|
|
501
|
-
/**
|
|
502
|
-
* @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.
|
|
503
|
-
* @enum {string}
|
|
504
|
-
*/
|
|
505
|
-
type: "fast" | "consistent";
|
|
506
|
-
/** @description The total amount of burstable requests. */
|
|
507
|
-
limit: number;
|
|
508
|
-
/** @description How many tokens to refill during each refillInterval. */
|
|
509
|
-
refillRate: number;
|
|
510
|
-
/** @description Determines the speed at which tokens are refilled, in milliseconds. */
|
|
511
|
-
refillInterval: number;
|
|
512
|
-
}) | null;
|
|
513
|
-
/**
|
|
514
|
-
* @description The number of requests that can be made with this key before it becomes invalid. Set `null` to disable.
|
|
515
|
-
* @example 1000
|
|
516
|
-
*/
|
|
517
|
-
remaining?: number | null;
|
|
937
|
+
updateKey: {
|
|
938
|
+
requestBody: {
|
|
939
|
+
content: {
|
|
940
|
+
"application/json": {
|
|
941
|
+
/**
|
|
942
|
+
* @description The id of the key you want to modify
|
|
943
|
+
* @example key_123
|
|
944
|
+
*/
|
|
945
|
+
keyId: string;
|
|
946
|
+
/**
|
|
947
|
+
* @description The name of the key
|
|
948
|
+
* @example Customer X
|
|
949
|
+
*/
|
|
950
|
+
name?: string | null;
|
|
951
|
+
/**
|
|
952
|
+
* @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API.
|
|
953
|
+
* @example user_123
|
|
954
|
+
*/
|
|
955
|
+
ownerId?: string | null;
|
|
956
|
+
/**
|
|
957
|
+
* @description Any additional metadata you want to store with the key
|
|
958
|
+
* @example {
|
|
959
|
+
* "roles": [
|
|
960
|
+
* "admin",
|
|
961
|
+
* "user"
|
|
962
|
+
* ],
|
|
963
|
+
* "stripeCustomerId": "cus_1234"
|
|
964
|
+
* }
|
|
965
|
+
*/
|
|
966
|
+
meta?: {
|
|
967
|
+
[key: string]: unknown;
|
|
968
|
+
} | null;
|
|
969
|
+
/**
|
|
970
|
+
* @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring.
|
|
971
|
+
* @example 0
|
|
972
|
+
*/
|
|
973
|
+
expires?: number | null;
|
|
974
|
+
/**
|
|
975
|
+
* @description Unkey comes with per-key ratelimiting out of the box. Set `null` to disable.
|
|
976
|
+
* @example {
|
|
977
|
+
* "type": "fast",
|
|
978
|
+
* "limit": 10,
|
|
979
|
+
* "refillRate": 1,
|
|
980
|
+
* "refillInterval": 60
|
|
981
|
+
* }
|
|
982
|
+
*/
|
|
983
|
+
ratelimit?: ({
|
|
518
984
|
/**
|
|
519
|
-
* @description
|
|
520
|
-
* @
|
|
521
|
-
* "interval": "daily",
|
|
522
|
-
* "amount": 100
|
|
523
|
-
* }
|
|
985
|
+
* @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.
|
|
986
|
+
* @enum {string}
|
|
524
987
|
*/
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
988
|
+
type: "fast" | "consistent";
|
|
989
|
+
/** @description The total amount of burstable requests. */
|
|
990
|
+
limit: number;
|
|
991
|
+
/** @description How many tokens to refill during each refillInterval. */
|
|
992
|
+
refillRate: number;
|
|
993
|
+
/** @description Determines the speed at which tokens are refilled, in milliseconds. */
|
|
994
|
+
refillInterval: number;
|
|
995
|
+
}) | null;
|
|
996
|
+
/**
|
|
997
|
+
* @description The number of requests that can be made with this key before it becomes invalid. Set `null` to disable.
|
|
998
|
+
* @example 1000
|
|
999
|
+
*/
|
|
1000
|
+
remaining?: number | null;
|
|
1001
|
+
/**
|
|
1002
|
+
* @description Unkey enables you to refill verifications for each key at regular intervals.
|
|
1003
|
+
* @example {
|
|
1004
|
+
* "interval": "daily",
|
|
1005
|
+
* "amount": 100
|
|
1006
|
+
* }
|
|
1007
|
+
*/
|
|
1008
|
+
refill?: ({
|
|
534
1009
|
/**
|
|
535
|
-
* @description
|
|
536
|
-
* @
|
|
1010
|
+
* @description Unkey will automatically refill verifications at the set interval. If null is used the refill functionality will be removed from the key.
|
|
1011
|
+
* @enum {string}
|
|
537
1012
|
*/
|
|
538
|
-
|
|
539
|
-
|
|
1013
|
+
interval: "daily" | "monthly";
|
|
1014
|
+
/** @description The amount of verifications to refill for each occurrence is determined individually for each key. */
|
|
1015
|
+
amount: number;
|
|
1016
|
+
}) | null;
|
|
1017
|
+
/**
|
|
1018
|
+
* @description Set if key is enabled or disabled. If disabled, the key cannot be used to verify.
|
|
1019
|
+
* @example true
|
|
1020
|
+
*/
|
|
1021
|
+
enabled?: boolean;
|
|
540
1022
|
};
|
|
541
1023
|
};
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
1024
|
+
};
|
|
1025
|
+
responses: {
|
|
1026
|
+
/** @description The key was successfully updated, it may take up to 30s for this to take effect in all regions */
|
|
1027
|
+
200: {
|
|
1028
|
+
content: {
|
|
1029
|
+
"application/json": Record<string, never>;
|
|
548
1030
|
};
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
1031
|
+
};
|
|
1032
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1033
|
+
400: {
|
|
1034
|
+
content: {
|
|
1035
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
554
1036
|
};
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
1037
|
+
};
|
|
1038
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1039
|
+
401: {
|
|
1040
|
+
content: {
|
|
1041
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
560
1042
|
};
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
1043
|
+
};
|
|
1044
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1045
|
+
403: {
|
|
1046
|
+
content: {
|
|
1047
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
566
1048
|
};
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
1049
|
+
};
|
|
1050
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1051
|
+
404: {
|
|
1052
|
+
content: {
|
|
1053
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
572
1054
|
};
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
1055
|
+
};
|
|
1056
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1057
|
+
409: {
|
|
1058
|
+
content: {
|
|
1059
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
578
1060
|
};
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
1061
|
+
};
|
|
1062
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1063
|
+
429: {
|
|
1064
|
+
content: {
|
|
1065
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
584
1066
|
};
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
1067
|
+
};
|
|
1068
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1069
|
+
500: {
|
|
1070
|
+
content: {
|
|
1071
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
590
1072
|
};
|
|
591
1073
|
};
|
|
592
1074
|
};
|
|
593
1075
|
};
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
1076
|
+
updateRemaining: {
|
|
1077
|
+
requestBody: {
|
|
1078
|
+
content: {
|
|
1079
|
+
"application/json": {
|
|
1080
|
+
/**
|
|
1081
|
+
* @description The id of the key you want to modify
|
|
1082
|
+
* @example key_123
|
|
1083
|
+
*/
|
|
1084
|
+
keyId: string;
|
|
1085
|
+
/**
|
|
1086
|
+
* @description The operation you want to perform on the remaining count
|
|
1087
|
+
* @enum {string}
|
|
1088
|
+
*/
|
|
1089
|
+
op: "increment" | "decrement" | "set";
|
|
1090
|
+
/**
|
|
1091
|
+
* @description The value you want to set, add or subtract the remaining count by
|
|
1092
|
+
* @example 1
|
|
1093
|
+
*/
|
|
1094
|
+
value: number | null;
|
|
1095
|
+
};
|
|
1096
|
+
};
|
|
1097
|
+
};
|
|
1098
|
+
responses: {
|
|
1099
|
+
/** @description The configuration for an api */
|
|
1100
|
+
200: {
|
|
597
1101
|
content: {
|
|
598
1102
|
"application/json": {
|
|
599
1103
|
/**
|
|
600
|
-
* @description The
|
|
601
|
-
* @example
|
|
602
|
-
*/
|
|
603
|
-
keyId: string;
|
|
604
|
-
/**
|
|
605
|
-
* @description The operation you want to perform on the remaining count
|
|
606
|
-
* @enum {string}
|
|
607
|
-
*/
|
|
608
|
-
op: "increment" | "decrement" | "set";
|
|
609
|
-
/**
|
|
610
|
-
* @description The value you want to set, add or subtract the remaining count by
|
|
611
|
-
* @example 1
|
|
1104
|
+
* @description The number of remaining requests for this key after updating it. `null` means unlimited.
|
|
1105
|
+
* @example 100
|
|
612
1106
|
*/
|
|
613
|
-
|
|
1107
|
+
remaining: number | null;
|
|
614
1108
|
};
|
|
615
1109
|
};
|
|
616
1110
|
};
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
"application/json": {
|
|
622
|
-
/**
|
|
623
|
-
* @description The number of remaining requests for this key after updating it. `null` means unlimited.
|
|
624
|
-
* @example 100
|
|
625
|
-
*/
|
|
626
|
-
remaining: number | null;
|
|
627
|
-
};
|
|
628
|
-
};
|
|
629
|
-
};
|
|
630
|
-
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
631
|
-
400: {
|
|
632
|
-
content: {
|
|
633
|
-
"application/json": components["schemas"]["ErrBadRequest"];
|
|
634
|
-
};
|
|
1111
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1112
|
+
400: {
|
|
1113
|
+
content: {
|
|
1114
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
635
1115
|
};
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
1116
|
+
};
|
|
1117
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1118
|
+
401: {
|
|
1119
|
+
content: {
|
|
1120
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
641
1121
|
};
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
1122
|
+
};
|
|
1123
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1124
|
+
403: {
|
|
1125
|
+
content: {
|
|
1126
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
647
1127
|
};
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
1128
|
+
};
|
|
1129
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1130
|
+
404: {
|
|
1131
|
+
content: {
|
|
1132
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
653
1133
|
};
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
1134
|
+
};
|
|
1135
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1136
|
+
409: {
|
|
1137
|
+
content: {
|
|
1138
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
659
1139
|
};
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
1140
|
+
};
|
|
1141
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1142
|
+
429: {
|
|
1143
|
+
content: {
|
|
1144
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
665
1145
|
};
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
1146
|
+
};
|
|
1147
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1148
|
+
500: {
|
|
1149
|
+
content: {
|
|
1150
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
671
1151
|
};
|
|
672
1152
|
};
|
|
673
1153
|
};
|
|
674
1154
|
};
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
}[];
|
|
713
|
-
};
|
|
1155
|
+
getVerifications: {
|
|
1156
|
+
parameters: {
|
|
1157
|
+
query?: {
|
|
1158
|
+
keyId?: string;
|
|
1159
|
+
ownerId?: string;
|
|
1160
|
+
start?: number | null;
|
|
1161
|
+
end?: number | null;
|
|
1162
|
+
granularity?: "day";
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
responses: {
|
|
1166
|
+
/** @description Usage numbers over time */
|
|
1167
|
+
200: {
|
|
1168
|
+
content: {
|
|
1169
|
+
"application/json": {
|
|
1170
|
+
verifications: {
|
|
1171
|
+
/**
|
|
1172
|
+
* @description The timestamp of the usage data
|
|
1173
|
+
* @example 1620000000000
|
|
1174
|
+
*/
|
|
1175
|
+
time: number;
|
|
1176
|
+
/**
|
|
1177
|
+
* @description The number of successful requests
|
|
1178
|
+
* @example 100
|
|
1179
|
+
*/
|
|
1180
|
+
success: number;
|
|
1181
|
+
/**
|
|
1182
|
+
* @description The number of requests that were rate limited
|
|
1183
|
+
* @example 10
|
|
1184
|
+
*/
|
|
1185
|
+
rateLimited: number;
|
|
1186
|
+
/**
|
|
1187
|
+
* @description The number of requests that exceeded the usage limit
|
|
1188
|
+
* @example 0
|
|
1189
|
+
*/
|
|
1190
|
+
usageExceeded: number;
|
|
1191
|
+
}[];
|
|
714
1192
|
};
|
|
715
1193
|
};
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
1194
|
+
};
|
|
1195
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1196
|
+
400: {
|
|
1197
|
+
content: {
|
|
1198
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
721
1199
|
};
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
1200
|
+
};
|
|
1201
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1202
|
+
401: {
|
|
1203
|
+
content: {
|
|
1204
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
727
1205
|
};
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
1206
|
+
};
|
|
1207
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1208
|
+
403: {
|
|
1209
|
+
content: {
|
|
1210
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
733
1211
|
};
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
1212
|
+
};
|
|
1213
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1214
|
+
404: {
|
|
1215
|
+
content: {
|
|
1216
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
739
1217
|
};
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1218
|
+
};
|
|
1219
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1220
|
+
409: {
|
|
1221
|
+
content: {
|
|
1222
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
745
1223
|
};
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
1224
|
+
};
|
|
1225
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1226
|
+
429: {
|
|
1227
|
+
content: {
|
|
1228
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
751
1229
|
};
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
1230
|
+
};
|
|
1231
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1232
|
+
500: {
|
|
1233
|
+
content: {
|
|
1234
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
757
1235
|
};
|
|
758
1236
|
};
|
|
759
1237
|
};
|
|
760
1238
|
};
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
apiId: string;
|
|
766
|
-
};
|
|
1239
|
+
getApi: {
|
|
1240
|
+
parameters: {
|
|
1241
|
+
query: {
|
|
1242
|
+
apiId: string;
|
|
767
1243
|
};
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
1244
|
+
};
|
|
1245
|
+
responses: {
|
|
1246
|
+
/** @description The configuration for an api */
|
|
1247
|
+
200: {
|
|
1248
|
+
content: {
|
|
1249
|
+
"application/json": {
|
|
1250
|
+
/**
|
|
1251
|
+
* @description The id of the key
|
|
1252
|
+
* @example key_1234
|
|
1253
|
+
*/
|
|
1254
|
+
id: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* @description The id of the workspace that owns the api
|
|
1257
|
+
* @example ws_1234
|
|
1258
|
+
*/
|
|
1259
|
+
workspaceId: string;
|
|
1260
|
+
/**
|
|
1261
|
+
* @description The name of the api. This is internal and your users will not see this.
|
|
1262
|
+
* @example Unkey - Production
|
|
1263
|
+
*/
|
|
1264
|
+
name?: string;
|
|
789
1265
|
};
|
|
790
1266
|
};
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
1267
|
+
};
|
|
1268
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1269
|
+
400: {
|
|
1270
|
+
content: {
|
|
1271
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
796
1272
|
};
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
1273
|
+
};
|
|
1274
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1275
|
+
401: {
|
|
1276
|
+
content: {
|
|
1277
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
802
1278
|
};
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
1279
|
+
};
|
|
1280
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1281
|
+
403: {
|
|
1282
|
+
content: {
|
|
1283
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
808
1284
|
};
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1285
|
+
};
|
|
1286
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1287
|
+
404: {
|
|
1288
|
+
content: {
|
|
1289
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
814
1290
|
};
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
1291
|
+
};
|
|
1292
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1293
|
+
409: {
|
|
1294
|
+
content: {
|
|
1295
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
820
1296
|
};
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
1297
|
+
};
|
|
1298
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1299
|
+
429: {
|
|
1300
|
+
content: {
|
|
1301
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
826
1302
|
};
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
1303
|
+
};
|
|
1304
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1305
|
+
500: {
|
|
1306
|
+
content: {
|
|
1307
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
832
1308
|
};
|
|
833
1309
|
};
|
|
834
1310
|
};
|
|
835
1311
|
};
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1312
|
+
createApi: {
|
|
1313
|
+
requestBody: {
|
|
1314
|
+
content: {
|
|
1315
|
+
"application/json": {
|
|
1316
|
+
/**
|
|
1317
|
+
* @description The name for your API. This is not customer facing.
|
|
1318
|
+
* @example my-api
|
|
1319
|
+
*/
|
|
1320
|
+
name: string;
|
|
1321
|
+
};
|
|
1322
|
+
};
|
|
1323
|
+
};
|
|
1324
|
+
responses: {
|
|
1325
|
+
/** @description The configuration for an api */
|
|
1326
|
+
200: {
|
|
839
1327
|
content: {
|
|
840
1328
|
"application/json": {
|
|
841
1329
|
/**
|
|
842
|
-
* @description The
|
|
843
|
-
* @example
|
|
1330
|
+
* @description The id of the api
|
|
1331
|
+
* @example api_134
|
|
844
1332
|
*/
|
|
845
|
-
|
|
1333
|
+
apiId: string;
|
|
846
1334
|
};
|
|
847
1335
|
};
|
|
848
1336
|
};
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
"application/json": {
|
|
854
|
-
/**
|
|
855
|
-
* @description The id of the api
|
|
856
|
-
* @example api_134
|
|
857
|
-
*/
|
|
858
|
-
apiId: string;
|
|
859
|
-
};
|
|
860
|
-
};
|
|
861
|
-
};
|
|
862
|
-
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
863
|
-
400: {
|
|
864
|
-
content: {
|
|
865
|
-
"application/json": components["schemas"]["ErrBadRequest"];
|
|
866
|
-
};
|
|
1337
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1338
|
+
400: {
|
|
1339
|
+
content: {
|
|
1340
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
867
1341
|
};
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
1342
|
+
};
|
|
1343
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1344
|
+
401: {
|
|
1345
|
+
content: {
|
|
1346
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
873
1347
|
};
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
1348
|
+
};
|
|
1349
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1350
|
+
403: {
|
|
1351
|
+
content: {
|
|
1352
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
879
1353
|
};
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
1354
|
+
};
|
|
1355
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1356
|
+
404: {
|
|
1357
|
+
content: {
|
|
1358
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
885
1359
|
};
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
1360
|
+
};
|
|
1361
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1362
|
+
409: {
|
|
1363
|
+
content: {
|
|
1364
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
891
1365
|
};
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1366
|
+
};
|
|
1367
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1368
|
+
429: {
|
|
1369
|
+
content: {
|
|
1370
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
897
1371
|
};
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1372
|
+
};
|
|
1373
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1374
|
+
500: {
|
|
1375
|
+
content: {
|
|
1376
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
903
1377
|
};
|
|
904
1378
|
};
|
|
905
1379
|
};
|
|
906
1380
|
};
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
ownerId?: string;
|
|
915
|
-
};
|
|
1381
|
+
listKeys: {
|
|
1382
|
+
parameters: {
|
|
1383
|
+
query: {
|
|
1384
|
+
apiId: string;
|
|
1385
|
+
limit?: number;
|
|
1386
|
+
cursor?: string;
|
|
1387
|
+
ownerId?: string;
|
|
916
1388
|
};
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1389
|
+
};
|
|
1390
|
+
responses: {
|
|
1391
|
+
/** @description The configuration for an api */
|
|
1392
|
+
200: {
|
|
1393
|
+
content: {
|
|
1394
|
+
"application/json": {
|
|
1395
|
+
keys: components["schemas"]["Key"][];
|
|
1396
|
+
/**
|
|
1397
|
+
* @description The cursor to use for the next page of results, if no cursor is returned, there are no more results
|
|
1398
|
+
* @example eyJrZXkiOiJrZXlfMTIzNCJ9
|
|
1399
|
+
*/
|
|
1400
|
+
cursor?: string;
|
|
1401
|
+
/** @description The total number of keys for this api */
|
|
1402
|
+
total: number;
|
|
931
1403
|
};
|
|
932
1404
|
};
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
1405
|
+
};
|
|
1406
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1407
|
+
400: {
|
|
1408
|
+
content: {
|
|
1409
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
938
1410
|
};
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
1411
|
+
};
|
|
1412
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1413
|
+
401: {
|
|
1414
|
+
content: {
|
|
1415
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
944
1416
|
};
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
1417
|
+
};
|
|
1418
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1419
|
+
403: {
|
|
1420
|
+
content: {
|
|
1421
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
950
1422
|
};
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1423
|
+
};
|
|
1424
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1425
|
+
404: {
|
|
1426
|
+
content: {
|
|
1427
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
956
1428
|
};
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1429
|
+
};
|
|
1430
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1431
|
+
409: {
|
|
1432
|
+
content: {
|
|
1433
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
962
1434
|
};
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1435
|
+
};
|
|
1436
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1437
|
+
429: {
|
|
1438
|
+
content: {
|
|
1439
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
968
1440
|
};
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
1441
|
+
};
|
|
1442
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1443
|
+
500: {
|
|
1444
|
+
content: {
|
|
1445
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
974
1446
|
};
|
|
975
1447
|
};
|
|
976
1448
|
};
|
|
977
1449
|
};
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
apiId: string;
|
|
988
|
-
};
|
|
1450
|
+
deleteApi: {
|
|
1451
|
+
requestBody: {
|
|
1452
|
+
content: {
|
|
1453
|
+
"application/json": {
|
|
1454
|
+
/**
|
|
1455
|
+
* @description The id of the api to delete
|
|
1456
|
+
* @example api_1234
|
|
1457
|
+
*/
|
|
1458
|
+
apiId: string;
|
|
989
1459
|
};
|
|
990
1460
|
};
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1461
|
+
};
|
|
1462
|
+
responses: {
|
|
1463
|
+
/** @description The api was successfully deleted, it may take up to 30s for this to take effect in all regions */
|
|
1464
|
+
200: {
|
|
1465
|
+
content: {
|
|
1466
|
+
"application/json": Record<string, never>;
|
|
997
1467
|
};
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1468
|
+
};
|
|
1469
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1470
|
+
400: {
|
|
1471
|
+
content: {
|
|
1472
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
1003
1473
|
};
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1474
|
+
};
|
|
1475
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1476
|
+
401: {
|
|
1477
|
+
content: {
|
|
1478
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
1009
1479
|
};
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1480
|
+
};
|
|
1481
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1482
|
+
403: {
|
|
1483
|
+
content: {
|
|
1484
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
1015
1485
|
};
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1486
|
+
};
|
|
1487
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1488
|
+
404: {
|
|
1489
|
+
content: {
|
|
1490
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
1021
1491
|
};
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1492
|
+
};
|
|
1493
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1494
|
+
409: {
|
|
1495
|
+
content: {
|
|
1496
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
1027
1497
|
};
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1498
|
+
};
|
|
1499
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1500
|
+
429: {
|
|
1501
|
+
content: {
|
|
1502
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
1033
1503
|
};
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1504
|
+
};
|
|
1505
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1506
|
+
500: {
|
|
1507
|
+
content: {
|
|
1508
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
1039
1509
|
};
|
|
1040
1510
|
};
|
|
1041
1511
|
};
|
|
1042
1512
|
};
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1513
|
+
limit: {
|
|
1514
|
+
requestBody: {
|
|
1515
|
+
content: {
|
|
1516
|
+
"application/json": {
|
|
1517
|
+
/**
|
|
1518
|
+
* @description Namespaces group different limits together for better analytics. You might have a namespace for your public API and one for internal tRPC routes.
|
|
1519
|
+
* @default default
|
|
1520
|
+
* @example email.outbound
|
|
1521
|
+
*/
|
|
1522
|
+
namespace?: string;
|
|
1523
|
+
/**
|
|
1524
|
+
* @description Identifier of your user, this can be their userId, an email, an ip or anything else.
|
|
1525
|
+
* @example user_123
|
|
1526
|
+
*/
|
|
1527
|
+
identifier: string;
|
|
1528
|
+
/**
|
|
1529
|
+
* @description How many requests may pass in a given window.
|
|
1530
|
+
* @example 10
|
|
1531
|
+
*/
|
|
1532
|
+
limit: number;
|
|
1533
|
+
/**
|
|
1534
|
+
* @description The window duration in milliseconds
|
|
1535
|
+
* @example 60000
|
|
1536
|
+
*/
|
|
1537
|
+
duration: number;
|
|
1538
|
+
/**
|
|
1539
|
+
* @description Expensive requests may use up more tokens. You can specify a cost to the request here and we'll deduct this many tokens in the current window. If there are not enough tokens left, the request is denied.
|
|
1540
|
+
* @default 1
|
|
1541
|
+
* @example 2
|
|
1542
|
+
*/
|
|
1543
|
+
cost?: number;
|
|
1544
|
+
/**
|
|
1545
|
+
* @description Async will return a response immediately, lowering latency at the cost of accuracy.
|
|
1546
|
+
* @default false
|
|
1547
|
+
*/
|
|
1548
|
+
async?: boolean;
|
|
1549
|
+
/** @description Attach any metadata to this request */
|
|
1550
|
+
meta?: {
|
|
1551
|
+
[key: string]: unknown;
|
|
1552
|
+
};
|
|
1553
|
+
/**
|
|
1554
|
+
* @description Resources that are about to be accessed by the user
|
|
1555
|
+
* @example [
|
|
1556
|
+
* {
|
|
1557
|
+
* "type": "project",
|
|
1558
|
+
* "id": "p_123",
|
|
1559
|
+
* "name": "dub"
|
|
1560
|
+
* }
|
|
1561
|
+
* ]
|
|
1562
|
+
*/
|
|
1563
|
+
resources?: {
|
|
1564
|
+
/**
|
|
1565
|
+
* @description The type of resource
|
|
1566
|
+
* @example organization
|
|
1567
|
+
*/
|
|
1568
|
+
type: string;
|
|
1569
|
+
/**
|
|
1570
|
+
* @description The unique identifier for the resource
|
|
1571
|
+
* @example org_123
|
|
1572
|
+
*/
|
|
1573
|
+
id: string;
|
|
1574
|
+
/**
|
|
1575
|
+
* @description A human readable name for this resource
|
|
1576
|
+
* @example unkey
|
|
1577
|
+
*/
|
|
1578
|
+
name?: string;
|
|
1579
|
+
/** @description Attach any metadata to this resources */
|
|
1580
|
+
meta?: {
|
|
1581
|
+
[key: string]: unknown;
|
|
1582
|
+
};
|
|
1583
|
+
}[];
|
|
1584
|
+
};
|
|
1585
|
+
};
|
|
1586
|
+
};
|
|
1587
|
+
responses: {
|
|
1588
|
+
200: {
|
|
1046
1589
|
content: {
|
|
1047
1590
|
"application/json": {
|
|
1048
1591
|
/**
|
|
1049
|
-
* @description
|
|
1050
|
-
* @
|
|
1051
|
-
* @example email.outbound
|
|
1052
|
-
*/
|
|
1053
|
-
namespace?: string;
|
|
1054
|
-
/**
|
|
1055
|
-
* @description Identifier of your user, this can be their userId, an email, an ip or anything else.
|
|
1056
|
-
* @example user_123
|
|
1592
|
+
* @description Returns true if the request should be processed, false if it was rejected.
|
|
1593
|
+
* @example true
|
|
1057
1594
|
*/
|
|
1058
|
-
|
|
1595
|
+
success: boolean;
|
|
1059
1596
|
/**
|
|
1060
|
-
* @description How many requests
|
|
1597
|
+
* @description How many requests are allowed within a window.
|
|
1061
1598
|
* @example 10
|
|
1062
1599
|
*/
|
|
1063
1600
|
limit: number;
|
|
1064
1601
|
/**
|
|
1065
|
-
* @description
|
|
1066
|
-
* @example
|
|
1067
|
-
*/
|
|
1068
|
-
duration: number;
|
|
1069
|
-
/**
|
|
1070
|
-
* @description Expensive requests may use up more tokens. You can specify a cost to the request here and we'll deduct this many tokens in the current window. If there are not enough tokens left, the request is denied.
|
|
1071
|
-
* @default 1
|
|
1072
|
-
* @example 2
|
|
1073
|
-
*/
|
|
1074
|
-
cost?: number;
|
|
1075
|
-
/**
|
|
1076
|
-
* @description Async will return a response immediately, lowering latency at the cost of accuracy.
|
|
1077
|
-
* @default false
|
|
1602
|
+
* @description How many requests can still be made in the current window.
|
|
1603
|
+
* @example 9
|
|
1078
1604
|
*/
|
|
1079
|
-
|
|
1080
|
-
/** @description Attach any metadata to this request */
|
|
1081
|
-
meta?: {
|
|
1082
|
-
[key: string]: unknown;
|
|
1083
|
-
};
|
|
1605
|
+
remaining: number;
|
|
1084
1606
|
/**
|
|
1085
|
-
* @description
|
|
1086
|
-
* @example
|
|
1087
|
-
* {
|
|
1088
|
-
* "type": "project",
|
|
1089
|
-
* "id": "p_123",
|
|
1090
|
-
* "name": "dub"
|
|
1091
|
-
* }
|
|
1092
|
-
* ]
|
|
1607
|
+
* @description A unix millisecond timestamp when the limits reset.
|
|
1608
|
+
* @example 1709804263654
|
|
1093
1609
|
*/
|
|
1094
|
-
|
|
1095
|
-
/**
|
|
1096
|
-
* @description The type of resource
|
|
1097
|
-
* @example organization
|
|
1098
|
-
*/
|
|
1099
|
-
type: string;
|
|
1100
|
-
/**
|
|
1101
|
-
* @description The unique identifier for the resource
|
|
1102
|
-
* @example org_123
|
|
1103
|
-
*/
|
|
1104
|
-
id: string;
|
|
1105
|
-
/**
|
|
1106
|
-
* @description A human readable name for this resource
|
|
1107
|
-
* @example unkey
|
|
1108
|
-
*/
|
|
1109
|
-
name?: string;
|
|
1110
|
-
/** @description Attach any metadata to this resources */
|
|
1111
|
-
meta?: {
|
|
1112
|
-
[key: string]: unknown;
|
|
1113
|
-
};
|
|
1114
|
-
}[];
|
|
1610
|
+
reset: number;
|
|
1115
1611
|
};
|
|
1116
1612
|
};
|
|
1117
1613
|
};
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
/**
|
|
1123
|
-
* @description Returns true if the request should be processed, false if it was rejected.
|
|
1124
|
-
* @example true
|
|
1125
|
-
*/
|
|
1126
|
-
success: boolean;
|
|
1127
|
-
/**
|
|
1128
|
-
* @description How many requests are allowed within a window.
|
|
1129
|
-
* @example 10
|
|
1130
|
-
*/
|
|
1131
|
-
limit: number;
|
|
1132
|
-
/**
|
|
1133
|
-
* @description How many requests can still be made in the current window.
|
|
1134
|
-
* @example 9
|
|
1135
|
-
*/
|
|
1136
|
-
remaining: number;
|
|
1137
|
-
/**
|
|
1138
|
-
* @description A unix millisecond timestamp when the limits reset.
|
|
1139
|
-
* @example 1709804263654
|
|
1140
|
-
*/
|
|
1141
|
-
reset: number;
|
|
1142
|
-
};
|
|
1143
|
-
};
|
|
1144
|
-
};
|
|
1145
|
-
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1146
|
-
400: {
|
|
1147
|
-
content: {
|
|
1148
|
-
"application/json": components["schemas"]["ErrBadRequest"];
|
|
1149
|
-
};
|
|
1614
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1615
|
+
400: {
|
|
1616
|
+
content: {
|
|
1617
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
1150
1618
|
};
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1619
|
+
};
|
|
1620
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1621
|
+
401: {
|
|
1622
|
+
content: {
|
|
1623
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
1156
1624
|
};
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1625
|
+
};
|
|
1626
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1627
|
+
403: {
|
|
1628
|
+
content: {
|
|
1629
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
1162
1630
|
};
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1631
|
+
};
|
|
1632
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1633
|
+
404: {
|
|
1634
|
+
content: {
|
|
1635
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
1168
1636
|
};
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1637
|
+
};
|
|
1638
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1639
|
+
409: {
|
|
1640
|
+
content: {
|
|
1641
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
1174
1642
|
};
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1643
|
+
};
|
|
1644
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1645
|
+
429: {
|
|
1646
|
+
content: {
|
|
1647
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
1180
1648
|
};
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1649
|
+
};
|
|
1650
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1651
|
+
500: {
|
|
1652
|
+
content: {
|
|
1653
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
1186
1654
|
};
|
|
1187
1655
|
};
|
|
1188
1656
|
};
|
|
1189
1657
|
};
|
|
1190
|
-
"
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
"application/json": {
|
|
1658
|
+
"v1.migrations.createKeys": {
|
|
1659
|
+
requestBody: {
|
|
1660
|
+
content: {
|
|
1661
|
+
"application/json": ({
|
|
1195
1662
|
/**
|
|
1196
1663
|
* @description Choose an `API` where this key should be created.
|
|
1197
1664
|
* @example api_123
|
|
@@ -1210,11 +1677,21 @@ interface paths {
|
|
|
1210
1677
|
* @example my key
|
|
1211
1678
|
*/
|
|
1212
1679
|
name?: string;
|
|
1680
|
+
hash: {
|
|
1681
|
+
/** @description The hashed and encoded key */
|
|
1682
|
+
value: string;
|
|
1683
|
+
/**
|
|
1684
|
+
* @description The algorithm for hashing and encoding, currently only sha256 and base64 are supported
|
|
1685
|
+
* @enum {string}
|
|
1686
|
+
*/
|
|
1687
|
+
variant: "sha256_base64";
|
|
1688
|
+
};
|
|
1213
1689
|
/**
|
|
1214
|
-
* @description The
|
|
1215
|
-
* @default
|
|
1690
|
+
* @description The first 4 characters of the key. If a prefix is used, it should be the prefix plus 4 characters.
|
|
1691
|
+
* @default
|
|
1692
|
+
* @example unkey_32kq
|
|
1216
1693
|
*/
|
|
1217
|
-
|
|
1694
|
+
start?: string;
|
|
1218
1695
|
/**
|
|
1219
1696
|
* @description Your user’s Id. This will provide a link between Unkey and your customer record.
|
|
1220
1697
|
* When validating a key, we will return this back to you, so you can clearly identify your user from their api key.
|
|
@@ -1231,6 +1708,14 @@ interface paths {
|
|
|
1231
1708
|
meta?: {
|
|
1232
1709
|
[key: string]: unknown;
|
|
1233
1710
|
};
|
|
1711
|
+
/**
|
|
1712
|
+
* @description A list of roles that this key should have. If the role does not exist, an error is thrown
|
|
1713
|
+
* @example [
|
|
1714
|
+
* "admin",
|
|
1715
|
+
* "finance"
|
|
1716
|
+
* ]
|
|
1717
|
+
*/
|
|
1718
|
+
roles?: string[];
|
|
1234
1719
|
/**
|
|
1235
1720
|
* @description You can auto expire keys by providing a unix timestamp in milliseconds. Once Keys expire they will automatically be disabled and are no longer valid unless you enable them again.
|
|
1236
1721
|
* @example 1623869797161
|
|
@@ -1241,6 +1726,22 @@ interface paths {
|
|
|
1241
1726
|
* @example 1000
|
|
1242
1727
|
*/
|
|
1243
1728
|
remaining?: number;
|
|
1729
|
+
/**
|
|
1730
|
+
* @description Unkey enables you to refill verifications for each key at regular intervals.
|
|
1731
|
+
* @example {
|
|
1732
|
+
* "interval": "daily",
|
|
1733
|
+
* "amount": 100
|
|
1734
|
+
* }
|
|
1735
|
+
*/
|
|
1736
|
+
refill?: {
|
|
1737
|
+
/**
|
|
1738
|
+
* @description Unkey will automatically refill verifications at the set interval.
|
|
1739
|
+
* @enum {string}
|
|
1740
|
+
*/
|
|
1741
|
+
interval: "daily" | "monthly";
|
|
1742
|
+
/** @description The number of verifications to refill for each occurrence is determined individually for each key. */
|
|
1743
|
+
amount: number;
|
|
1744
|
+
};
|
|
1244
1745
|
/**
|
|
1245
1746
|
* @description Unkey comes with per-key ratelimiting out of the box.
|
|
1246
1747
|
* @example {
|
|
@@ -1264,735 +1765,456 @@ interface paths {
|
|
|
1264
1765
|
/** @description Determines the speed at which tokens are refilled, in milliseconds. */
|
|
1265
1766
|
refillInterval: number;
|
|
1266
1767
|
};
|
|
1768
|
+
/**
|
|
1769
|
+
* @description Sets if key is enabled or disabled. Disabled keys are not valid.
|
|
1770
|
+
* @default true
|
|
1771
|
+
* @example false
|
|
1772
|
+
*/
|
|
1773
|
+
enabled?: boolean;
|
|
1774
|
+
/**
|
|
1775
|
+
* @description Environments allow you to divide your keyspace.
|
|
1776
|
+
*
|
|
1777
|
+
* Some applications like Stripe, Clerk, WorkOS and others have a concept of "live" and "test" keys to
|
|
1778
|
+
* give the developer a way to develop their own application without the risk of modifying real world
|
|
1779
|
+
* resources.
|
|
1780
|
+
*
|
|
1781
|
+
* When you set an environment, we will return it back to you when validating the key, so you can
|
|
1782
|
+
* handle it correctly.
|
|
1783
|
+
*/
|
|
1784
|
+
environment?: string;
|
|
1785
|
+
})[];
|
|
1786
|
+
};
|
|
1787
|
+
};
|
|
1788
|
+
responses: {
|
|
1789
|
+
/** @description The key ids of all created keys */
|
|
1790
|
+
200: {
|
|
1791
|
+
content: {
|
|
1792
|
+
"application/json": {
|
|
1793
|
+
/**
|
|
1794
|
+
* @description The ids of the keys. This is not a secret and can be stored as a reference if you wish. You need the keyId to update or delete a key later.
|
|
1795
|
+
* @example [
|
|
1796
|
+
* "key_123",
|
|
1797
|
+
* "key_456"
|
|
1798
|
+
* ]
|
|
1799
|
+
*/
|
|
1800
|
+
keyIds: string[];
|
|
1267
1801
|
};
|
|
1268
1802
|
};
|
|
1269
1803
|
};
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
"application/json": {
|
|
1275
|
-
/**
|
|
1276
|
-
* @description The id of the key. This is not a secret and can be stored as a reference if you wish. You need the keyId to update or delete a key later.
|
|
1277
|
-
* @example key_123
|
|
1278
|
-
*/
|
|
1279
|
-
keyId: string;
|
|
1280
|
-
/**
|
|
1281
|
-
* @description The newly created api key, do not store this on your own system but pass it along to your user.
|
|
1282
|
-
* @example prefix_xxxxxxxxx
|
|
1283
|
-
*/
|
|
1284
|
-
key: string;
|
|
1285
|
-
};
|
|
1286
|
-
};
|
|
1804
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1805
|
+
400: {
|
|
1806
|
+
content: {
|
|
1807
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
1287
1808
|
};
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1809
|
+
};
|
|
1810
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1811
|
+
401: {
|
|
1812
|
+
content: {
|
|
1813
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
1293
1814
|
};
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1815
|
+
};
|
|
1816
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1817
|
+
403: {
|
|
1818
|
+
content: {
|
|
1819
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
1299
1820
|
};
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1821
|
+
};
|
|
1822
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1823
|
+
404: {
|
|
1824
|
+
content: {
|
|
1825
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
1305
1826
|
};
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1827
|
+
};
|
|
1828
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1829
|
+
409: {
|
|
1830
|
+
content: {
|
|
1831
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
1311
1832
|
};
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1833
|
+
};
|
|
1834
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1835
|
+
429: {
|
|
1836
|
+
content: {
|
|
1837
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
1317
1838
|
};
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1839
|
+
};
|
|
1840
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1841
|
+
500: {
|
|
1842
|
+
content: {
|
|
1843
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
1323
1844
|
};
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1845
|
+
};
|
|
1846
|
+
};
|
|
1847
|
+
};
|
|
1848
|
+
"deprecated.createKey": {
|
|
1849
|
+
requestBody: {
|
|
1850
|
+
content: {
|
|
1851
|
+
"application/json": {
|
|
1852
|
+
/**
|
|
1853
|
+
* @description Choose an `API` where this key should be created.
|
|
1854
|
+
* @example api_123
|
|
1855
|
+
*/
|
|
1856
|
+
apiId: string;
|
|
1857
|
+
/**
|
|
1858
|
+
* @description To make it easier for your users to understand which product an api key belongs to, you can add prefix them.
|
|
1859
|
+
*
|
|
1860
|
+
* For example Stripe famously prefixes their customer ids with cus_ or their api keys with sk_live_.
|
|
1861
|
+
*
|
|
1862
|
+
* The underscore is automatically added if you are defining a prefix, for example: "prefix": "abc" will result in a key like abc_xxxxxxxxx
|
|
1863
|
+
*/
|
|
1864
|
+
prefix?: string;
|
|
1865
|
+
/**
|
|
1866
|
+
* @description The name for your Key. This is not customer facing.
|
|
1867
|
+
* @example my key
|
|
1868
|
+
*/
|
|
1869
|
+
name?: string;
|
|
1870
|
+
/**
|
|
1871
|
+
* @description The byte length used to generate your key determines its entropy as well as its length. Higher is better, but keys become longer and more annoying to handle. The default is 16 bytes, or 2^^128 possible combinations.
|
|
1872
|
+
* @default 16
|
|
1873
|
+
*/
|
|
1874
|
+
byteLength?: number;
|
|
1875
|
+
/**
|
|
1876
|
+
* @description Your user’s Id. This will provide a link between Unkey and your customer record.
|
|
1877
|
+
* When validating a key, we will return this back to you, so you can clearly identify your user from their api key.
|
|
1878
|
+
* @example team_123
|
|
1879
|
+
*/
|
|
1880
|
+
ownerId?: string;
|
|
1881
|
+
/**
|
|
1882
|
+
* @description This is a place for dynamic meta data, anything that feels useful for you should go here
|
|
1883
|
+
* @example {
|
|
1884
|
+
* "billingTier": "PRO",
|
|
1885
|
+
* "trialEnds": "2023-06-16T17:16:37.161Z"
|
|
1886
|
+
* }
|
|
1887
|
+
*/
|
|
1888
|
+
meta?: {
|
|
1889
|
+
[key: string]: unknown;
|
|
1890
|
+
};
|
|
1891
|
+
/**
|
|
1892
|
+
* @description You can auto expire keys by providing a unix timestamp in milliseconds. Once Keys expire they will automatically be disabled and are no longer valid unless you enable them again.
|
|
1893
|
+
* @example 1623869797161
|
|
1894
|
+
*/
|
|
1895
|
+
expires?: number;
|
|
1896
|
+
/**
|
|
1897
|
+
* @description You can limit the number of requests a key can make. Once a key reaches 0 remaining requests, it will automatically be disabled and is no longer valid unless you update it.
|
|
1898
|
+
* @example 1000
|
|
1899
|
+
*/
|
|
1900
|
+
remaining?: number;
|
|
1901
|
+
/**
|
|
1902
|
+
* @description Unkey comes with per-key ratelimiting out of the box.
|
|
1903
|
+
* @example {
|
|
1904
|
+
* "type": "fast",
|
|
1905
|
+
* "limit": 10,
|
|
1906
|
+
* "refillRate": 1,
|
|
1907
|
+
* "refillInterval": 60
|
|
1908
|
+
* }
|
|
1909
|
+
*/
|
|
1910
|
+
ratelimit?: {
|
|
1911
|
+
/**
|
|
1912
|
+
* @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.
|
|
1913
|
+
* @default fast
|
|
1914
|
+
* @enum {string}
|
|
1915
|
+
*/
|
|
1916
|
+
type?: "fast" | "consistent";
|
|
1917
|
+
/** @description The total amount of burstable requests. */
|
|
1918
|
+
limit: number;
|
|
1919
|
+
/** @description How many tokens to refill during each refillInterval. */
|
|
1920
|
+
refillRate: number;
|
|
1921
|
+
/** @description Determines the speed at which tokens are refilled, in milliseconds. */
|
|
1922
|
+
refillInterval: number;
|
|
1328
1923
|
};
|
|
1329
1924
|
};
|
|
1330
1925
|
};
|
|
1331
1926
|
};
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
requestBody: {
|
|
1927
|
+
responses: {
|
|
1928
|
+
/** @description The configuration for an api */
|
|
1929
|
+
200: {
|
|
1336
1930
|
content: {
|
|
1337
1931
|
"application/json": {
|
|
1338
1932
|
/**
|
|
1339
|
-
* @description The id of the
|
|
1340
|
-
*
|
|
1341
|
-
* @example api_1234
|
|
1933
|
+
* @description The id of the key. This is not a secret and can be stored as a reference if you wish. You need the keyId to update or delete a key later.
|
|
1934
|
+
* @example key_123
|
|
1342
1935
|
*/
|
|
1343
|
-
|
|
1936
|
+
keyId: string;
|
|
1344
1937
|
/**
|
|
1345
|
-
* @description The key to
|
|
1346
|
-
* @example
|
|
1938
|
+
* @description The newly created api key, do not store this on your own system but pass it along to your user.
|
|
1939
|
+
* @example prefix_xxxxxxxxx
|
|
1347
1940
|
*/
|
|
1348
1941
|
key: string;
|
|
1349
1942
|
};
|
|
1350
1943
|
};
|
|
1351
1944
|
};
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1945
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1946
|
+
400: {
|
|
1947
|
+
content: {
|
|
1948
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
1949
|
+
};
|
|
1950
|
+
};
|
|
1951
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1952
|
+
401: {
|
|
1953
|
+
content: {
|
|
1954
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
1955
|
+
};
|
|
1956
|
+
};
|
|
1957
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1958
|
+
403: {
|
|
1959
|
+
content: {
|
|
1960
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
1961
|
+
};
|
|
1962
|
+
};
|
|
1963
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1964
|
+
404: {
|
|
1965
|
+
content: {
|
|
1966
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
1967
|
+
};
|
|
1968
|
+
};
|
|
1969
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1970
|
+
409: {
|
|
1971
|
+
content: {
|
|
1972
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
1973
|
+
};
|
|
1974
|
+
};
|
|
1975
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1976
|
+
429: {
|
|
1977
|
+
content: {
|
|
1978
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1982
|
+
500: {
|
|
1983
|
+
content: {
|
|
1984
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
1985
|
+
};
|
|
1986
|
+
};
|
|
1987
|
+
};
|
|
1988
|
+
};
|
|
1989
|
+
/** @deprecated */
|
|
1990
|
+
"deprecated.verifyKey": {
|
|
1991
|
+
requestBody: {
|
|
1992
|
+
content: {
|
|
1993
|
+
"application/json": {
|
|
1994
|
+
/**
|
|
1995
|
+
* @description The id of the api where the key belongs to. This is optional for now but will be required soon.
|
|
1996
|
+
* The key will be verified against the api's configuration. If the key does not belong to the api, the verification will fail.
|
|
1997
|
+
* @example api_1234
|
|
1998
|
+
*/
|
|
1999
|
+
apiId?: string;
|
|
2000
|
+
/**
|
|
2001
|
+
* @description The key to verify
|
|
2002
|
+
* @example sk_1234
|
|
2003
|
+
*/
|
|
2004
|
+
key: string;
|
|
2005
|
+
};
|
|
2006
|
+
};
|
|
2007
|
+
};
|
|
2008
|
+
responses: {
|
|
2009
|
+
/** @description The verification result */
|
|
2010
|
+
200: {
|
|
2011
|
+
content: {
|
|
2012
|
+
"application/json": {
|
|
2013
|
+
/**
|
|
2014
|
+
* @description The id of the key
|
|
2015
|
+
* @example key_1234
|
|
2016
|
+
*/
|
|
2017
|
+
keyId?: string;
|
|
2018
|
+
/**
|
|
2019
|
+
* @description Whether the key is valid or not.
|
|
2020
|
+
* A key could be invalid for a number of reasons, for example if it has expired, has no more verifications left or if it has been deleted.
|
|
2021
|
+
* @example true
|
|
2022
|
+
*/
|
|
2023
|
+
valid: boolean;
|
|
2024
|
+
/**
|
|
2025
|
+
* @description The name of the key, give keys a name to easily identifiy their purpose
|
|
2026
|
+
* @example Customer X
|
|
2027
|
+
*/
|
|
2028
|
+
name?: string;
|
|
2029
|
+
/**
|
|
2030
|
+
* @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API.
|
|
2031
|
+
* @example user_123
|
|
2032
|
+
*/
|
|
2033
|
+
ownerId?: string;
|
|
2034
|
+
/**
|
|
2035
|
+
* @description Any additional metadata you want to store with the key
|
|
2036
|
+
* @example {
|
|
2037
|
+
* "roles": [
|
|
2038
|
+
* "admin",
|
|
2039
|
+
* "user"
|
|
2040
|
+
* ],
|
|
2041
|
+
* "stripeCustomerId": "cus_1234"
|
|
2042
|
+
* }
|
|
2043
|
+
*/
|
|
2044
|
+
meta?: {
|
|
2045
|
+
[key: string]: unknown;
|
|
2046
|
+
};
|
|
2047
|
+
/**
|
|
2048
|
+
* @description The unix timestamp in milliseconds when the key was created
|
|
2049
|
+
* @example 0
|
|
2050
|
+
*/
|
|
2051
|
+
createdAt?: number;
|
|
2052
|
+
/**
|
|
2053
|
+
* @description The unix timestamp in milliseconds when the key was deleted. We don't delete the key outright, you can restore it later.
|
|
2054
|
+
* @example 0
|
|
2055
|
+
*/
|
|
2056
|
+
deletedAt?: number;
|
|
2057
|
+
/**
|
|
2058
|
+
* @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring.
|
|
2059
|
+
* @example 123
|
|
2060
|
+
*/
|
|
2061
|
+
expires?: number;
|
|
2062
|
+
/**
|
|
2063
|
+
* @description The ratelimit configuration for this key. If this field is null or undefined, the key has no ratelimit.
|
|
2064
|
+
* @example {
|
|
2065
|
+
* "limit": 10,
|
|
2066
|
+
* "remaining": 9,
|
|
2067
|
+
* "reset": 3600000
|
|
2068
|
+
* }
|
|
2069
|
+
*/
|
|
2070
|
+
ratelimit?: {
|
|
1406
2071
|
/**
|
|
1407
|
-
* @description
|
|
1408
|
-
* @example
|
|
1409
|
-
* "limit": 10,
|
|
1410
|
-
* "remaining": 9,
|
|
1411
|
-
* "reset": 3600000
|
|
1412
|
-
* }
|
|
2072
|
+
* @description Maximum number of requests that can be made inside a window
|
|
2073
|
+
* @example 10
|
|
1413
2074
|
*/
|
|
1414
|
-
|
|
1415
|
-
/**
|
|
1416
|
-
* @description Maximum number of requests that can be made inside a window
|
|
1417
|
-
* @example 10
|
|
1418
|
-
*/
|
|
1419
|
-
limit: number;
|
|
1420
|
-
/**
|
|
1421
|
-
* @description Remaining requests after this verification
|
|
1422
|
-
* @example 9
|
|
1423
|
-
*/
|
|
1424
|
-
remaining: number;
|
|
1425
|
-
/**
|
|
1426
|
-
* @description Unix timestamp in milliseconds when the ratelimit will reset
|
|
1427
|
-
* @example 3600000
|
|
1428
|
-
*/
|
|
1429
|
-
reset: number;
|
|
1430
|
-
};
|
|
2075
|
+
limit: number;
|
|
1431
2076
|
/**
|
|
1432
|
-
* @description
|
|
1433
|
-
* @example
|
|
2077
|
+
* @description Remaining requests after this verification
|
|
2078
|
+
* @example 9
|
|
1434
2079
|
*/
|
|
1435
|
-
remaining
|
|
2080
|
+
remaining: number;
|
|
1436
2081
|
/**
|
|
1437
|
-
* @description
|
|
1438
|
-
*
|
|
1439
|
-
* - NOT_FOUND: the key does not exist or has expired
|
|
1440
|
-
* - FORBIDDEN: the key is not allowed to access the api
|
|
1441
|
-
* - USAGE_EXCEEDED: the key has exceeded its request limit
|
|
1442
|
-
* - RATE_LIMITED: the key has been ratelimited,
|
|
1443
|
-
* - INSUFFICIENT_PERMISSIONS: you do not have the required permissions to perform this action
|
|
1444
|
-
*
|
|
1445
|
-
* @example NOT_FOUND
|
|
1446
|
-
* @enum {string}
|
|
2082
|
+
* @description Unix timestamp in milliseconds when the ratelimit will reset
|
|
2083
|
+
* @example 3600000
|
|
1447
2084
|
*/
|
|
1448
|
-
|
|
2085
|
+
reset: number;
|
|
1449
2086
|
};
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
"
|
|
1468
|
-
};
|
|
1469
|
-
};
|
|
1470
|
-
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1471
|
-
404: {
|
|
1472
|
-
content: {
|
|
1473
|
-
"application/json": components["schemas"]["ErrNotFound"];
|
|
1474
|
-
};
|
|
1475
|
-
};
|
|
1476
|
-
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1477
|
-
409: {
|
|
1478
|
-
content: {
|
|
1479
|
-
"application/json": components["schemas"]["ErrConflict"];
|
|
1480
|
-
};
|
|
1481
|
-
};
|
|
1482
|
-
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1483
|
-
429: {
|
|
1484
|
-
content: {
|
|
1485
|
-
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
1486
|
-
};
|
|
1487
|
-
};
|
|
1488
|
-
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1489
|
-
500: {
|
|
1490
|
-
content: {
|
|
1491
|
-
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
2087
|
+
/**
|
|
2088
|
+
* @description The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit.
|
|
2089
|
+
* @example 1000
|
|
2090
|
+
*/
|
|
2091
|
+
remaining?: number;
|
|
2092
|
+
/**
|
|
2093
|
+
* @description If the key is invalid this field will be set to the reason why it is invalid.
|
|
2094
|
+
* Possible values are:
|
|
2095
|
+
* - NOT_FOUND: the key does not exist or has expired
|
|
2096
|
+
* - FORBIDDEN: the key is not allowed to access the api
|
|
2097
|
+
* - USAGE_EXCEEDED: the key has exceeded its request limit
|
|
2098
|
+
* - RATE_LIMITED: the key has been ratelimited,
|
|
2099
|
+
* - INSUFFICIENT_PERMISSIONS: you do not have the required permissions to perform this action
|
|
2100
|
+
*
|
|
2101
|
+
* @example NOT_FOUND
|
|
2102
|
+
* @enum {string}
|
|
2103
|
+
*/
|
|
2104
|
+
code?: "NOT_FOUND" | "FORBIDDEN" | "USAGE_EXCEEDED" | "RATE_LIMITED" | "UNAUTHORIZED" | "DISABLED" | "INSUFFICIENT_PERMISSIONS";
|
|
1492
2105
|
};
|
|
1493
2106
|
};
|
|
1494
2107
|
};
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
parameters: {
|
|
1500
|
-
query?: {
|
|
1501
|
-
limit?: number;
|
|
1502
|
-
offset?: number | null;
|
|
1503
|
-
ownerId?: string;
|
|
1504
|
-
};
|
|
1505
|
-
path: {
|
|
1506
|
-
apiId: string;
|
|
2108
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
2109
|
+
400: {
|
|
2110
|
+
content: {
|
|
2111
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
1507
2112
|
};
|
|
1508
2113
|
};
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
"application/json": {
|
|
1514
|
-
keys: components["schemas"]["Key"][];
|
|
1515
|
-
/** @description The total number of keys for this api */
|
|
1516
|
-
total: number;
|
|
1517
|
-
};
|
|
1518
|
-
};
|
|
1519
|
-
};
|
|
1520
|
-
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
1521
|
-
400: {
|
|
1522
|
-
content: {
|
|
1523
|
-
"application/json": components["schemas"]["ErrBadRequest"];
|
|
1524
|
-
};
|
|
1525
|
-
};
|
|
1526
|
-
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
1527
|
-
401: {
|
|
1528
|
-
content: {
|
|
1529
|
-
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
1530
|
-
};
|
|
1531
|
-
};
|
|
1532
|
-
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
1533
|
-
403: {
|
|
1534
|
-
content: {
|
|
1535
|
-
"application/json": components["schemas"]["ErrForbidden"];
|
|
1536
|
-
};
|
|
1537
|
-
};
|
|
1538
|
-
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
1539
|
-
404: {
|
|
1540
|
-
content: {
|
|
1541
|
-
"application/json": components["schemas"]["ErrNotFound"];
|
|
1542
|
-
};
|
|
1543
|
-
};
|
|
1544
|
-
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
1545
|
-
409: {
|
|
1546
|
-
content: {
|
|
1547
|
-
"application/json": components["schemas"]["ErrConflict"];
|
|
1548
|
-
};
|
|
1549
|
-
};
|
|
1550
|
-
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
1551
|
-
429: {
|
|
1552
|
-
content: {
|
|
1553
|
-
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
1554
|
-
};
|
|
1555
|
-
};
|
|
1556
|
-
/** @description The server has encountered a situation it does not know how to handle. */
|
|
1557
|
-
500: {
|
|
1558
|
-
content: {
|
|
1559
|
-
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
1560
|
-
};
|
|
2114
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
2115
|
+
401: {
|
|
2116
|
+
content: {
|
|
2117
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
1561
2118
|
};
|
|
1562
2119
|
};
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
schemas: {
|
|
1569
|
-
ErrBadRequest: {
|
|
1570
|
-
error: {
|
|
1571
|
-
/**
|
|
1572
|
-
* @description A machine readable error code.
|
|
1573
|
-
* @example BAD_REQUEST
|
|
1574
|
-
* @enum {string}
|
|
1575
|
-
*/
|
|
1576
|
-
code: "BAD_REQUEST";
|
|
1577
|
-
/**
|
|
1578
|
-
* @description A link to our documentation with more details about this error code
|
|
1579
|
-
* @example https://unkey.dev/docs/api-reference/errors/code/BAD_REQUEST
|
|
1580
|
-
*/
|
|
1581
|
-
docs: string;
|
|
1582
|
-
/** @description A human readable explanation of what went wrong */
|
|
1583
|
-
message: string;
|
|
1584
|
-
/**
|
|
1585
|
-
* @description Please always include the requestId in your error report
|
|
1586
|
-
* @example req_1234
|
|
1587
|
-
*/
|
|
1588
|
-
requestId: string;
|
|
1589
|
-
};
|
|
1590
|
-
};
|
|
1591
|
-
ErrUnauthorized: {
|
|
1592
|
-
error: {
|
|
1593
|
-
/**
|
|
1594
|
-
* @description A machine readable error code.
|
|
1595
|
-
* @example UNAUTHORIZED
|
|
1596
|
-
* @enum {string}
|
|
1597
|
-
*/
|
|
1598
|
-
code: "UNAUTHORIZED";
|
|
1599
|
-
/**
|
|
1600
|
-
* @description A link to our documentation with more details about this error code
|
|
1601
|
-
* @example https://unkey.dev/docs/api-reference/errors/code/UNAUTHORIZED
|
|
1602
|
-
*/
|
|
1603
|
-
docs: string;
|
|
1604
|
-
/** @description A human readable explanation of what went wrong */
|
|
1605
|
-
message: string;
|
|
1606
|
-
/**
|
|
1607
|
-
* @description Please always include the requestId in your error report
|
|
1608
|
-
* @example req_1234
|
|
1609
|
-
*/
|
|
1610
|
-
requestId: string;
|
|
1611
|
-
};
|
|
1612
|
-
};
|
|
1613
|
-
ErrForbidden: {
|
|
1614
|
-
error: {
|
|
1615
|
-
/**
|
|
1616
|
-
* @description A machine readable error code.
|
|
1617
|
-
* @example FORBIDDEN
|
|
1618
|
-
* @enum {string}
|
|
1619
|
-
*/
|
|
1620
|
-
code: "FORBIDDEN";
|
|
1621
|
-
/**
|
|
1622
|
-
* @description A link to our documentation with more details about this error code
|
|
1623
|
-
* @example https://unkey.dev/docs/api-reference/errors/code/FORBIDDEN
|
|
1624
|
-
*/
|
|
1625
|
-
docs: string;
|
|
1626
|
-
/** @description A human readable explanation of what went wrong */
|
|
1627
|
-
message: string;
|
|
1628
|
-
/**
|
|
1629
|
-
* @description Please always include the requestId in your error report
|
|
1630
|
-
* @example req_1234
|
|
1631
|
-
*/
|
|
1632
|
-
requestId: string;
|
|
1633
|
-
};
|
|
1634
|
-
};
|
|
1635
|
-
ErrNotFound: {
|
|
1636
|
-
error: {
|
|
1637
|
-
/**
|
|
1638
|
-
* @description A machine readable error code.
|
|
1639
|
-
* @example NOT_FOUND
|
|
1640
|
-
* @enum {string}
|
|
1641
|
-
*/
|
|
1642
|
-
code: "NOT_FOUND";
|
|
1643
|
-
/**
|
|
1644
|
-
* @description A link to our documentation with more details about this error code
|
|
1645
|
-
* @example https://unkey.dev/docs/api-reference/errors/code/NOT_FOUND
|
|
1646
|
-
*/
|
|
1647
|
-
docs: string;
|
|
1648
|
-
/** @description A human readable explanation of what went wrong */
|
|
1649
|
-
message: string;
|
|
1650
|
-
/**
|
|
1651
|
-
* @description Please always include the requestId in your error report
|
|
1652
|
-
* @example req_1234
|
|
1653
|
-
*/
|
|
1654
|
-
requestId: string;
|
|
1655
|
-
};
|
|
1656
|
-
};
|
|
1657
|
-
ErrConflict: {
|
|
1658
|
-
error: {
|
|
1659
|
-
/**
|
|
1660
|
-
* @description A machine readable error code.
|
|
1661
|
-
* @example CONFLICT
|
|
1662
|
-
* @enum {string}
|
|
1663
|
-
*/
|
|
1664
|
-
code: "CONFLICT";
|
|
1665
|
-
/**
|
|
1666
|
-
* @description A link to our documentation with more details about this error code
|
|
1667
|
-
* @example https://unkey.dev/docs/api-reference/errors/code/CONFLICT
|
|
1668
|
-
*/
|
|
1669
|
-
docs: string;
|
|
1670
|
-
/** @description A human readable explanation of what went wrong */
|
|
1671
|
-
message: string;
|
|
1672
|
-
/**
|
|
1673
|
-
* @description Please always include the requestId in your error report
|
|
1674
|
-
* @example req_1234
|
|
1675
|
-
*/
|
|
1676
|
-
requestId: string;
|
|
1677
|
-
};
|
|
1678
|
-
};
|
|
1679
|
-
ErrTooManyRequests: {
|
|
1680
|
-
error: {
|
|
1681
|
-
/**
|
|
1682
|
-
* @description A machine readable error code.
|
|
1683
|
-
* @example TOO_MANY_REQUESTS
|
|
1684
|
-
* @enum {string}
|
|
1685
|
-
*/
|
|
1686
|
-
code: "TOO_MANY_REQUESTS";
|
|
1687
|
-
/**
|
|
1688
|
-
* @description A link to our documentation with more details about this error code
|
|
1689
|
-
* @example https://unkey.dev/docs/api-reference/errors/code/TOO_MANY_REQUESTS
|
|
1690
|
-
*/
|
|
1691
|
-
docs: string;
|
|
1692
|
-
/** @description A human readable explanation of what went wrong */
|
|
1693
|
-
message: string;
|
|
1694
|
-
/**
|
|
1695
|
-
* @description Please always include the requestId in your error report
|
|
1696
|
-
* @example req_1234
|
|
1697
|
-
*/
|
|
1698
|
-
requestId: string;
|
|
1699
|
-
};
|
|
1700
|
-
};
|
|
1701
|
-
ErrInternalServerError: {
|
|
1702
|
-
error: {
|
|
1703
|
-
/**
|
|
1704
|
-
* @description A machine readable error code.
|
|
1705
|
-
* @example INTERNAL_SERVER_ERROR
|
|
1706
|
-
* @enum {string}
|
|
1707
|
-
*/
|
|
1708
|
-
code: "INTERNAL_SERVER_ERROR";
|
|
1709
|
-
/**
|
|
1710
|
-
* @description A link to our documentation with more details about this error code
|
|
1711
|
-
* @example https://unkey.dev/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR
|
|
1712
|
-
*/
|
|
1713
|
-
docs: string;
|
|
1714
|
-
/** @description A human readable explanation of what went wrong */
|
|
1715
|
-
message: string;
|
|
1716
|
-
/**
|
|
1717
|
-
* @description Please always include the requestId in your error report
|
|
1718
|
-
* @example req_1234
|
|
1719
|
-
*/
|
|
1720
|
-
requestId: string;
|
|
2120
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
2121
|
+
403: {
|
|
2122
|
+
content: {
|
|
2123
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
2124
|
+
};
|
|
1721
2125
|
};
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
*/
|
|
1728
|
-
id: string;
|
|
1729
|
-
/**
|
|
1730
|
-
* @description The first few characters of the key to visually identify it
|
|
1731
|
-
* @example sk_5j1
|
|
1732
|
-
*/
|
|
1733
|
-
start: string;
|
|
1734
|
-
/**
|
|
1735
|
-
* @description The id of the workspace that owns the key
|
|
1736
|
-
* @example ws_1234
|
|
1737
|
-
*/
|
|
1738
|
-
workspaceId: string;
|
|
1739
|
-
/**
|
|
1740
|
-
* @description The id of the api that this key is for
|
|
1741
|
-
* @example api_1234
|
|
1742
|
-
*/
|
|
1743
|
-
apiId?: string;
|
|
1744
|
-
/**
|
|
1745
|
-
* @description The name of the key, give keys a name to easily identify their purpose
|
|
1746
|
-
* @example Customer X
|
|
1747
|
-
*/
|
|
1748
|
-
name?: string;
|
|
1749
|
-
/**
|
|
1750
|
-
* @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API.
|
|
1751
|
-
* @example user_123
|
|
1752
|
-
*/
|
|
1753
|
-
ownerId?: string;
|
|
1754
|
-
/**
|
|
1755
|
-
* @description Any additional metadata you want to store with the key
|
|
1756
|
-
* @example {
|
|
1757
|
-
* "roles": [
|
|
1758
|
-
* "admin",
|
|
1759
|
-
* "user"
|
|
1760
|
-
* ],
|
|
1761
|
-
* "stripeCustomerId": "cus_1234"
|
|
1762
|
-
* }
|
|
1763
|
-
*/
|
|
1764
|
-
meta?: {
|
|
1765
|
-
[key: string]: unknown;
|
|
2126
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
2127
|
+
404: {
|
|
2128
|
+
content: {
|
|
2129
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
2130
|
+
};
|
|
1766
2131
|
};
|
|
1767
|
-
/**
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
/**
|
|
1773
|
-
* @description The unix timestamp in milliseconds when the key was deleted. We don't delete the key outright, you can restore it later.
|
|
1774
|
-
* @example 0
|
|
1775
|
-
*/
|
|
1776
|
-
deletedAt?: number;
|
|
1777
|
-
/**
|
|
1778
|
-
* @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring.
|
|
1779
|
-
* @example 0
|
|
1780
|
-
*/
|
|
1781
|
-
expires?: number;
|
|
1782
|
-
/**
|
|
1783
|
-
* @description The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit.
|
|
1784
|
-
* @example 1000
|
|
1785
|
-
*/
|
|
1786
|
-
remaining?: number;
|
|
1787
|
-
/**
|
|
1788
|
-
* @description Unkey allows you to refill remaining verifications on a key on a regular interval.
|
|
1789
|
-
* @example {
|
|
1790
|
-
* "interval": "daily",
|
|
1791
|
-
* "amount": 10
|
|
1792
|
-
* }
|
|
1793
|
-
*/
|
|
1794
|
-
refill?: {
|
|
1795
|
-
/**
|
|
1796
|
-
* @description Determines the rate at which verifications will be refilled.
|
|
1797
|
-
* @example daily
|
|
1798
|
-
* @enum {string}
|
|
1799
|
-
*/
|
|
1800
|
-
interval: "daily" | "monthly";
|
|
1801
|
-
/**
|
|
1802
|
-
* @description Resets `remaining` to this value every interval.
|
|
1803
|
-
* @example 100
|
|
1804
|
-
*/
|
|
1805
|
-
amount: number;
|
|
1806
|
-
/**
|
|
1807
|
-
* @description The unix timestamp in miliseconds when the key was last refilled.
|
|
1808
|
-
* @example 100
|
|
1809
|
-
*/
|
|
1810
|
-
lastRefillAt?: number;
|
|
2132
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
2133
|
+
409: {
|
|
2134
|
+
content: {
|
|
2135
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
2136
|
+
};
|
|
1811
2137
|
};
|
|
1812
|
-
/**
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
* @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate.
|
|
1824
|
-
* @default fast
|
|
1825
|
-
* @enum {string}
|
|
1826
|
-
*/
|
|
1827
|
-
type?: "fast" | "consistent";
|
|
1828
|
-
/** @description The total amount of burstable requests. */
|
|
1829
|
-
limit: number;
|
|
1830
|
-
/** @description How many tokens to refill during each refillInterval. */
|
|
1831
|
-
refillRate: number;
|
|
1832
|
-
/** @description Determines the speed at which tokens are refilled, in milliseconds. */
|
|
1833
|
-
refillInterval: number;
|
|
2138
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
2139
|
+
429: {
|
|
2140
|
+
content: {
|
|
2141
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
2142
|
+
};
|
|
2143
|
+
};
|
|
2144
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
2145
|
+
500: {
|
|
2146
|
+
content: {
|
|
2147
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
2148
|
+
};
|
|
1834
2149
|
};
|
|
1835
|
-
/**
|
|
1836
|
-
* @description All roles this key belongs to
|
|
1837
|
-
* @example [
|
|
1838
|
-
* "admin",
|
|
1839
|
-
* "finance"
|
|
1840
|
-
* ]
|
|
1841
|
-
*/
|
|
1842
|
-
roles?: string[];
|
|
1843
|
-
/**
|
|
1844
|
-
* @description All permissions this key has
|
|
1845
|
-
* @example [
|
|
1846
|
-
* "domain.dns.create_record",
|
|
1847
|
-
* "finance.read_receipt"
|
|
1848
|
-
* ]
|
|
1849
|
-
*/
|
|
1850
|
-
permissions?: string[];
|
|
1851
|
-
/**
|
|
1852
|
-
* @description Sets if key is enabled or disabled. Disabled keys are not valid.
|
|
1853
|
-
* @example true
|
|
1854
|
-
*/
|
|
1855
|
-
enabled?: boolean;
|
|
1856
2150
|
};
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
* @description Whether the key is valid or not.
|
|
1865
|
-
* A key could be invalid for a number of reasons, for example if it has expired, has no more verifications left or if it has been deleted.
|
|
1866
|
-
* @example true
|
|
1867
|
-
*/
|
|
1868
|
-
valid: boolean;
|
|
1869
|
-
/**
|
|
1870
|
-
* @description The name of the key, give keys a name to easily identifiy their purpose
|
|
1871
|
-
* @example Customer X
|
|
1872
|
-
*/
|
|
1873
|
-
name?: string;
|
|
1874
|
-
/**
|
|
1875
|
-
* @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API.
|
|
1876
|
-
* @example user_123
|
|
1877
|
-
*/
|
|
1878
|
-
ownerId?: string;
|
|
1879
|
-
/**
|
|
1880
|
-
* @description Any additional metadata you want to store with the key
|
|
1881
|
-
* @example {
|
|
1882
|
-
* "roles": [
|
|
1883
|
-
* "admin",
|
|
1884
|
-
* "user"
|
|
1885
|
-
* ],
|
|
1886
|
-
* "stripeCustomerId": "cus_1234"
|
|
1887
|
-
* }
|
|
1888
|
-
*/
|
|
1889
|
-
meta?: {
|
|
1890
|
-
[key: string]: unknown;
|
|
2151
|
+
};
|
|
2152
|
+
"deprecated.listKeys": {
|
|
2153
|
+
parameters: {
|
|
2154
|
+
query?: {
|
|
2155
|
+
limit?: number;
|
|
2156
|
+
offset?: number | null;
|
|
2157
|
+
ownerId?: string;
|
|
1891
2158
|
};
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
* @example 123
|
|
1895
|
-
*/
|
|
1896
|
-
expires?: number;
|
|
1897
|
-
/**
|
|
1898
|
-
* @description The ratelimit configuration for this key. If this field is null or undefined, the key has no ratelimit.
|
|
1899
|
-
* @example {
|
|
1900
|
-
* "limit": 10,
|
|
1901
|
-
* "remaining": 9,
|
|
1902
|
-
* "reset": 3600000
|
|
1903
|
-
* }
|
|
1904
|
-
*/
|
|
1905
|
-
ratelimit?: {
|
|
1906
|
-
/**
|
|
1907
|
-
* @description Maximum number of requests that can be made inside a window
|
|
1908
|
-
* @example 10
|
|
1909
|
-
*/
|
|
1910
|
-
limit: number;
|
|
1911
|
-
/**
|
|
1912
|
-
* @description Remaining requests after this verification
|
|
1913
|
-
* @example 9
|
|
1914
|
-
*/
|
|
1915
|
-
remaining: number;
|
|
1916
|
-
/**
|
|
1917
|
-
* @description Unix timestamp in milliseconds when the ratelimit will reset
|
|
1918
|
-
* @example 3600000
|
|
1919
|
-
*/
|
|
1920
|
-
reset: number;
|
|
2159
|
+
path: {
|
|
2160
|
+
apiId: string;
|
|
1921
2161
|
};
|
|
1922
|
-
/**
|
|
1923
|
-
* @description The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit.
|
|
1924
|
-
* @example 1000
|
|
1925
|
-
*/
|
|
1926
|
-
remaining?: number;
|
|
1927
|
-
/**
|
|
1928
|
-
* @description A machine readable code why the key is not valid.
|
|
1929
|
-
* Possible values are:
|
|
1930
|
-
* - VALID: the key is valid and you should proceed
|
|
1931
|
-
* - NOT_FOUND: the key does not exist or has expired
|
|
1932
|
-
* - FORBIDDEN: the key is not allowed to access the api
|
|
1933
|
-
* - USAGE_EXCEEDED: the key has exceeded its request limit
|
|
1934
|
-
* - RATE_LIMITED: the key has been ratelimited
|
|
1935
|
-
* - UNAUTHORIZED: the key is not authorized
|
|
1936
|
-
* - DISABLED: the key is disabled
|
|
1937
|
-
* - INSUFFICIENT_PERMISSIONS: you do not have the required permissions to perform this action
|
|
1938
|
-
*
|
|
1939
|
-
* @enum {string}
|
|
1940
|
-
*/
|
|
1941
|
-
code: "VALID" | "NOT_FOUND" | "FORBIDDEN" | "USAGE_EXCEEDED" | "RATE_LIMITED" | "UNAUTHORIZED" | "DISABLED" | "INSUFFICIENT_PERMISSIONS";
|
|
1942
|
-
/** @description Sets the key to be enabled or disabled. Disabled keys will not verify. */
|
|
1943
|
-
enabled?: boolean;
|
|
1944
|
-
/**
|
|
1945
|
-
* @description A list of all the permissions this key is connected to.
|
|
1946
|
-
* @example [
|
|
1947
|
-
* "dns.record.update",
|
|
1948
|
-
* "dns.record.delete"
|
|
1949
|
-
* ]
|
|
1950
|
-
*/
|
|
1951
|
-
permissions?: string[];
|
|
1952
|
-
/**
|
|
1953
|
-
* @description The environment of the key, this is what what you set when you crated the key
|
|
1954
|
-
* @example test
|
|
1955
|
-
*/
|
|
1956
|
-
environment?: string;
|
|
1957
2162
|
};
|
|
1958
|
-
|
|
1959
|
-
/**
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
2163
|
+
responses: {
|
|
2164
|
+
/** @description Keys belonging to the api */
|
|
2165
|
+
200: {
|
|
2166
|
+
content: {
|
|
2167
|
+
"application/json": {
|
|
2168
|
+
keys: components["schemas"]["Key"][];
|
|
2169
|
+
/** @description The total number of keys for this api */
|
|
2170
|
+
total: number;
|
|
2171
|
+
};
|
|
2172
|
+
};
|
|
2173
|
+
};
|
|
2174
|
+
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
|
|
2175
|
+
400: {
|
|
2176
|
+
content: {
|
|
2177
|
+
"application/json": components["schemas"]["ErrBadRequest"];
|
|
2178
|
+
};
|
|
2179
|
+
};
|
|
2180
|
+
/** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */
|
|
2181
|
+
401: {
|
|
2182
|
+
content: {
|
|
2183
|
+
"application/json": components["schemas"]["ErrUnauthorized"];
|
|
2184
|
+
};
|
|
2185
|
+
};
|
|
2186
|
+
/** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */
|
|
2187
|
+
403: {
|
|
2188
|
+
content: {
|
|
2189
|
+
"application/json": components["schemas"]["ErrForbidden"];
|
|
2190
|
+
};
|
|
2191
|
+
};
|
|
2192
|
+
/** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */
|
|
2193
|
+
404: {
|
|
2194
|
+
content: {
|
|
2195
|
+
"application/json": components["schemas"]["ErrNotFound"];
|
|
2196
|
+
};
|
|
2197
|
+
};
|
|
2198
|
+
/** @description This response is sent when a request conflicts with the current state of the server. */
|
|
2199
|
+
409: {
|
|
2200
|
+
content: {
|
|
2201
|
+
"application/json": components["schemas"]["ErrConflict"];
|
|
2202
|
+
};
|
|
2203
|
+
};
|
|
2204
|
+
/** @description The user has sent too many requests in a given amount of time ("rate limiting") */
|
|
2205
|
+
429: {
|
|
2206
|
+
content: {
|
|
2207
|
+
"application/json": components["schemas"]["ErrTooManyRequests"];
|
|
2208
|
+
};
|
|
2209
|
+
};
|
|
2210
|
+
/** @description The server has encountered a situation it does not know how to handle. */
|
|
2211
|
+
500: {
|
|
2212
|
+
content: {
|
|
2213
|
+
"application/json": components["schemas"]["ErrInternalServerError"];
|
|
2214
|
+
};
|
|
1987
2215
|
};
|
|
1988
2216
|
};
|
|
1989
2217
|
};
|
|
1990
|
-
responses: never;
|
|
1991
|
-
parameters: {
|
|
1992
|
-
};
|
|
1993
|
-
requestBodies: never;
|
|
1994
|
-
headers: never;
|
|
1995
|
-
pathItems: never;
|
|
1996
2218
|
}
|
|
1997
2219
|
|
|
1998
2220
|
type ErrorResponse = paths["/v1/liveness"]["get"]["responses"]["500"]["content"]["application/json"];
|
|
@@ -2087,6 +2309,9 @@ declare class Unkey {
|
|
|
2087
2309
|
authorization?: {
|
|
2088
2310
|
permissions?: Record<string, never> | undefined;
|
|
2089
2311
|
} | undefined;
|
|
2312
|
+
ratelimit?: {
|
|
2313
|
+
cost?: number | undefined;
|
|
2314
|
+
} | undefined;
|
|
2090
2315
|
}, "authorization"> & {
|
|
2091
2316
|
authorization?: {
|
|
2092
2317
|
permissions: PermissionQuery<TPermission>;
|