@formatjet/sdk 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +100 -2
- package/dist/client.d.ts +175 -0
- package/dist/client.js +406 -0
- package/dist/errors.d.ts +47 -0
- package/dist/errors.js +87 -0
- package/dist/generated/openapi.d.ts +2757 -0
- package/dist/generated/openapi.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/webhooks.d.ts +55 -0
- package/dist/webhooks.js +77 -0
- package/package.json +45 -4
|
@@ -0,0 +1,2757 @@
|
|
|
1
|
+
export interface paths {
|
|
2
|
+
"/v1/formats": {
|
|
3
|
+
parameters: {
|
|
4
|
+
query?: never;
|
|
5
|
+
header?: never;
|
|
6
|
+
path?: never;
|
|
7
|
+
cookie?: never;
|
|
8
|
+
};
|
|
9
|
+
/** List supported formats */
|
|
10
|
+
get: operations["listFormats"];
|
|
11
|
+
put?: never;
|
|
12
|
+
post?: never;
|
|
13
|
+
delete?: never;
|
|
14
|
+
options?: never;
|
|
15
|
+
head?: never;
|
|
16
|
+
patch?: never;
|
|
17
|
+
trace?: never;
|
|
18
|
+
};
|
|
19
|
+
"/v1/operations": {
|
|
20
|
+
parameters: {
|
|
21
|
+
query?: never;
|
|
22
|
+
header?: never;
|
|
23
|
+
path?: never;
|
|
24
|
+
cookie?: never;
|
|
25
|
+
};
|
|
26
|
+
/** List the conversions and tools the API runs, with options and credits */
|
|
27
|
+
get: operations["listOperations"];
|
|
28
|
+
put?: never;
|
|
29
|
+
post?: never;
|
|
30
|
+
delete?: never;
|
|
31
|
+
options?: never;
|
|
32
|
+
head?: never;
|
|
33
|
+
patch?: never;
|
|
34
|
+
trace?: never;
|
|
35
|
+
};
|
|
36
|
+
"/v1/pricing": {
|
|
37
|
+
parameters: {
|
|
38
|
+
query?: never;
|
|
39
|
+
header?: never;
|
|
40
|
+
path?: never;
|
|
41
|
+
cookie?: never;
|
|
42
|
+
};
|
|
43
|
+
/** Credit weights, plans and credit packs */
|
|
44
|
+
get: operations["getPricing"];
|
|
45
|
+
put?: never;
|
|
46
|
+
post?: never;
|
|
47
|
+
delete?: never;
|
|
48
|
+
options?: never;
|
|
49
|
+
head?: never;
|
|
50
|
+
patch?: never;
|
|
51
|
+
trace?: never;
|
|
52
|
+
};
|
|
53
|
+
"/v1/usage": {
|
|
54
|
+
parameters: {
|
|
55
|
+
query?: never;
|
|
56
|
+
header?: never;
|
|
57
|
+
path?: never;
|
|
58
|
+
cookie?: never;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Jobs and credits by day
|
|
62
|
+
* @description The organization’s jobs (website, API and MCP, live and test) and the credits they used, per UTC day, oldest first, today included. Exact from job records for the last 30 days, then from daily totals.
|
|
63
|
+
*/
|
|
64
|
+
get: operations["getUsage"];
|
|
65
|
+
put?: never;
|
|
66
|
+
post?: never;
|
|
67
|
+
delete?: never;
|
|
68
|
+
options?: never;
|
|
69
|
+
head?: never;
|
|
70
|
+
patch?: never;
|
|
71
|
+
trace?: never;
|
|
72
|
+
};
|
|
73
|
+
"/v1/account": {
|
|
74
|
+
parameters: {
|
|
75
|
+
query?: never;
|
|
76
|
+
header?: never;
|
|
77
|
+
path?: never;
|
|
78
|
+
cookie?: never;
|
|
79
|
+
};
|
|
80
|
+
/** The account and limits behind your API key */
|
|
81
|
+
get: operations["getAccount"];
|
|
82
|
+
put?: never;
|
|
83
|
+
post?: never;
|
|
84
|
+
delete?: never;
|
|
85
|
+
options?: never;
|
|
86
|
+
head?: never;
|
|
87
|
+
patch?: never;
|
|
88
|
+
trace?: never;
|
|
89
|
+
};
|
|
90
|
+
"/v1/uploads": {
|
|
91
|
+
parameters: {
|
|
92
|
+
query?: never;
|
|
93
|
+
header?: never;
|
|
94
|
+
path?: never;
|
|
95
|
+
cookie?: never;
|
|
96
|
+
};
|
|
97
|
+
get?: never;
|
|
98
|
+
put?: never;
|
|
99
|
+
/**
|
|
100
|
+
* Make an upload: a presigned URL to PUT a file to
|
|
101
|
+
* @description For files you send from where your code runs. PUT the bytes to `url` with `headers`, then name the upload’s `id` in a job’s `input` (or `inputs`). An upload makes one job; one that isn’t used is deleted 60 minutes after it arrives.
|
|
102
|
+
*/
|
|
103
|
+
post: operations["createUpload"];
|
|
104
|
+
delete?: never;
|
|
105
|
+
options?: never;
|
|
106
|
+
head?: never;
|
|
107
|
+
patch?: never;
|
|
108
|
+
trace?: never;
|
|
109
|
+
};
|
|
110
|
+
"/v1/jobs": {
|
|
111
|
+
parameters: {
|
|
112
|
+
query?: never;
|
|
113
|
+
header?: never;
|
|
114
|
+
path?: never;
|
|
115
|
+
cookie?: never;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* List jobs (the last 30 days)
|
|
119
|
+
* @description Jobs made with keys of this key’s mode (API and MCP), newest first. Pass `next_cursor` back as `cursor` for the next page; it’s null on the last.
|
|
120
|
+
*/
|
|
121
|
+
get: operations["listJobs"];
|
|
122
|
+
put?: never;
|
|
123
|
+
/**
|
|
124
|
+
* Make a job: convert an upload, a base64 file or a file at a URL
|
|
125
|
+
* @description The job starts at once and is answered while it runs: wait for it with `GET /v1/jobs/{id}`, its event stream, or a webhook. Credits are held now and charged only if it succeeds.
|
|
126
|
+
*/
|
|
127
|
+
post: operations["createJob"];
|
|
128
|
+
delete?: never;
|
|
129
|
+
options?: never;
|
|
130
|
+
head?: never;
|
|
131
|
+
patch?: never;
|
|
132
|
+
trace?: never;
|
|
133
|
+
};
|
|
134
|
+
"/v1/estimate": {
|
|
135
|
+
parameters: {
|
|
136
|
+
query?: never;
|
|
137
|
+
header?: never;
|
|
138
|
+
path?: never;
|
|
139
|
+
cookie?: never;
|
|
140
|
+
};
|
|
141
|
+
get?: never;
|
|
142
|
+
put?: never;
|
|
143
|
+
/**
|
|
144
|
+
* What a job would cost, before you send the file
|
|
145
|
+
* @description Name the conversion, or the format to make (`to`) with what the file is (`from`). The answer is what a job with this key would be charged: test keys’ jobs are free. `bytes` checks a size against the plan and the engine; `files` is for conversions that join files.
|
|
146
|
+
*/
|
|
147
|
+
post: operations["estimateJob"];
|
|
148
|
+
delete?: never;
|
|
149
|
+
options?: never;
|
|
150
|
+
head?: never;
|
|
151
|
+
patch?: never;
|
|
152
|
+
trace?: never;
|
|
153
|
+
};
|
|
154
|
+
"/v1/convert": {
|
|
155
|
+
parameters: {
|
|
156
|
+
query?: never;
|
|
157
|
+
header?: never;
|
|
158
|
+
path?: never;
|
|
159
|
+
cookie?: never;
|
|
160
|
+
};
|
|
161
|
+
get?: never;
|
|
162
|
+
put?: never;
|
|
163
|
+
/**
|
|
164
|
+
* Convert one file and get the result in the response (up to 25 MB)
|
|
165
|
+
* @description Send the file as `multipart/form-data` (a `file` part) or as the raw body; for a conversion that joins files (merge-pdf, image-to-pdf), send a `file` part for each, in order, 25 MB in all. The same pipeline as a job: if it hasn’t finished within 30 seconds, the answer is `202` with the job, which carries on. With `Accept: application/json` the answer is the job, with a download URL, instead of the file. A conversion that makes several files (Split PDF, a PDF’s pages as images, a workbook’s sheets as CSV) always answers with the job, whose `outputs` list them in order.
|
|
166
|
+
*/
|
|
167
|
+
post: operations["convert"];
|
|
168
|
+
delete?: never;
|
|
169
|
+
options?: never;
|
|
170
|
+
head?: never;
|
|
171
|
+
patch?: never;
|
|
172
|
+
trace?: never;
|
|
173
|
+
};
|
|
174
|
+
"/v1/jobs/{id}": {
|
|
175
|
+
parameters: {
|
|
176
|
+
query?: never;
|
|
177
|
+
header?: never;
|
|
178
|
+
path?: never;
|
|
179
|
+
cookie?: never;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* A job: status, outputs and their download URLs
|
|
183
|
+
* @description Download URLs work until `expires_at`. After the job’s files are deleted, it’s still listed for 30 days without inputs or outputs.
|
|
184
|
+
*/
|
|
185
|
+
get: operations["getJob"];
|
|
186
|
+
put?: never;
|
|
187
|
+
post?: never;
|
|
188
|
+
/**
|
|
189
|
+
* Delete a job’s files now; returns a signed deletion receipt
|
|
190
|
+
* @description Deletes the job’s inputs and outputs from storage at once, instead of when its retention ends. A running job is canceled first.
|
|
191
|
+
*/
|
|
192
|
+
delete: operations["deleteJob"];
|
|
193
|
+
options?: never;
|
|
194
|
+
head?: never;
|
|
195
|
+
patch?: never;
|
|
196
|
+
trace?: never;
|
|
197
|
+
};
|
|
198
|
+
"/v1/jobs/{id}/events": {
|
|
199
|
+
parameters: {
|
|
200
|
+
query?: never;
|
|
201
|
+
header?: never;
|
|
202
|
+
path?: never;
|
|
203
|
+
cookie?: never;
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Server-sent events: the job each time it changes, until it finishes
|
|
207
|
+
* @description Each event carries the job as `GET /v1/jobs/{id}` shows it: `job.updated` while it runs, then one of `job.completed`, `job.failed` or `job.canceled`, after which the stream ends. A comment line keeps the connection open every 15 seconds. Event IDs let a reconnect send `Last-Event-ID` to skip what it has seen; a stream ends after 15 minutes.
|
|
208
|
+
*/
|
|
209
|
+
get: operations["streamJobEvents"];
|
|
210
|
+
put?: never;
|
|
211
|
+
post?: never;
|
|
212
|
+
delete?: never;
|
|
213
|
+
options?: never;
|
|
214
|
+
head?: never;
|
|
215
|
+
patch?: never;
|
|
216
|
+
trace?: never;
|
|
217
|
+
};
|
|
218
|
+
"/v1/jobs/{id}/cancel": {
|
|
219
|
+
parameters: {
|
|
220
|
+
query?: never;
|
|
221
|
+
header?: never;
|
|
222
|
+
path?: never;
|
|
223
|
+
cookie?: never;
|
|
224
|
+
};
|
|
225
|
+
get?: never;
|
|
226
|
+
put?: never;
|
|
227
|
+
/**
|
|
228
|
+
* Cancel a job that hasn’t finished; nothing is charged
|
|
229
|
+
* @description A job that has already ended is answered as it is.
|
|
230
|
+
*/
|
|
231
|
+
post: operations["cancelJob"];
|
|
232
|
+
delete?: never;
|
|
233
|
+
options?: never;
|
|
234
|
+
head?: never;
|
|
235
|
+
patch?: never;
|
|
236
|
+
trace?: never;
|
|
237
|
+
};
|
|
238
|
+
"/v1/webhooks": {
|
|
239
|
+
parameters: {
|
|
240
|
+
query?: never;
|
|
241
|
+
header?: never;
|
|
242
|
+
path?: never;
|
|
243
|
+
cookie?: never;
|
|
244
|
+
};
|
|
245
|
+
/** List webhook endpoints of the key’s mode */
|
|
246
|
+
get: operations["listWebhooks"];
|
|
247
|
+
put?: never;
|
|
248
|
+
/**
|
|
249
|
+
* Add a webhook endpoint
|
|
250
|
+
* @description HTTPS only, on a public host name. Events of jobs made with keys of this key's mode are sent there, signed with the secret in the response (`FormatJet-Signature`). At most 10 endpoints per mode.
|
|
251
|
+
*/
|
|
252
|
+
post: operations["createWebhook"];
|
|
253
|
+
delete?: never;
|
|
254
|
+
options?: never;
|
|
255
|
+
head?: never;
|
|
256
|
+
patch?: never;
|
|
257
|
+
trace?: never;
|
|
258
|
+
};
|
|
259
|
+
"/v1/webhooks/{id}": {
|
|
260
|
+
parameters: {
|
|
261
|
+
query?: never;
|
|
262
|
+
header?: never;
|
|
263
|
+
path?: never;
|
|
264
|
+
cookie?: never;
|
|
265
|
+
};
|
|
266
|
+
/** Get a webhook endpoint */
|
|
267
|
+
get: operations["getWebhook"];
|
|
268
|
+
put?: never;
|
|
269
|
+
post?: never;
|
|
270
|
+
/** Delete a webhook endpoint and its deliveries */
|
|
271
|
+
delete: operations["deleteWebhook"];
|
|
272
|
+
options?: never;
|
|
273
|
+
head?: never;
|
|
274
|
+
/**
|
|
275
|
+
* Change a webhook endpoint, or turn it off and on
|
|
276
|
+
* @description Turning on an endpoint that was turned off after 24 hours of failures clears its failure. Events that ended while it was off aren’t sent; replay them from its deliveries.
|
|
277
|
+
*/
|
|
278
|
+
patch: operations["updateWebhook"];
|
|
279
|
+
trace?: never;
|
|
280
|
+
};
|
|
281
|
+
"/v1/webhooks/{id}/rotate-secret": {
|
|
282
|
+
parameters: {
|
|
283
|
+
query?: never;
|
|
284
|
+
header?: never;
|
|
285
|
+
path?: never;
|
|
286
|
+
cookie?: never;
|
|
287
|
+
};
|
|
288
|
+
get?: never;
|
|
289
|
+
put?: never;
|
|
290
|
+
/**
|
|
291
|
+
* Rotate an endpoint’s secret
|
|
292
|
+
* @description Deliveries are signed with both the new and the old secret for 24 hours (two `v1` values), so your receiver can switch without missing one.
|
|
293
|
+
*/
|
|
294
|
+
post: operations["rotateWebhookSecret"];
|
|
295
|
+
delete?: never;
|
|
296
|
+
options?: never;
|
|
297
|
+
head?: never;
|
|
298
|
+
patch?: never;
|
|
299
|
+
trace?: never;
|
|
300
|
+
};
|
|
301
|
+
"/v1/webhooks/{id}/deliveries": {
|
|
302
|
+
parameters: {
|
|
303
|
+
query?: never;
|
|
304
|
+
header?: never;
|
|
305
|
+
path?: never;
|
|
306
|
+
cookie?: never;
|
|
307
|
+
};
|
|
308
|
+
/** List an endpoint’s delivery attempts of the last 7 days */
|
|
309
|
+
get: operations["listWebhookDeliveries"];
|
|
310
|
+
put?: never;
|
|
311
|
+
post?: never;
|
|
312
|
+
delete?: never;
|
|
313
|
+
options?: never;
|
|
314
|
+
head?: never;
|
|
315
|
+
patch?: never;
|
|
316
|
+
trace?: never;
|
|
317
|
+
};
|
|
318
|
+
"/v1/webhooks/{id}/replay": {
|
|
319
|
+
parameters: {
|
|
320
|
+
query?: never;
|
|
321
|
+
header?: never;
|
|
322
|
+
path?: never;
|
|
323
|
+
cookie?: never;
|
|
324
|
+
};
|
|
325
|
+
get?: never;
|
|
326
|
+
put?: never;
|
|
327
|
+
/**
|
|
328
|
+
* Send an event to an endpoint again, now
|
|
329
|
+
* @description For an event the endpoint was sent in the last 7 days. One attempt, outside the retry schedule; the answer is its delivery. Works on a turned-off endpoint, to test it before turning it on.
|
|
330
|
+
*/
|
|
331
|
+
post: operations["replayWebhookEvent"];
|
|
332
|
+
delete?: never;
|
|
333
|
+
options?: never;
|
|
334
|
+
head?: never;
|
|
335
|
+
patch?: never;
|
|
336
|
+
trace?: never;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
export type webhooks = Record<string, never>;
|
|
340
|
+
export interface components {
|
|
341
|
+
schemas: {
|
|
342
|
+
Format: {
|
|
343
|
+
id: string;
|
|
344
|
+
label: string;
|
|
345
|
+
name: string;
|
|
346
|
+
family: string;
|
|
347
|
+
extensions: string[];
|
|
348
|
+
mime_types: string[];
|
|
349
|
+
description: string;
|
|
350
|
+
};
|
|
351
|
+
Operation: {
|
|
352
|
+
slug: string;
|
|
353
|
+
/** @enum {string} */
|
|
354
|
+
kind: "pair" | "tool";
|
|
355
|
+
operation: string;
|
|
356
|
+
from: string[];
|
|
357
|
+
to: string;
|
|
358
|
+
/** @description How many files one job takes. More than one are joined into one output: send them as `inputs`. */
|
|
359
|
+
files: {
|
|
360
|
+
min: number;
|
|
361
|
+
max: number;
|
|
362
|
+
};
|
|
363
|
+
credits: {
|
|
364
|
+
amount: number;
|
|
365
|
+
unit: string;
|
|
366
|
+
};
|
|
367
|
+
engines: {
|
|
368
|
+
tier: string;
|
|
369
|
+
engines: {
|
|
370
|
+
id: string;
|
|
371
|
+
name: string;
|
|
372
|
+
}[];
|
|
373
|
+
}[];
|
|
374
|
+
options_schema: {
|
|
375
|
+
[key: string]: unknown;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* @description An RFC 9457 problem document with FormatJet’s `code` and `request_id`.
|
|
380
|
+
* @example {
|
|
381
|
+
* "type": "https://formatjet.com/docs/errors/not_found",
|
|
382
|
+
* "title": "Not found",
|
|
383
|
+
* "status": 404,
|
|
384
|
+
* "code": "not_found",
|
|
385
|
+
* "detail": "No such job.",
|
|
386
|
+
* "request_id": "req_01JBXA3Q6P0R2S4T6V8W0X2Y4Z"
|
|
387
|
+
* }
|
|
388
|
+
*/
|
|
389
|
+
Problem: {
|
|
390
|
+
/** @description This code’s page in the docs: `https://formatjet.com/docs/errors/<code>` */
|
|
391
|
+
type: string;
|
|
392
|
+
title: string;
|
|
393
|
+
status: number;
|
|
394
|
+
/**
|
|
395
|
+
* @description Stable across versions: branch on it, not on `title` or `detail`
|
|
396
|
+
* @enum {string}
|
|
397
|
+
*/
|
|
398
|
+
code: "invalid_request" | "unsupported_conversion" | "unsupported_document" | "file_too_large" | "corrupt_file" | "password_protected" | "import_failed" | "unauthorized" | "forbidden" | "not_found" | "insufficient_credits" | "rate_limited" | "idempotency_conflict" | "engine_timeout" | "engine_failed" | "internal_error";
|
|
399
|
+
/** @description What happened, for people to read */
|
|
400
|
+
detail?: string;
|
|
401
|
+
/** @description Also in `FormatJet-Request-Id` */
|
|
402
|
+
request_id: string;
|
|
403
|
+
/** @description `invalid_request` from validation: each field that failed */
|
|
404
|
+
errors?: {
|
|
405
|
+
path: string;
|
|
406
|
+
message: string;
|
|
407
|
+
}[];
|
|
408
|
+
/** @description `POST /v1/convert` only: the job whose conversion failed */
|
|
409
|
+
job_id?: string;
|
|
410
|
+
/** @description `file_too_large` for base64 inputs: the most they take */
|
|
411
|
+
max_file_bytes?: number;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* @example {
|
|
415
|
+
* "currency": "usd",
|
|
416
|
+
* "browser_credits": 0,
|
|
417
|
+
* "credit_weights": [
|
|
418
|
+
* {
|
|
419
|
+
* "id": "image",
|
|
420
|
+
* "label": "Images",
|
|
421
|
+
* "amount": 1,
|
|
422
|
+
* "unit": "file"
|
|
423
|
+
* },
|
|
424
|
+
* {
|
|
425
|
+
* "id": "pdf_tool",
|
|
426
|
+
* "label": "PDF tools",
|
|
427
|
+
* "amount": 1,
|
|
428
|
+
* "unit": "file"
|
|
429
|
+
* },
|
|
430
|
+
* {
|
|
431
|
+
* "id": "audio",
|
|
432
|
+
* "label": "Audio",
|
|
433
|
+
* "amount": 1,
|
|
434
|
+
* "unit": "file"
|
|
435
|
+
* },
|
|
436
|
+
* {
|
|
437
|
+
* "id": "data",
|
|
438
|
+
* "label": "Data",
|
|
439
|
+
* "amount": 1,
|
|
440
|
+
* "unit": "file"
|
|
441
|
+
* },
|
|
442
|
+
* {
|
|
443
|
+
* "id": "markdown",
|
|
444
|
+
* "label": "Markdown extraction",
|
|
445
|
+
* "amount": 1,
|
|
446
|
+
* "unit": "file"
|
|
447
|
+
* },
|
|
448
|
+
* {
|
|
449
|
+
* "id": "office_to_pdf",
|
|
450
|
+
* "label": "Office → PDF",
|
|
451
|
+
* "amount": 2,
|
|
452
|
+
* "unit": "file"
|
|
453
|
+
* },
|
|
454
|
+
* {
|
|
455
|
+
* "id": "office_to_office",
|
|
456
|
+
* "label": "Office ↔ Office",
|
|
457
|
+
* "amount": 2,
|
|
458
|
+
* "unit": "file"
|
|
459
|
+
* },
|
|
460
|
+
* {
|
|
461
|
+
* "id": "ebook",
|
|
462
|
+
* "label": "Ebooks",
|
|
463
|
+
* "amount": 2,
|
|
464
|
+
* "unit": "file"
|
|
465
|
+
* },
|
|
466
|
+
* {
|
|
467
|
+
* "id": "web_to_pdf",
|
|
468
|
+
* "label": "Web page → PDF",
|
|
469
|
+
* "amount": 2,
|
|
470
|
+
* "unit": "file"
|
|
471
|
+
* },
|
|
472
|
+
* {
|
|
473
|
+
* "id": "pdf_to_office",
|
|
474
|
+
* "label": "PDF → Word, Excel or PowerPoint",
|
|
475
|
+
* "amount": 4,
|
|
476
|
+
* "unit": "file"
|
|
477
|
+
* },
|
|
478
|
+
* {
|
|
479
|
+
* "id": "ocr",
|
|
480
|
+
* "label": "OCR",
|
|
481
|
+
* "amount": 1,
|
|
482
|
+
* "unit": "page"
|
|
483
|
+
* },
|
|
484
|
+
* {
|
|
485
|
+
* "id": "video_hd",
|
|
486
|
+
* "label": "Video up to 1080p",
|
|
487
|
+
* "amount": 3,
|
|
488
|
+
* "unit": "output_minute"
|
|
489
|
+
* },
|
|
490
|
+
* {
|
|
491
|
+
* "id": "video_uhd",
|
|
492
|
+
* "label": "Video above 1080p",
|
|
493
|
+
* "amount": 8,
|
|
494
|
+
* "unit": "output_minute"
|
|
495
|
+
* }
|
|
496
|
+
* ],
|
|
497
|
+
* "plans": [
|
|
498
|
+
* {
|
|
499
|
+
* "id": "free",
|
|
500
|
+
* "name": "Free",
|
|
501
|
+
* "audience": "both",
|
|
502
|
+
* "price_monthly_cents": 0,
|
|
503
|
+
* "price_yearly_per_month_cents": null,
|
|
504
|
+
* "monthly_credits": 300,
|
|
505
|
+
* "overage": "none"
|
|
506
|
+
* },
|
|
507
|
+
* {
|
|
508
|
+
* "id": "pro",
|
|
509
|
+
* "name": "Pro",
|
|
510
|
+
* "audience": "web",
|
|
511
|
+
* "price_monthly_cents": 1000,
|
|
512
|
+
* "price_yearly_per_month_cents": 700,
|
|
513
|
+
* "monthly_credits": 2000,
|
|
514
|
+
* "overage": "packs"
|
|
515
|
+
* },
|
|
516
|
+
* {
|
|
517
|
+
* "id": "api_starter",
|
|
518
|
+
* "name": "API Starter",
|
|
519
|
+
* "audience": "api",
|
|
520
|
+
* "price_monthly_cents": 1900,
|
|
521
|
+
* "price_yearly_per_month_cents": null,
|
|
522
|
+
* "monthly_credits": 3000,
|
|
523
|
+
* "overage": {
|
|
524
|
+
* "per_1000_cents": 700
|
|
525
|
+
* }
|
|
526
|
+
* },
|
|
527
|
+
* {
|
|
528
|
+
* "id": "api_growth",
|
|
529
|
+
* "name": "API Growth",
|
|
530
|
+
* "audience": "api",
|
|
531
|
+
* "price_monthly_cents": 7900,
|
|
532
|
+
* "price_yearly_per_month_cents": null,
|
|
533
|
+
* "monthly_credits": 20000,
|
|
534
|
+
* "overage": {
|
|
535
|
+
* "per_1000_cents": 450
|
|
536
|
+
* }
|
|
537
|
+
* },
|
|
538
|
+
* {
|
|
539
|
+
* "id": "api_scale",
|
|
540
|
+
* "name": "API Scale",
|
|
541
|
+
* "audience": "api",
|
|
542
|
+
* "price_monthly_cents": 29900,
|
|
543
|
+
* "price_yearly_per_month_cents": null,
|
|
544
|
+
* "monthly_credits": 100000,
|
|
545
|
+
* "overage": {
|
|
546
|
+
* "per_1000_cents": 325
|
|
547
|
+
* }
|
|
548
|
+
* },
|
|
549
|
+
* {
|
|
550
|
+
* "id": "enterprise",
|
|
551
|
+
* "name": "Enterprise",
|
|
552
|
+
* "audience": "both",
|
|
553
|
+
* "price_monthly_cents": null,
|
|
554
|
+
* "price_yearly_per_month_cents": null,
|
|
555
|
+
* "monthly_credits": null,
|
|
556
|
+
* "overage": "custom"
|
|
557
|
+
* }
|
|
558
|
+
* ],
|
|
559
|
+
* "credit_packs": [
|
|
560
|
+
* {
|
|
561
|
+
* "credits": 1000,
|
|
562
|
+
* "price_cents": 1200,
|
|
563
|
+
* "valid_months": 12
|
|
564
|
+
* },
|
|
565
|
+
* {
|
|
566
|
+
* "credits": 10000,
|
|
567
|
+
* "price_cents": 9000,
|
|
568
|
+
* "valid_months": 12
|
|
569
|
+
* }
|
|
570
|
+
* ]
|
|
571
|
+
* }
|
|
572
|
+
*/
|
|
573
|
+
Pricing: {
|
|
574
|
+
currency: string;
|
|
575
|
+
browser_credits: number;
|
|
576
|
+
credit_weights: {
|
|
577
|
+
id: string;
|
|
578
|
+
label: string;
|
|
579
|
+
amount: number;
|
|
580
|
+
unit: string;
|
|
581
|
+
}[];
|
|
582
|
+
plans: {
|
|
583
|
+
id: string;
|
|
584
|
+
name: string;
|
|
585
|
+
audience: string;
|
|
586
|
+
price_monthly_cents: number | null;
|
|
587
|
+
price_yearly_per_month_cents: number | null;
|
|
588
|
+
monthly_credits: number | null;
|
|
589
|
+
overage: string | {
|
|
590
|
+
per_1000_cents: number;
|
|
591
|
+
};
|
|
592
|
+
}[];
|
|
593
|
+
credit_packs: {
|
|
594
|
+
credits: number;
|
|
595
|
+
price_cents: number;
|
|
596
|
+
valid_months: number;
|
|
597
|
+
}[];
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* @example {
|
|
601
|
+
* "days": [
|
|
602
|
+
* {
|
|
603
|
+
* "day": "2026-10-18",
|
|
604
|
+
* "jobs": 0,
|
|
605
|
+
* "succeeded": 0,
|
|
606
|
+
* "credits": 0,
|
|
607
|
+
* "bytes": 0
|
|
608
|
+
* },
|
|
609
|
+
* {
|
|
610
|
+
* "day": "2026-10-19",
|
|
611
|
+
* "jobs": 3,
|
|
612
|
+
* "succeeded": 3,
|
|
613
|
+
* "credits": 6,
|
|
614
|
+
* "bytes": 160442
|
|
615
|
+
* },
|
|
616
|
+
* {
|
|
617
|
+
* "day": "2026-10-20",
|
|
618
|
+
* "jobs": 12,
|
|
619
|
+
* "succeeded": 12,
|
|
620
|
+
* "credits": 24,
|
|
621
|
+
* "bytes": 1208331
|
|
622
|
+
* },
|
|
623
|
+
* {
|
|
624
|
+
* "day": "2026-10-21",
|
|
625
|
+
* "jobs": 0,
|
|
626
|
+
* "succeeded": 0,
|
|
627
|
+
* "credits": 0,
|
|
628
|
+
* "bytes": 0
|
|
629
|
+
* },
|
|
630
|
+
* {
|
|
631
|
+
* "day": "2026-10-22",
|
|
632
|
+
* "jobs": 7,
|
|
633
|
+
* "succeeded": 7,
|
|
634
|
+
* "credits": 14,
|
|
635
|
+
* "bytes": 501220
|
|
636
|
+
* },
|
|
637
|
+
* {
|
|
638
|
+
* "day": "2026-10-23",
|
|
639
|
+
* "jobs": 9,
|
|
640
|
+
* "succeeded": 9,
|
|
641
|
+
* "credits": 18,
|
|
642
|
+
* "bytes": 744018
|
|
643
|
+
* },
|
|
644
|
+
* {
|
|
645
|
+
* "day": "2026-10-24",
|
|
646
|
+
* "jobs": 2,
|
|
647
|
+
* "succeeded": 2,
|
|
648
|
+
* "credits": 4,
|
|
649
|
+
* "bytes": 96426
|
|
650
|
+
* }
|
|
651
|
+
* ],
|
|
652
|
+
* "totals": {
|
|
653
|
+
* "jobs": 33,
|
|
654
|
+
* "succeeded": 33,
|
|
655
|
+
* "credits": 66,
|
|
656
|
+
* "bytes": 2710437
|
|
657
|
+
* }
|
|
658
|
+
* }
|
|
659
|
+
*/
|
|
660
|
+
Usage: {
|
|
661
|
+
days: {
|
|
662
|
+
/** @example 2026-10-23 */
|
|
663
|
+
day: string;
|
|
664
|
+
jobs: number;
|
|
665
|
+
succeeded: number;
|
|
666
|
+
credits: number;
|
|
667
|
+
/** @description Input bytes */
|
|
668
|
+
bytes: number;
|
|
669
|
+
}[];
|
|
670
|
+
totals: {
|
|
671
|
+
jobs: number;
|
|
672
|
+
succeeded: number;
|
|
673
|
+
credits: number;
|
|
674
|
+
/** @description Input bytes */
|
|
675
|
+
bytes: number;
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
/**
|
|
679
|
+
* @example {
|
|
680
|
+
* "organization": {
|
|
681
|
+
* "id": "org_01JB0Y6S7T8V9W0X1Y2Z3A4B5C",
|
|
682
|
+
* "name": "Acme"
|
|
683
|
+
* },
|
|
684
|
+
* "plan": {
|
|
685
|
+
* "id": "free",
|
|
686
|
+
* "name": "Free"
|
|
687
|
+
* },
|
|
688
|
+
* "key": {
|
|
689
|
+
* "id": "key_01JBW2N4P6Q8R0S2T4V6W8X0Y2",
|
|
690
|
+
* "name": "Staging server",
|
|
691
|
+
* "prefix": "fj_test_7Gk2",
|
|
692
|
+
* "mode": "test",
|
|
693
|
+
* "scopes": [
|
|
694
|
+
* "convert",
|
|
695
|
+
* "read",
|
|
696
|
+
* "webhooks"
|
|
697
|
+
* ]
|
|
698
|
+
* },
|
|
699
|
+
* "credits": {
|
|
700
|
+
* "available": 300,
|
|
701
|
+
* "held": 0,
|
|
702
|
+
* "monthly": {
|
|
703
|
+
* "granted": 300,
|
|
704
|
+
* "remaining": 300,
|
|
705
|
+
* "resets_at": "2026-11-01T00:00:00.000Z"
|
|
706
|
+
* }
|
|
707
|
+
* },
|
|
708
|
+
* "limits": {
|
|
709
|
+
* "max_file_bytes": 1048576,
|
|
710
|
+
* "concurrent_jobs": 2,
|
|
711
|
+
* "requests_per_second": 2,
|
|
712
|
+
* "jobs_per_day": 100,
|
|
713
|
+
* "jobs_today": 4
|
|
714
|
+
* }
|
|
715
|
+
* }
|
|
716
|
+
*/
|
|
717
|
+
Account: {
|
|
718
|
+
organization: {
|
|
719
|
+
id: string;
|
|
720
|
+
name: string;
|
|
721
|
+
};
|
|
722
|
+
plan: {
|
|
723
|
+
id: string;
|
|
724
|
+
name: string;
|
|
725
|
+
};
|
|
726
|
+
key: {
|
|
727
|
+
id: string;
|
|
728
|
+
name: string;
|
|
729
|
+
/** @example fj_live_7Gk2 */
|
|
730
|
+
prefix: string;
|
|
731
|
+
/** @enum {string} */
|
|
732
|
+
mode: "live" | "test";
|
|
733
|
+
scopes: ("convert" | "read" | "webhooks")[];
|
|
734
|
+
};
|
|
735
|
+
credits: {
|
|
736
|
+
/** @description Credits a new job can use */
|
|
737
|
+
available: number;
|
|
738
|
+
/** @description Credits held by jobs that are running */
|
|
739
|
+
held: number;
|
|
740
|
+
/** @description This month’s plan credits, if the plan grants them */
|
|
741
|
+
monthly: {
|
|
742
|
+
granted: number;
|
|
743
|
+
remaining: number;
|
|
744
|
+
resets_at: string;
|
|
745
|
+
} | null;
|
|
746
|
+
};
|
|
747
|
+
limits: {
|
|
748
|
+
max_file_bytes: number;
|
|
749
|
+
concurrent_jobs: number;
|
|
750
|
+
requests_per_second: number | null;
|
|
751
|
+
/** @description Test keys only: free jobs a day; live jobs spend credits */
|
|
752
|
+
jobs_per_day: number | null;
|
|
753
|
+
jobs_today: number | null;
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
/**
|
|
757
|
+
* @example {
|
|
758
|
+
* "id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
|
|
759
|
+
* "url": "https://<account>.r2.cloudflarestorage.com/formatjet-files-us/in/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D/file_01JBXA3PZK4M6N8P0Q2R4S6T8V?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Signature=…",
|
|
760
|
+
* "method": "PUT",
|
|
761
|
+
* "headers": {
|
|
762
|
+
* "Content-Type": "application/octet-stream"
|
|
763
|
+
* },
|
|
764
|
+
* "expires_at": "2026-10-24T10:15:00.000Z",
|
|
765
|
+
* "max_bytes": 104857600
|
|
766
|
+
* }
|
|
767
|
+
*/
|
|
768
|
+
Upload: {
|
|
769
|
+
/** @description Name it in a job’s `input` once the file is PUT */
|
|
770
|
+
id: string;
|
|
771
|
+
/** @description PUT the file’s bytes here */
|
|
772
|
+
url: string;
|
|
773
|
+
/** @enum {string} */
|
|
774
|
+
method: "PUT";
|
|
775
|
+
/** @description Send these exactly */
|
|
776
|
+
headers: {
|
|
777
|
+
[key: string]: string;
|
|
778
|
+
};
|
|
779
|
+
/** @description The URL works until then */
|
|
780
|
+
expires_at: string;
|
|
781
|
+
/** @description The largest file the key may upload */
|
|
782
|
+
max_bytes: number;
|
|
783
|
+
};
|
|
784
|
+
/**
|
|
785
|
+
* @example {
|
|
786
|
+
* "size": 48213,
|
|
787
|
+
* "filename": "report.docx"
|
|
788
|
+
* }
|
|
789
|
+
*/
|
|
790
|
+
UploadRequest: {
|
|
791
|
+
/** @description Bytes */
|
|
792
|
+
size: number;
|
|
793
|
+
/** @description The file’s name, used to name the output. Never logged. */
|
|
794
|
+
filename?: string;
|
|
795
|
+
};
|
|
796
|
+
/**
|
|
797
|
+
* @example {
|
|
798
|
+
* "id": "job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
|
|
799
|
+
* "status": "completed",
|
|
800
|
+
* "mode": "live",
|
|
801
|
+
* "conversion": "word-to-pdf",
|
|
802
|
+
* "progress": 100,
|
|
803
|
+
* "steps": [
|
|
804
|
+
* {
|
|
805
|
+
* "op": "convert",
|
|
806
|
+
* "from": "docx",
|
|
807
|
+
* "to": "pdf",
|
|
808
|
+
* "options": {},
|
|
809
|
+
* "status": "completed"
|
|
810
|
+
* }
|
|
811
|
+
* ],
|
|
812
|
+
* "input": {
|
|
813
|
+
* "upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
|
|
814
|
+
* "format": "docx",
|
|
815
|
+
* "bytes": 48213,
|
|
816
|
+
* "filename": "report.docx"
|
|
817
|
+
* },
|
|
818
|
+
* "inputs": [
|
|
819
|
+
* {
|
|
820
|
+
* "upload_id": "up_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
|
|
821
|
+
* "format": "docx",
|
|
822
|
+
* "bytes": 48213,
|
|
823
|
+
* "filename": "report.docx"
|
|
824
|
+
* }
|
|
825
|
+
* ],
|
|
826
|
+
* "outputs": [
|
|
827
|
+
* {
|
|
828
|
+
* "id": "file_01JBXA3R2N5P7Q9S1T3V5W7X9Z",
|
|
829
|
+
* "filename": "report.pdf",
|
|
830
|
+
* "bytes": 61874,
|
|
831
|
+
* "mime": "application/pdf",
|
|
832
|
+
* "url": "https://<account>.r2.cloudflarestorage.com/formatjet-files-us/out/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D/file_01JBXA3R2N5P7Q9S1T3V5W7X9Z?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Signature=…",
|
|
833
|
+
* "expires_at": "2026-10-25T10:00:06.000Z",
|
|
834
|
+
* "deleted_at": null
|
|
835
|
+
* }
|
|
836
|
+
* ],
|
|
837
|
+
* "estimate": {
|
|
838
|
+
* "credits": 2
|
|
839
|
+
* },
|
|
840
|
+
* "credits": 2,
|
|
841
|
+
* "engine": "office",
|
|
842
|
+
* "engine_version": "libreoffice-25.8+runner-7",
|
|
843
|
+
* "error": null,
|
|
844
|
+
* "metadata": {},
|
|
845
|
+
* "created_at": "2026-10-24T10:00:02.000Z",
|
|
846
|
+
* "finished_at": "2026-10-24T10:00:06.000Z",
|
|
847
|
+
* "links": {
|
|
848
|
+
* "self": "https://api.formatjet.com/v1/jobs/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
|
|
849
|
+
* "events": "https://api.formatjet.com/v1/jobs/job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D/events"
|
|
850
|
+
* }
|
|
851
|
+
* }
|
|
852
|
+
*/
|
|
853
|
+
Job: {
|
|
854
|
+
id: string;
|
|
855
|
+
/**
|
|
856
|
+
* @description `awaiting_upload` while a URL input is being fetched
|
|
857
|
+
* @enum {string}
|
|
858
|
+
*/
|
|
859
|
+
status: "created" | "awaiting_upload" | "queued" | "processing" | "completed" | "failed" | "canceled";
|
|
860
|
+
/** @enum {string} */
|
|
861
|
+
mode: "live" | "test";
|
|
862
|
+
conversion: string;
|
|
863
|
+
progress: number;
|
|
864
|
+
steps: {
|
|
865
|
+
/** @enum {string} */
|
|
866
|
+
op: "convert";
|
|
867
|
+
/** @enum {string|null} */
|
|
868
|
+
from: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md" | null;
|
|
869
|
+
/** @enum {string|null} */
|
|
870
|
+
to: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md" | null;
|
|
871
|
+
options: {
|
|
872
|
+
[key: string]: unknown;
|
|
873
|
+
};
|
|
874
|
+
/** @enum {string} */
|
|
875
|
+
status: "created" | "awaiting_upload" | "queued" | "processing" | "completed" | "failed" | "canceled";
|
|
876
|
+
}[];
|
|
877
|
+
/** @description The file, or the first of `inputs` */
|
|
878
|
+
input: {
|
|
879
|
+
upload_id: string;
|
|
880
|
+
/** @enum {string|null} */
|
|
881
|
+
format: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md" | null;
|
|
882
|
+
bytes: number | null;
|
|
883
|
+
filename: string | null;
|
|
884
|
+
};
|
|
885
|
+
/** @description Every input in order, `input` first: more than one when the job joins files. Empty once the job’s details have expired. */
|
|
886
|
+
inputs: {
|
|
887
|
+
upload_id: string;
|
|
888
|
+
/** @enum {string|null} */
|
|
889
|
+
format: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md" | null;
|
|
890
|
+
bytes: number | null;
|
|
891
|
+
filename: string | null;
|
|
892
|
+
}[];
|
|
893
|
+
outputs: {
|
|
894
|
+
id: string;
|
|
895
|
+
filename: string | null;
|
|
896
|
+
bytes: number;
|
|
897
|
+
mime: string;
|
|
898
|
+
/** @description Null once the file is deleted */
|
|
899
|
+
url: string | null;
|
|
900
|
+
expires_at: string | null;
|
|
901
|
+
/** @description When the file was deleted from storage; null until then */
|
|
902
|
+
deleted_at: string | null;
|
|
903
|
+
}[];
|
|
904
|
+
estimate: {
|
|
905
|
+
credits: number;
|
|
906
|
+
};
|
|
907
|
+
/** @description Credits charged: only for a job that succeeded */
|
|
908
|
+
credits: number;
|
|
909
|
+
engine: string | null;
|
|
910
|
+
engine_version: string | null;
|
|
911
|
+
error: {
|
|
912
|
+
code: string;
|
|
913
|
+
detail: string;
|
|
914
|
+
} | null;
|
|
915
|
+
metadata: {
|
|
916
|
+
[key: string]: string;
|
|
917
|
+
};
|
|
918
|
+
created_at: string;
|
|
919
|
+
finished_at: string | null;
|
|
920
|
+
links: {
|
|
921
|
+
self: string;
|
|
922
|
+
events: string;
|
|
923
|
+
};
|
|
924
|
+
};
|
|
925
|
+
JobRequest: {
|
|
926
|
+
/** @description The file. Send this or `inputs`. */
|
|
927
|
+
input?: {
|
|
928
|
+
upload_id: string;
|
|
929
|
+
} | {
|
|
930
|
+
base64: string;
|
|
931
|
+
filename?: string;
|
|
932
|
+
} | {
|
|
933
|
+
/** @description An http or https URL we fetch the file from; never logged. Private addresses, and video and social platforms, are refused. */
|
|
934
|
+
url: string;
|
|
935
|
+
filename?: string;
|
|
936
|
+
};
|
|
937
|
+
/** @description Two to 20 files joined into one output, in order (merge-pdf, image-to-pdf): uploads or base64, up to 10 MB of base64 in all. Send this or `input`. */
|
|
938
|
+
inputs?: ({
|
|
939
|
+
upload_id: string;
|
|
940
|
+
} | {
|
|
941
|
+
base64: string;
|
|
942
|
+
filename?: string;
|
|
943
|
+
})[];
|
|
944
|
+
/** @description One step in v1 */
|
|
945
|
+
steps: {
|
|
946
|
+
/** @enum {string} */
|
|
947
|
+
op: "convert";
|
|
948
|
+
/** @description A conversion’s slug from `GET /v1/operations`, such as `word-to-pdf` */
|
|
949
|
+
conversion?: string;
|
|
950
|
+
/**
|
|
951
|
+
* @description What the file is; detected from its bytes when left out
|
|
952
|
+
* @enum {string}
|
|
953
|
+
*/
|
|
954
|
+
from?: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
955
|
+
/**
|
|
956
|
+
* @description The format to make, when `conversion` is left out
|
|
957
|
+
* @enum {string}
|
|
958
|
+
*/
|
|
959
|
+
to?: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
960
|
+
/** @description The conversion’s options (`options_schema` in `GET /v1/operations`) */
|
|
961
|
+
options?: {
|
|
962
|
+
[key: string]: unknown;
|
|
963
|
+
};
|
|
964
|
+
}[];
|
|
965
|
+
output?: {
|
|
966
|
+
/** @description Seconds the output is kept after completion (default 86400) */
|
|
967
|
+
ttl?: number;
|
|
968
|
+
filename?: string;
|
|
969
|
+
};
|
|
970
|
+
/** @description Up to 20 string values, 2 KB in all; returned with the job */
|
|
971
|
+
metadata?: {
|
|
972
|
+
[key: string]: string;
|
|
973
|
+
};
|
|
974
|
+
/** @description A URL that gets this job’s events besides your webhook endpoints, signed with your organization’s job-webhook secret (dashboard, Webhooks). HTTPS on a public host name. */
|
|
975
|
+
webhook?: string;
|
|
976
|
+
};
|
|
977
|
+
/**
|
|
978
|
+
* @example {
|
|
979
|
+
* "conversion": "word-to-pdf",
|
|
980
|
+
* "from": "docx",
|
|
981
|
+
* "to": "pdf",
|
|
982
|
+
* "files": 1,
|
|
983
|
+
* "credits": 2,
|
|
984
|
+
* "credit_weight": {
|
|
985
|
+
* "amount": 2,
|
|
986
|
+
* "unit": "file"
|
|
987
|
+
* },
|
|
988
|
+
* "available_credits": 298,
|
|
989
|
+
* "max_file_bytes": 104857600
|
|
990
|
+
* }
|
|
991
|
+
*/
|
|
992
|
+
Estimate: {
|
|
993
|
+
conversion: string;
|
|
994
|
+
/** @enum {string} */
|
|
995
|
+
from: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
996
|
+
/** @enum {string} */
|
|
997
|
+
to: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
998
|
+
files: number;
|
|
999
|
+
/** @description What a job with this key would be charged if it succeeded */
|
|
1000
|
+
credits: number;
|
|
1001
|
+
/** @description The conversion’s price in credits, from GET /v1/pricing */
|
|
1002
|
+
credit_weight: {
|
|
1003
|
+
amount: number;
|
|
1004
|
+
unit: string;
|
|
1005
|
+
};
|
|
1006
|
+
/** @description Credits a new job can use now; null for test keys */
|
|
1007
|
+
available_credits: number | null;
|
|
1008
|
+
/** @description The largest file (or total) a job with this key takes for it */
|
|
1009
|
+
max_file_bytes: number;
|
|
1010
|
+
};
|
|
1011
|
+
/**
|
|
1012
|
+
* @example {
|
|
1013
|
+
* "steps": [
|
|
1014
|
+
* {
|
|
1015
|
+
* "op": "convert",
|
|
1016
|
+
* "from": "docx",
|
|
1017
|
+
* "to": "pdf"
|
|
1018
|
+
* }
|
|
1019
|
+
* ],
|
|
1020
|
+
* "bytes": 48213
|
|
1021
|
+
* }
|
|
1022
|
+
*/
|
|
1023
|
+
EstimateRequest: {
|
|
1024
|
+
/** @description One step in v1 */
|
|
1025
|
+
steps: {
|
|
1026
|
+
/** @enum {string} */
|
|
1027
|
+
op: "convert";
|
|
1028
|
+
/** @description A conversion’s slug from `GET /v1/operations`, such as `word-to-pdf` */
|
|
1029
|
+
conversion?: string;
|
|
1030
|
+
/**
|
|
1031
|
+
* @description What the file is; detected from its bytes when left out
|
|
1032
|
+
* @enum {string}
|
|
1033
|
+
*/
|
|
1034
|
+
from?: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
1035
|
+
/**
|
|
1036
|
+
* @description The format to make, when `conversion` is left out
|
|
1037
|
+
* @enum {string}
|
|
1038
|
+
*/
|
|
1039
|
+
to?: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
1040
|
+
/** @description The conversion’s options (`options_schema` in `GET /v1/operations`) */
|
|
1041
|
+
options?: {
|
|
1042
|
+
[key: string]: unknown;
|
|
1043
|
+
};
|
|
1044
|
+
}[];
|
|
1045
|
+
/** @description How many files the job joins (merge-pdf, image-to-pdf); 1 by default */
|
|
1046
|
+
files?: number;
|
|
1047
|
+
/** @description The file’s size, or the files’ total, to check against the limits */
|
|
1048
|
+
bytes?: number;
|
|
1049
|
+
};
|
|
1050
|
+
JobSummary: {
|
|
1051
|
+
id: string;
|
|
1052
|
+
/** @enum {string} */
|
|
1053
|
+
status: "created" | "awaiting_upload" | "queued" | "processing" | "completed" | "failed" | "canceled";
|
|
1054
|
+
/** @enum {string} */
|
|
1055
|
+
mode: "live" | "test";
|
|
1056
|
+
conversion: string;
|
|
1057
|
+
credits: number;
|
|
1058
|
+
engine: string | null;
|
|
1059
|
+
engine_version: string | null;
|
|
1060
|
+
error_code: string | null;
|
|
1061
|
+
created_at: string;
|
|
1062
|
+
finished_at: string | null;
|
|
1063
|
+
};
|
|
1064
|
+
/**
|
|
1065
|
+
* @example {
|
|
1066
|
+
* "receipt": {
|
|
1067
|
+
* "type": "formatjet.deletion_receipt",
|
|
1068
|
+
* "version": 1,
|
|
1069
|
+
* "job_id": "job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
|
|
1070
|
+
* "files": [
|
|
1071
|
+
* {
|
|
1072
|
+
* "id": "file_01JBXA3PZK4M6N8P0Q2R4S6T8V",
|
|
1073
|
+
* "role": "input",
|
|
1074
|
+
* "deleted_at": "2026-10-24T10:00:06.000Z"
|
|
1075
|
+
* },
|
|
1076
|
+
* {
|
|
1077
|
+
* "id": "file_01JBXA3R2N5P7Q9S1T3V5W7X9Z",
|
|
1078
|
+
* "role": "output",
|
|
1079
|
+
* "deleted_at": "2026-10-24T10:03:41.000Z"
|
|
1080
|
+
* }
|
|
1081
|
+
* ],
|
|
1082
|
+
* "issued_at": "2026-10-24T10:03:41.000Z",
|
|
1083
|
+
* "signature": {
|
|
1084
|
+
* "alg": "Ed25519",
|
|
1085
|
+
* "key_id": "rk_2026_10",
|
|
1086
|
+
* "value": "k3M9…"
|
|
1087
|
+
* }
|
|
1088
|
+
* }
|
|
1089
|
+
* }
|
|
1090
|
+
*/
|
|
1091
|
+
DeletionReceiptResponse: {
|
|
1092
|
+
/** @description Which files were deleted and when, signed with Ed25519: check `signature` with the public key whose `kid` matches at `GET /v1/receipts/keys` */
|
|
1093
|
+
receipt: {
|
|
1094
|
+
[key: string]: unknown;
|
|
1095
|
+
};
|
|
1096
|
+
};
|
|
1097
|
+
/**
|
|
1098
|
+
* @example {
|
|
1099
|
+
* "id": "wh_01JBXA6K8M0P2R4S6T8V0W2X4Y",
|
|
1100
|
+
* "url": "https://example.com/formatjet/events",
|
|
1101
|
+
* "description": "Production receiver",
|
|
1102
|
+
* "events": [
|
|
1103
|
+
* "job.completed",
|
|
1104
|
+
* "job.failed",
|
|
1105
|
+
* "job.canceled"
|
|
1106
|
+
* ],
|
|
1107
|
+
* "mode": "live",
|
|
1108
|
+
* "enabled": true,
|
|
1109
|
+
* "disabled_reason": null,
|
|
1110
|
+
* "failing_since": null,
|
|
1111
|
+
* "previous_secret_expires_at": null,
|
|
1112
|
+
* "created_at": "2026-10-24T09:12:40.000Z",
|
|
1113
|
+
* "updated_at": "2026-10-24T09:12:40.000Z",
|
|
1114
|
+
* "secret": "whsec_3fK8mQ2xV7nR1tY5wZ9bC4dG6hJ0kL2p"
|
|
1115
|
+
* }
|
|
1116
|
+
*/
|
|
1117
|
+
WebhookEndpointWithSecret: components["schemas"]["WebhookEndpoint"] & {
|
|
1118
|
+
/** @description Verifies the `FormatJet-Signature` header. Shown now only: keep it safe. */
|
|
1119
|
+
secret: string;
|
|
1120
|
+
};
|
|
1121
|
+
/**
|
|
1122
|
+
* @example {
|
|
1123
|
+
* "id": "wh_01JBXA6K8M0P2R4S6T8V0W2X4Y",
|
|
1124
|
+
* "url": "https://example.com/formatjet/events",
|
|
1125
|
+
* "description": "Production receiver",
|
|
1126
|
+
* "events": [
|
|
1127
|
+
* "job.completed",
|
|
1128
|
+
* "job.failed",
|
|
1129
|
+
* "job.canceled"
|
|
1130
|
+
* ],
|
|
1131
|
+
* "mode": "live",
|
|
1132
|
+
* "enabled": true,
|
|
1133
|
+
* "disabled_reason": null,
|
|
1134
|
+
* "failing_since": null,
|
|
1135
|
+
* "previous_secret_expires_at": null,
|
|
1136
|
+
* "created_at": "2026-10-24T09:12:40.000Z",
|
|
1137
|
+
* "updated_at": "2026-10-24T09:12:40.000Z"
|
|
1138
|
+
* }
|
|
1139
|
+
*/
|
|
1140
|
+
WebhookEndpoint: {
|
|
1141
|
+
id: string;
|
|
1142
|
+
url: string;
|
|
1143
|
+
description: string | null;
|
|
1144
|
+
events: ("job.completed" | "job.failed" | "job.canceled")[];
|
|
1145
|
+
/** @enum {string} */
|
|
1146
|
+
mode: "live" | "test";
|
|
1147
|
+
enabled: boolean;
|
|
1148
|
+
/**
|
|
1149
|
+
* @description `failing`: turned off after 24 hours of failed deliveries
|
|
1150
|
+
* @enum {string|null}
|
|
1151
|
+
*/
|
|
1152
|
+
disabled_reason: "failing" | "user" | null;
|
|
1153
|
+
failing_since: string | null;
|
|
1154
|
+
/** @description After a rotation, the old secret signs beside the new one until then */
|
|
1155
|
+
previous_secret_expires_at: string | null;
|
|
1156
|
+
created_at: string;
|
|
1157
|
+
updated_at: string;
|
|
1158
|
+
};
|
|
1159
|
+
/**
|
|
1160
|
+
* @example {
|
|
1161
|
+
* "url": "https://example.com/formatjet/events",
|
|
1162
|
+
* "events": [
|
|
1163
|
+
* "job.completed",
|
|
1164
|
+
* "job.failed"
|
|
1165
|
+
* ],
|
|
1166
|
+
* "description": "Production receiver"
|
|
1167
|
+
* }
|
|
1168
|
+
*/
|
|
1169
|
+
WebhookEndpointRequest: {
|
|
1170
|
+
url: string;
|
|
1171
|
+
/** @description Events to send; every event when left out */
|
|
1172
|
+
events?: ("job.completed" | "job.failed" | "job.canceled")[];
|
|
1173
|
+
description?: string;
|
|
1174
|
+
};
|
|
1175
|
+
/**
|
|
1176
|
+
* @example {
|
|
1177
|
+
* "enabled": false
|
|
1178
|
+
* }
|
|
1179
|
+
*/
|
|
1180
|
+
WebhookEndpointUpdate: {
|
|
1181
|
+
url?: string;
|
|
1182
|
+
events?: ("job.completed" | "job.failed" | "job.canceled")[];
|
|
1183
|
+
description?: string | null;
|
|
1184
|
+
enabled?: boolean;
|
|
1185
|
+
};
|
|
1186
|
+
/**
|
|
1187
|
+
* @example {
|
|
1188
|
+
* "id": "dlv_01JBXA4D2F4G6H8J0K2M4N6P8Q",
|
|
1189
|
+
* "endpoint_id": "wh_01JBXA6K8M0P2R4S6T8V0W2X4Y",
|
|
1190
|
+
* "event_id": "evt_01JBXA4C7E9G1H3J5K7M9N1P3Q",
|
|
1191
|
+
* "event_type": "job.completed",
|
|
1192
|
+
* "job_id": "job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D",
|
|
1193
|
+
* "mode": "live",
|
|
1194
|
+
* "attempt": 1,
|
|
1195
|
+
* "replay": false,
|
|
1196
|
+
* "succeeded": true,
|
|
1197
|
+
* "status_code": 200,
|
|
1198
|
+
* "error": null,
|
|
1199
|
+
* "duration_ms": 182,
|
|
1200
|
+
* "next_attempt_at": null,
|
|
1201
|
+
* "created_at": "2026-10-24T10:00:06.000Z"
|
|
1202
|
+
* }
|
|
1203
|
+
*/
|
|
1204
|
+
WebhookDelivery: {
|
|
1205
|
+
id: string;
|
|
1206
|
+
endpoint_id: string | null;
|
|
1207
|
+
event_id: string;
|
|
1208
|
+
/** @enum {string} */
|
|
1209
|
+
event_type: "job.completed" | "job.failed" | "job.canceled";
|
|
1210
|
+
job_id: string;
|
|
1211
|
+
/** @enum {string} */
|
|
1212
|
+
mode: "live" | "test";
|
|
1213
|
+
attempt: number;
|
|
1214
|
+
replay: boolean;
|
|
1215
|
+
succeeded: boolean;
|
|
1216
|
+
status_code: number | null;
|
|
1217
|
+
/** @description `timeout`, `unreachable`, `refused_url`, `redirect` or `http_status` */
|
|
1218
|
+
error: string | null;
|
|
1219
|
+
duration_ms: number;
|
|
1220
|
+
next_attempt_at: string | null;
|
|
1221
|
+
created_at: string;
|
|
1222
|
+
};
|
|
1223
|
+
};
|
|
1224
|
+
responses: never;
|
|
1225
|
+
parameters: never;
|
|
1226
|
+
requestBodies: never;
|
|
1227
|
+
headers: never;
|
|
1228
|
+
pathItems: never;
|
|
1229
|
+
}
|
|
1230
|
+
export type $defs = Record<string, never>;
|
|
1231
|
+
export interface operations {
|
|
1232
|
+
listFormats: {
|
|
1233
|
+
parameters: {
|
|
1234
|
+
query?: never;
|
|
1235
|
+
header?: never;
|
|
1236
|
+
path?: never;
|
|
1237
|
+
cookie?: never;
|
|
1238
|
+
};
|
|
1239
|
+
requestBody?: never;
|
|
1240
|
+
responses: {
|
|
1241
|
+
/** @description Supported formats */
|
|
1242
|
+
200: {
|
|
1243
|
+
headers: {
|
|
1244
|
+
[name: string]: unknown;
|
|
1245
|
+
};
|
|
1246
|
+
content: {
|
|
1247
|
+
"application/json": {
|
|
1248
|
+
data: components["schemas"]["Format"][];
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
};
|
|
1254
|
+
listOperations: {
|
|
1255
|
+
parameters: {
|
|
1256
|
+
query?: {
|
|
1257
|
+
/** @description Input format */
|
|
1258
|
+
from?: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
1259
|
+
/** @description Output format */
|
|
1260
|
+
to?: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
1261
|
+
};
|
|
1262
|
+
header?: never;
|
|
1263
|
+
path?: never;
|
|
1264
|
+
cookie?: never;
|
|
1265
|
+
};
|
|
1266
|
+
requestBody?: never;
|
|
1267
|
+
responses: {
|
|
1268
|
+
/** @description Conversions */
|
|
1269
|
+
200: {
|
|
1270
|
+
headers: {
|
|
1271
|
+
[name: string]: unknown;
|
|
1272
|
+
};
|
|
1273
|
+
content: {
|
|
1274
|
+
"application/json": {
|
|
1275
|
+
data: components["schemas"]["Operation"][];
|
|
1276
|
+
};
|
|
1277
|
+
};
|
|
1278
|
+
};
|
|
1279
|
+
/** @description `from` or `to` isn’t a format we know. */
|
|
1280
|
+
400: {
|
|
1281
|
+
headers: {
|
|
1282
|
+
[name: string]: unknown;
|
|
1283
|
+
};
|
|
1284
|
+
content: {
|
|
1285
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1286
|
+
};
|
|
1287
|
+
};
|
|
1288
|
+
};
|
|
1289
|
+
};
|
|
1290
|
+
getPricing: {
|
|
1291
|
+
parameters: {
|
|
1292
|
+
query?: never;
|
|
1293
|
+
header?: never;
|
|
1294
|
+
path?: never;
|
|
1295
|
+
cookie?: never;
|
|
1296
|
+
};
|
|
1297
|
+
requestBody?: never;
|
|
1298
|
+
responses: {
|
|
1299
|
+
/** @description Pricing */
|
|
1300
|
+
200: {
|
|
1301
|
+
headers: {
|
|
1302
|
+
[name: string]: unknown;
|
|
1303
|
+
};
|
|
1304
|
+
content: {
|
|
1305
|
+
"application/json": components["schemas"]["Pricing"];
|
|
1306
|
+
};
|
|
1307
|
+
};
|
|
1308
|
+
};
|
|
1309
|
+
};
|
|
1310
|
+
getUsage: {
|
|
1311
|
+
parameters: {
|
|
1312
|
+
query?: {
|
|
1313
|
+
/** @description How many days, 7 to 90 */
|
|
1314
|
+
days?: number;
|
|
1315
|
+
};
|
|
1316
|
+
header?: never;
|
|
1317
|
+
path?: never;
|
|
1318
|
+
cookie?: never;
|
|
1319
|
+
};
|
|
1320
|
+
requestBody?: never;
|
|
1321
|
+
responses: {
|
|
1322
|
+
/** @description Usage */
|
|
1323
|
+
200: {
|
|
1324
|
+
headers: {
|
|
1325
|
+
[name: string]: unknown;
|
|
1326
|
+
};
|
|
1327
|
+
content: {
|
|
1328
|
+
"application/json": components["schemas"]["Usage"];
|
|
1329
|
+
};
|
|
1330
|
+
};
|
|
1331
|
+
/** @description `days` outside 7 to 90. */
|
|
1332
|
+
400: {
|
|
1333
|
+
headers: {
|
|
1334
|
+
[name: string]: unknown;
|
|
1335
|
+
};
|
|
1336
|
+
content: {
|
|
1337
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1338
|
+
};
|
|
1339
|
+
};
|
|
1340
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
1341
|
+
401: {
|
|
1342
|
+
headers: {
|
|
1343
|
+
[name: string]: unknown;
|
|
1344
|
+
};
|
|
1345
|
+
content: {
|
|
1346
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1347
|
+
};
|
|
1348
|
+
};
|
|
1349
|
+
/** @description The key lacks the `read` scope, or the plan has no API. */
|
|
1350
|
+
403: {
|
|
1351
|
+
headers: {
|
|
1352
|
+
[name: string]: unknown;
|
|
1353
|
+
};
|
|
1354
|
+
content: {
|
|
1355
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1356
|
+
};
|
|
1357
|
+
};
|
|
1358
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
1359
|
+
429: {
|
|
1360
|
+
headers: {
|
|
1361
|
+
/** @description Seconds to wait before trying again */
|
|
1362
|
+
"Retry-After"?: number;
|
|
1363
|
+
[name: string]: unknown;
|
|
1364
|
+
};
|
|
1365
|
+
content: {
|
|
1366
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1369
|
+
};
|
|
1370
|
+
};
|
|
1371
|
+
getAccount: {
|
|
1372
|
+
parameters: {
|
|
1373
|
+
query?: never;
|
|
1374
|
+
header?: never;
|
|
1375
|
+
path?: never;
|
|
1376
|
+
cookie?: never;
|
|
1377
|
+
};
|
|
1378
|
+
requestBody?: never;
|
|
1379
|
+
responses: {
|
|
1380
|
+
/** @description Account */
|
|
1381
|
+
200: {
|
|
1382
|
+
headers: {
|
|
1383
|
+
[name: string]: unknown;
|
|
1384
|
+
};
|
|
1385
|
+
content: {
|
|
1386
|
+
"application/json": components["schemas"]["Account"];
|
|
1387
|
+
};
|
|
1388
|
+
};
|
|
1389
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
1390
|
+
401: {
|
|
1391
|
+
headers: {
|
|
1392
|
+
[name: string]: unknown;
|
|
1393
|
+
};
|
|
1394
|
+
content: {
|
|
1395
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1396
|
+
};
|
|
1397
|
+
};
|
|
1398
|
+
/** @description The key lacks the `read` scope, or the plan has no API. */
|
|
1399
|
+
403: {
|
|
1400
|
+
headers: {
|
|
1401
|
+
[name: string]: unknown;
|
|
1402
|
+
};
|
|
1403
|
+
content: {
|
|
1404
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1405
|
+
};
|
|
1406
|
+
};
|
|
1407
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
1408
|
+
429: {
|
|
1409
|
+
headers: {
|
|
1410
|
+
/** @description Seconds to wait before trying again */
|
|
1411
|
+
"Retry-After"?: number;
|
|
1412
|
+
[name: string]: unknown;
|
|
1413
|
+
};
|
|
1414
|
+
content: {
|
|
1415
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
};
|
|
1419
|
+
};
|
|
1420
|
+
createUpload: {
|
|
1421
|
+
parameters: {
|
|
1422
|
+
query?: never;
|
|
1423
|
+
header?: {
|
|
1424
|
+
/** @description Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (`Idempotent-Replayed: true`); the same key with a different request is a 409. */
|
|
1425
|
+
"idempotency-key"?: string;
|
|
1426
|
+
};
|
|
1427
|
+
path?: never;
|
|
1428
|
+
cookie?: never;
|
|
1429
|
+
};
|
|
1430
|
+
requestBody: {
|
|
1431
|
+
content: {
|
|
1432
|
+
"application/json": components["schemas"]["UploadRequest"];
|
|
1433
|
+
};
|
|
1434
|
+
};
|
|
1435
|
+
responses: {
|
|
1436
|
+
/** @description The upload */
|
|
1437
|
+
201: {
|
|
1438
|
+
headers: {
|
|
1439
|
+
[name: string]: unknown;
|
|
1440
|
+
};
|
|
1441
|
+
content: {
|
|
1442
|
+
"application/json": components["schemas"]["Upload"];
|
|
1443
|
+
};
|
|
1444
|
+
};
|
|
1445
|
+
/** @description The body failed validation. */
|
|
1446
|
+
400: {
|
|
1447
|
+
headers: {
|
|
1448
|
+
[name: string]: unknown;
|
|
1449
|
+
};
|
|
1450
|
+
content: {
|
|
1451
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1452
|
+
};
|
|
1453
|
+
};
|
|
1454
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
1455
|
+
401: {
|
|
1456
|
+
headers: {
|
|
1457
|
+
[name: string]: unknown;
|
|
1458
|
+
};
|
|
1459
|
+
content: {
|
|
1460
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1461
|
+
};
|
|
1462
|
+
};
|
|
1463
|
+
/** @description The key lacks the `convert` scope, or the plan has no API. */
|
|
1464
|
+
403: {
|
|
1465
|
+
headers: {
|
|
1466
|
+
[name: string]: unknown;
|
|
1467
|
+
};
|
|
1468
|
+
content: {
|
|
1469
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1470
|
+
};
|
|
1471
|
+
};
|
|
1472
|
+
/** @description The `Idempotency-Key` was used for a different request in the last 24 hours, or its first request is still running. */
|
|
1473
|
+
409: {
|
|
1474
|
+
headers: {
|
|
1475
|
+
/** @description Seconds to wait before trying again */
|
|
1476
|
+
"Retry-After"?: number;
|
|
1477
|
+
[name: string]: unknown;
|
|
1478
|
+
};
|
|
1479
|
+
content: {
|
|
1480
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1481
|
+
};
|
|
1482
|
+
};
|
|
1483
|
+
/** @description Larger than the plan (or test mode) allows. */
|
|
1484
|
+
413: {
|
|
1485
|
+
headers: {
|
|
1486
|
+
[name: string]: unknown;
|
|
1487
|
+
};
|
|
1488
|
+
content: {
|
|
1489
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1492
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
1493
|
+
429: {
|
|
1494
|
+
headers: {
|
|
1495
|
+
/** @description Seconds to wait before trying again */
|
|
1496
|
+
"Retry-After"?: number;
|
|
1497
|
+
[name: string]: unknown;
|
|
1498
|
+
};
|
|
1499
|
+
content: {
|
|
1500
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1501
|
+
};
|
|
1502
|
+
};
|
|
1503
|
+
};
|
|
1504
|
+
};
|
|
1505
|
+
listJobs: {
|
|
1506
|
+
parameters: {
|
|
1507
|
+
query?: {
|
|
1508
|
+
/** @description Jobs per page, 1 to 100 */
|
|
1509
|
+
limit?: number;
|
|
1510
|
+
/** @description The last page’s `next_cursor` */
|
|
1511
|
+
cursor?: string;
|
|
1512
|
+
};
|
|
1513
|
+
header?: never;
|
|
1514
|
+
path?: never;
|
|
1515
|
+
cookie?: never;
|
|
1516
|
+
};
|
|
1517
|
+
requestBody?: never;
|
|
1518
|
+
responses: {
|
|
1519
|
+
/** @description Jobs, newest first */
|
|
1520
|
+
200: {
|
|
1521
|
+
headers: {
|
|
1522
|
+
[name: string]: unknown;
|
|
1523
|
+
};
|
|
1524
|
+
content: {
|
|
1525
|
+
"application/json": {
|
|
1526
|
+
data: components["schemas"]["JobSummary"][];
|
|
1527
|
+
next_cursor: string | null;
|
|
1528
|
+
};
|
|
1529
|
+
};
|
|
1530
|
+
};
|
|
1531
|
+
/** @description `limit` outside 1 to 100. */
|
|
1532
|
+
400: {
|
|
1533
|
+
headers: {
|
|
1534
|
+
[name: string]: unknown;
|
|
1535
|
+
};
|
|
1536
|
+
content: {
|
|
1537
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1538
|
+
};
|
|
1539
|
+
};
|
|
1540
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
1541
|
+
401: {
|
|
1542
|
+
headers: {
|
|
1543
|
+
[name: string]: unknown;
|
|
1544
|
+
};
|
|
1545
|
+
content: {
|
|
1546
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1547
|
+
};
|
|
1548
|
+
};
|
|
1549
|
+
/** @description The key lacks the `read` scope, or the plan has no API. */
|
|
1550
|
+
403: {
|
|
1551
|
+
headers: {
|
|
1552
|
+
[name: string]: unknown;
|
|
1553
|
+
};
|
|
1554
|
+
content: {
|
|
1555
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1556
|
+
};
|
|
1557
|
+
};
|
|
1558
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
1559
|
+
429: {
|
|
1560
|
+
headers: {
|
|
1561
|
+
/** @description Seconds to wait before trying again */
|
|
1562
|
+
"Retry-After"?: number;
|
|
1563
|
+
[name: string]: unknown;
|
|
1564
|
+
};
|
|
1565
|
+
content: {
|
|
1566
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1567
|
+
};
|
|
1568
|
+
};
|
|
1569
|
+
};
|
|
1570
|
+
};
|
|
1571
|
+
createJob: {
|
|
1572
|
+
parameters: {
|
|
1573
|
+
query?: never;
|
|
1574
|
+
header?: {
|
|
1575
|
+
/** @description Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (`Idempotent-Replayed: true`); the same key with a different request is a 409. */
|
|
1576
|
+
"idempotency-key"?: string;
|
|
1577
|
+
};
|
|
1578
|
+
path?: never;
|
|
1579
|
+
cookie?: never;
|
|
1580
|
+
};
|
|
1581
|
+
requestBody: {
|
|
1582
|
+
content: {
|
|
1583
|
+
"application/json": components["schemas"]["JobRequest"];
|
|
1584
|
+
};
|
|
1585
|
+
};
|
|
1586
|
+
responses: {
|
|
1587
|
+
/** @description The job, running */
|
|
1588
|
+
201: {
|
|
1589
|
+
headers: {
|
|
1590
|
+
[name: string]: unknown;
|
|
1591
|
+
};
|
|
1592
|
+
content: {
|
|
1593
|
+
"application/json": components["schemas"]["Job"];
|
|
1594
|
+
};
|
|
1595
|
+
};
|
|
1596
|
+
/** @description The body failed validation, or an upload isn’t ready. */
|
|
1597
|
+
400: {
|
|
1598
|
+
headers: {
|
|
1599
|
+
[name: string]: unknown;
|
|
1600
|
+
};
|
|
1601
|
+
content: {
|
|
1602
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1603
|
+
};
|
|
1604
|
+
};
|
|
1605
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
1606
|
+
401: {
|
|
1607
|
+
headers: {
|
|
1608
|
+
[name: string]: unknown;
|
|
1609
|
+
};
|
|
1610
|
+
content: {
|
|
1611
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1612
|
+
};
|
|
1613
|
+
};
|
|
1614
|
+
/** @description Not enough credits for the job. */
|
|
1615
|
+
402: {
|
|
1616
|
+
headers: {
|
|
1617
|
+
[name: string]: unknown;
|
|
1618
|
+
};
|
|
1619
|
+
content: {
|
|
1620
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1621
|
+
};
|
|
1622
|
+
};
|
|
1623
|
+
/** @description The key lacks the `convert` scope, or the plan has no API. */
|
|
1624
|
+
403: {
|
|
1625
|
+
headers: {
|
|
1626
|
+
[name: string]: unknown;
|
|
1627
|
+
};
|
|
1628
|
+
content: {
|
|
1629
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1630
|
+
};
|
|
1631
|
+
};
|
|
1632
|
+
/** @description No such upload. */
|
|
1633
|
+
404: {
|
|
1634
|
+
headers: {
|
|
1635
|
+
[name: string]: unknown;
|
|
1636
|
+
};
|
|
1637
|
+
content: {
|
|
1638
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1639
|
+
};
|
|
1640
|
+
};
|
|
1641
|
+
/** @description The `Idempotency-Key` was used for a different request in the last 24 hours, or its first request is still running. */
|
|
1642
|
+
409: {
|
|
1643
|
+
headers: {
|
|
1644
|
+
/** @description Seconds to wait before trying again */
|
|
1645
|
+
"Retry-After"?: number;
|
|
1646
|
+
[name: string]: unknown;
|
|
1647
|
+
};
|
|
1648
|
+
content: {
|
|
1649
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1650
|
+
};
|
|
1651
|
+
};
|
|
1652
|
+
/** @description Larger than the plan, test mode or the engine takes. */
|
|
1653
|
+
413: {
|
|
1654
|
+
headers: {
|
|
1655
|
+
[name: string]: unknown;
|
|
1656
|
+
};
|
|
1657
|
+
content: {
|
|
1658
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1659
|
+
};
|
|
1660
|
+
};
|
|
1661
|
+
/** @description A conversion we can’t run for this file. */
|
|
1662
|
+
422: {
|
|
1663
|
+
headers: {
|
|
1664
|
+
[name: string]: unknown;
|
|
1665
|
+
};
|
|
1666
|
+
content: {
|
|
1667
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1668
|
+
};
|
|
1669
|
+
};
|
|
1670
|
+
/** @description Over the rate limit, or as many jobs running as the plan allows: wait `Retry-After` seconds. */
|
|
1671
|
+
429: {
|
|
1672
|
+
headers: {
|
|
1673
|
+
/** @description Seconds to wait before trying again */
|
|
1674
|
+
"Retry-After"?: number;
|
|
1675
|
+
[name: string]: unknown;
|
|
1676
|
+
};
|
|
1677
|
+
content: {
|
|
1678
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1679
|
+
};
|
|
1680
|
+
};
|
|
1681
|
+
};
|
|
1682
|
+
};
|
|
1683
|
+
estimateJob: {
|
|
1684
|
+
parameters: {
|
|
1685
|
+
query?: never;
|
|
1686
|
+
header?: {
|
|
1687
|
+
/** @description Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (`Idempotent-Replayed: true`); the same key with a different request is a 409. */
|
|
1688
|
+
"idempotency-key"?: string;
|
|
1689
|
+
};
|
|
1690
|
+
path?: never;
|
|
1691
|
+
cookie?: never;
|
|
1692
|
+
};
|
|
1693
|
+
requestBody: {
|
|
1694
|
+
content: {
|
|
1695
|
+
"application/json": components["schemas"]["EstimateRequest"];
|
|
1696
|
+
};
|
|
1697
|
+
};
|
|
1698
|
+
responses: {
|
|
1699
|
+
/** @description The estimate */
|
|
1700
|
+
200: {
|
|
1701
|
+
headers: {
|
|
1702
|
+
[name: string]: unknown;
|
|
1703
|
+
};
|
|
1704
|
+
content: {
|
|
1705
|
+
"application/json": components["schemas"]["Estimate"];
|
|
1706
|
+
};
|
|
1707
|
+
};
|
|
1708
|
+
/** @description The body failed validation. */
|
|
1709
|
+
400: {
|
|
1710
|
+
headers: {
|
|
1711
|
+
[name: string]: unknown;
|
|
1712
|
+
};
|
|
1713
|
+
content: {
|
|
1714
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1715
|
+
};
|
|
1716
|
+
};
|
|
1717
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
1718
|
+
401: {
|
|
1719
|
+
headers: {
|
|
1720
|
+
[name: string]: unknown;
|
|
1721
|
+
};
|
|
1722
|
+
content: {
|
|
1723
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1724
|
+
};
|
|
1725
|
+
};
|
|
1726
|
+
/** @description The key lacks the `read` or `convert` scope, or the plan has no API. */
|
|
1727
|
+
403: {
|
|
1728
|
+
headers: {
|
|
1729
|
+
[name: string]: unknown;
|
|
1730
|
+
};
|
|
1731
|
+
content: {
|
|
1732
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1733
|
+
};
|
|
1734
|
+
};
|
|
1735
|
+
/** @description The `Idempotency-Key` was used for a different request in the last 24 hours, or its first request is still running. */
|
|
1736
|
+
409: {
|
|
1737
|
+
headers: {
|
|
1738
|
+
/** @description Seconds to wait before trying again */
|
|
1739
|
+
"Retry-After"?: number;
|
|
1740
|
+
[name: string]: unknown;
|
|
1741
|
+
};
|
|
1742
|
+
content: {
|
|
1743
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1744
|
+
};
|
|
1745
|
+
};
|
|
1746
|
+
/** @description Larger than the plan, test mode or the engine takes. */
|
|
1747
|
+
413: {
|
|
1748
|
+
headers: {
|
|
1749
|
+
[name: string]: unknown;
|
|
1750
|
+
};
|
|
1751
|
+
content: {
|
|
1752
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1753
|
+
};
|
|
1754
|
+
};
|
|
1755
|
+
/** @description A conversion we can’t run. */
|
|
1756
|
+
422: {
|
|
1757
|
+
headers: {
|
|
1758
|
+
[name: string]: unknown;
|
|
1759
|
+
};
|
|
1760
|
+
content: {
|
|
1761
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1762
|
+
};
|
|
1763
|
+
};
|
|
1764
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
1765
|
+
429: {
|
|
1766
|
+
headers: {
|
|
1767
|
+
/** @description Seconds to wait before trying again */
|
|
1768
|
+
"Retry-After"?: number;
|
|
1769
|
+
[name: string]: unknown;
|
|
1770
|
+
};
|
|
1771
|
+
content: {
|
|
1772
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1773
|
+
};
|
|
1774
|
+
};
|
|
1775
|
+
};
|
|
1776
|
+
};
|
|
1777
|
+
convert: {
|
|
1778
|
+
parameters: {
|
|
1779
|
+
query?: {
|
|
1780
|
+
conversion?: string;
|
|
1781
|
+
from?: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
1782
|
+
to?: "jpg" | "jfif" | "png" | "webp" | "avif" | "heic" | "gif" | "bmp" | "tiff" | "ico" | "svg" | "pdf" | "docx" | "doc" | "odt" | "xlsx" | "xls" | "ods" | "pptx" | "ppt" | "odp" | "mp3" | "wav" | "m4a" | "aac" | "ogg" | "opus" | "flac" | "mp4" | "mov" | "mkv" | "webm" | "csv" | "tsv" | "json" | "xml" | "yaml" | "txt" | "html" | "md";
|
|
1783
|
+
/** @description The step’s options, as a JSON object */
|
|
1784
|
+
options?: string;
|
|
1785
|
+
/** @description The file’s name, for a raw body. Never logged. */
|
|
1786
|
+
filename?: string;
|
|
1787
|
+
output_filename?: string;
|
|
1788
|
+
/** @description Seconds the output is kept after completion (default 86400) */
|
|
1789
|
+
ttl?: number;
|
|
1790
|
+
};
|
|
1791
|
+
header?: {
|
|
1792
|
+
/** @description Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (`Idempotent-Replayed: true`); the same key with a different request is a 409. */
|
|
1793
|
+
"idempotency-key"?: string;
|
|
1794
|
+
};
|
|
1795
|
+
path?: never;
|
|
1796
|
+
cookie?: never;
|
|
1797
|
+
};
|
|
1798
|
+
requestBody: {
|
|
1799
|
+
content: {
|
|
1800
|
+
"multipart/form-data": {
|
|
1801
|
+
/** Format: binary */
|
|
1802
|
+
file: string;
|
|
1803
|
+
};
|
|
1804
|
+
"application/octet-stream": string;
|
|
1805
|
+
};
|
|
1806
|
+
};
|
|
1807
|
+
responses: {
|
|
1808
|
+
/** @description The converted file (`Content-Disposition` names it), or the job with `Accept: application/json` or when the conversion made several files */
|
|
1809
|
+
200: {
|
|
1810
|
+
headers: {
|
|
1811
|
+
[name: string]: unknown;
|
|
1812
|
+
};
|
|
1813
|
+
content: {
|
|
1814
|
+
"application/octet-stream": string;
|
|
1815
|
+
"application/json": components["schemas"]["Job"];
|
|
1816
|
+
};
|
|
1817
|
+
};
|
|
1818
|
+
/** @description Still converting after 30 s: the job, which carries on */
|
|
1819
|
+
202: {
|
|
1820
|
+
headers: {
|
|
1821
|
+
[name: string]: unknown;
|
|
1822
|
+
};
|
|
1823
|
+
content: {
|
|
1824
|
+
"application/json": components["schemas"]["Job"];
|
|
1825
|
+
};
|
|
1826
|
+
};
|
|
1827
|
+
/** @description The query or body is wrong: no conversion named, an empty file. */
|
|
1828
|
+
400: {
|
|
1829
|
+
headers: {
|
|
1830
|
+
[name: string]: unknown;
|
|
1831
|
+
};
|
|
1832
|
+
content: {
|
|
1833
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
1837
|
+
401: {
|
|
1838
|
+
headers: {
|
|
1839
|
+
[name: string]: unknown;
|
|
1840
|
+
};
|
|
1841
|
+
content: {
|
|
1842
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1843
|
+
};
|
|
1844
|
+
};
|
|
1845
|
+
/** @description Not enough credits for the job. */
|
|
1846
|
+
402: {
|
|
1847
|
+
headers: {
|
|
1848
|
+
[name: string]: unknown;
|
|
1849
|
+
};
|
|
1850
|
+
content: {
|
|
1851
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1852
|
+
};
|
|
1853
|
+
};
|
|
1854
|
+
/** @description The key lacks the `convert` scope, or the plan has no API. */
|
|
1855
|
+
403: {
|
|
1856
|
+
headers: {
|
|
1857
|
+
[name: string]: unknown;
|
|
1858
|
+
};
|
|
1859
|
+
content: {
|
|
1860
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1861
|
+
};
|
|
1862
|
+
};
|
|
1863
|
+
/** @description The `Idempotency-Key` was used for a different request in the last 24 hours, or its first request is still running. */
|
|
1864
|
+
409: {
|
|
1865
|
+
headers: {
|
|
1866
|
+
/** @description Seconds to wait before trying again */
|
|
1867
|
+
"Retry-After"?: number;
|
|
1868
|
+
[name: string]: unknown;
|
|
1869
|
+
};
|
|
1870
|
+
content: {
|
|
1871
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1872
|
+
};
|
|
1873
|
+
};
|
|
1874
|
+
/** @description Larger than 25 MB, or than the plan, test mode or the engine takes. */
|
|
1875
|
+
413: {
|
|
1876
|
+
headers: {
|
|
1877
|
+
[name: string]: unknown;
|
|
1878
|
+
};
|
|
1879
|
+
content: {
|
|
1880
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1881
|
+
};
|
|
1882
|
+
};
|
|
1883
|
+
/** @description A conversion we can’t run for this file. A file the conversion can’t take yet, such as a scan. A file the engine couldn’t read. A file protected with a password. */
|
|
1884
|
+
422: {
|
|
1885
|
+
headers: {
|
|
1886
|
+
[name: string]: unknown;
|
|
1887
|
+
};
|
|
1888
|
+
content: {
|
|
1889
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1890
|
+
};
|
|
1891
|
+
};
|
|
1892
|
+
/** @description Over the rate limit, or as many jobs running as the plan allows: wait `Retry-After` seconds. */
|
|
1893
|
+
429: {
|
|
1894
|
+
headers: {
|
|
1895
|
+
/** @description Seconds to wait before trying again */
|
|
1896
|
+
"Retry-After"?: number;
|
|
1897
|
+
[name: string]: unknown;
|
|
1898
|
+
};
|
|
1899
|
+
content: {
|
|
1900
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1901
|
+
};
|
|
1902
|
+
};
|
|
1903
|
+
/** @description The conversion failed (no charge). */
|
|
1904
|
+
500: {
|
|
1905
|
+
headers: {
|
|
1906
|
+
[name: string]: unknown;
|
|
1907
|
+
};
|
|
1908
|
+
content: {
|
|
1909
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1910
|
+
};
|
|
1911
|
+
};
|
|
1912
|
+
/** @description The engine took too long (no charge). */
|
|
1913
|
+
504: {
|
|
1914
|
+
headers: {
|
|
1915
|
+
[name: string]: unknown;
|
|
1916
|
+
};
|
|
1917
|
+
content: {
|
|
1918
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1919
|
+
};
|
|
1920
|
+
};
|
|
1921
|
+
};
|
|
1922
|
+
};
|
|
1923
|
+
getJob: {
|
|
1924
|
+
parameters: {
|
|
1925
|
+
query?: never;
|
|
1926
|
+
header?: never;
|
|
1927
|
+
path: {
|
|
1928
|
+
id: string;
|
|
1929
|
+
};
|
|
1930
|
+
cookie?: never;
|
|
1931
|
+
};
|
|
1932
|
+
requestBody?: never;
|
|
1933
|
+
responses: {
|
|
1934
|
+
/** @description The job */
|
|
1935
|
+
200: {
|
|
1936
|
+
headers: {
|
|
1937
|
+
[name: string]: unknown;
|
|
1938
|
+
};
|
|
1939
|
+
content: {
|
|
1940
|
+
"application/json": components["schemas"]["Job"];
|
|
1941
|
+
};
|
|
1942
|
+
};
|
|
1943
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
1944
|
+
401: {
|
|
1945
|
+
headers: {
|
|
1946
|
+
[name: string]: unknown;
|
|
1947
|
+
};
|
|
1948
|
+
content: {
|
|
1949
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1950
|
+
};
|
|
1951
|
+
};
|
|
1952
|
+
/** @description The key lacks the `read` scope, or the plan has no API. */
|
|
1953
|
+
403: {
|
|
1954
|
+
headers: {
|
|
1955
|
+
[name: string]: unknown;
|
|
1956
|
+
};
|
|
1957
|
+
content: {
|
|
1958
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1959
|
+
};
|
|
1960
|
+
};
|
|
1961
|
+
/** @description No such job of this key’s mode, or its files are gone. */
|
|
1962
|
+
404: {
|
|
1963
|
+
headers: {
|
|
1964
|
+
[name: string]: unknown;
|
|
1965
|
+
};
|
|
1966
|
+
content: {
|
|
1967
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1968
|
+
};
|
|
1969
|
+
};
|
|
1970
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
1971
|
+
429: {
|
|
1972
|
+
headers: {
|
|
1973
|
+
/** @description Seconds to wait before trying again */
|
|
1974
|
+
"Retry-After"?: number;
|
|
1975
|
+
[name: string]: unknown;
|
|
1976
|
+
};
|
|
1977
|
+
content: {
|
|
1978
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1982
|
+
};
|
|
1983
|
+
deleteJob: {
|
|
1984
|
+
parameters: {
|
|
1985
|
+
query?: never;
|
|
1986
|
+
header?: never;
|
|
1987
|
+
path: {
|
|
1988
|
+
id: string;
|
|
1989
|
+
};
|
|
1990
|
+
cookie?: never;
|
|
1991
|
+
};
|
|
1992
|
+
requestBody?: never;
|
|
1993
|
+
responses: {
|
|
1994
|
+
/** @description The receipt */
|
|
1995
|
+
200: {
|
|
1996
|
+
headers: {
|
|
1997
|
+
[name: string]: unknown;
|
|
1998
|
+
};
|
|
1999
|
+
content: {
|
|
2000
|
+
"application/json": components["schemas"]["DeletionReceiptResponse"];
|
|
2001
|
+
};
|
|
2002
|
+
};
|
|
2003
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2004
|
+
401: {
|
|
2005
|
+
headers: {
|
|
2006
|
+
[name: string]: unknown;
|
|
2007
|
+
};
|
|
2008
|
+
content: {
|
|
2009
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2010
|
+
};
|
|
2011
|
+
};
|
|
2012
|
+
/** @description The key lacks the `convert` scope, or the plan has no API. */
|
|
2013
|
+
403: {
|
|
2014
|
+
headers: {
|
|
2015
|
+
[name: string]: unknown;
|
|
2016
|
+
};
|
|
2017
|
+
content: {
|
|
2018
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2019
|
+
};
|
|
2020
|
+
};
|
|
2021
|
+
/** @description No such job of this key’s mode, or its files are gone. */
|
|
2022
|
+
404: {
|
|
2023
|
+
headers: {
|
|
2024
|
+
[name: string]: unknown;
|
|
2025
|
+
};
|
|
2026
|
+
content: {
|
|
2027
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2028
|
+
};
|
|
2029
|
+
};
|
|
2030
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2031
|
+
429: {
|
|
2032
|
+
headers: {
|
|
2033
|
+
/** @description Seconds to wait before trying again */
|
|
2034
|
+
"Retry-After"?: number;
|
|
2035
|
+
[name: string]: unknown;
|
|
2036
|
+
};
|
|
2037
|
+
content: {
|
|
2038
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2039
|
+
};
|
|
2040
|
+
};
|
|
2041
|
+
};
|
|
2042
|
+
};
|
|
2043
|
+
streamJobEvents: {
|
|
2044
|
+
parameters: {
|
|
2045
|
+
query?: never;
|
|
2046
|
+
header?: never;
|
|
2047
|
+
path: {
|
|
2048
|
+
id: string;
|
|
2049
|
+
};
|
|
2050
|
+
cookie?: never;
|
|
2051
|
+
};
|
|
2052
|
+
requestBody?: never;
|
|
2053
|
+
responses: {
|
|
2054
|
+
/** @description An event stream */
|
|
2055
|
+
200: {
|
|
2056
|
+
headers: {
|
|
2057
|
+
[name: string]: unknown;
|
|
2058
|
+
};
|
|
2059
|
+
content: {
|
|
2060
|
+
/**
|
|
2061
|
+
* @example id: 1761300006000
|
|
2062
|
+
* event: job.completed
|
|
2063
|
+
* data: {"id":"job_01JBXA3Q6M2T8V4W9Y5Z7B1C3D","status":"completed",…}
|
|
2064
|
+
*/
|
|
2065
|
+
"text/event-stream": string;
|
|
2066
|
+
};
|
|
2067
|
+
};
|
|
2068
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2069
|
+
401: {
|
|
2070
|
+
headers: {
|
|
2071
|
+
[name: string]: unknown;
|
|
2072
|
+
};
|
|
2073
|
+
content: {
|
|
2074
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2075
|
+
};
|
|
2076
|
+
};
|
|
2077
|
+
/** @description The key lacks the `read` scope, or the plan has no API. */
|
|
2078
|
+
403: {
|
|
2079
|
+
headers: {
|
|
2080
|
+
[name: string]: unknown;
|
|
2081
|
+
};
|
|
2082
|
+
content: {
|
|
2083
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2084
|
+
};
|
|
2085
|
+
};
|
|
2086
|
+
/** @description No such job of this key’s mode, or its files are gone. */
|
|
2087
|
+
404: {
|
|
2088
|
+
headers: {
|
|
2089
|
+
[name: string]: unknown;
|
|
2090
|
+
};
|
|
2091
|
+
content: {
|
|
2092
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2093
|
+
};
|
|
2094
|
+
};
|
|
2095
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2096
|
+
429: {
|
|
2097
|
+
headers: {
|
|
2098
|
+
/** @description Seconds to wait before trying again */
|
|
2099
|
+
"Retry-After"?: number;
|
|
2100
|
+
[name: string]: unknown;
|
|
2101
|
+
};
|
|
2102
|
+
content: {
|
|
2103
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2104
|
+
};
|
|
2105
|
+
};
|
|
2106
|
+
};
|
|
2107
|
+
};
|
|
2108
|
+
cancelJob: {
|
|
2109
|
+
parameters: {
|
|
2110
|
+
query?: never;
|
|
2111
|
+
header?: {
|
|
2112
|
+
/** @description Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (`Idempotent-Replayed: true`); the same key with a different request is a 409. */
|
|
2113
|
+
"idempotency-key"?: string;
|
|
2114
|
+
};
|
|
2115
|
+
path: {
|
|
2116
|
+
id: string;
|
|
2117
|
+
};
|
|
2118
|
+
cookie?: never;
|
|
2119
|
+
};
|
|
2120
|
+
requestBody?: never;
|
|
2121
|
+
responses: {
|
|
2122
|
+
/** @description The job */
|
|
2123
|
+
200: {
|
|
2124
|
+
headers: {
|
|
2125
|
+
[name: string]: unknown;
|
|
2126
|
+
};
|
|
2127
|
+
content: {
|
|
2128
|
+
"application/json": components["schemas"]["Job"];
|
|
2129
|
+
};
|
|
2130
|
+
};
|
|
2131
|
+
/** @description An `Idempotency-Key` that isn’t 1 to 255 printable characters. */
|
|
2132
|
+
400: {
|
|
2133
|
+
headers: {
|
|
2134
|
+
[name: string]: unknown;
|
|
2135
|
+
};
|
|
2136
|
+
content: {
|
|
2137
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2138
|
+
};
|
|
2139
|
+
};
|
|
2140
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2141
|
+
401: {
|
|
2142
|
+
headers: {
|
|
2143
|
+
[name: string]: unknown;
|
|
2144
|
+
};
|
|
2145
|
+
content: {
|
|
2146
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2147
|
+
};
|
|
2148
|
+
};
|
|
2149
|
+
/** @description The key lacks the `convert` scope, or the plan has no API. */
|
|
2150
|
+
403: {
|
|
2151
|
+
headers: {
|
|
2152
|
+
[name: string]: unknown;
|
|
2153
|
+
};
|
|
2154
|
+
content: {
|
|
2155
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2156
|
+
};
|
|
2157
|
+
};
|
|
2158
|
+
/** @description No such job of this key’s mode, or its files are gone. */
|
|
2159
|
+
404: {
|
|
2160
|
+
headers: {
|
|
2161
|
+
[name: string]: unknown;
|
|
2162
|
+
};
|
|
2163
|
+
content: {
|
|
2164
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2165
|
+
};
|
|
2166
|
+
};
|
|
2167
|
+
/** @description The `Idempotency-Key` was used for a different request in the last 24 hours, or its first request is still running. */
|
|
2168
|
+
409: {
|
|
2169
|
+
headers: {
|
|
2170
|
+
/** @description Seconds to wait before trying again */
|
|
2171
|
+
"Retry-After"?: number;
|
|
2172
|
+
[name: string]: unknown;
|
|
2173
|
+
};
|
|
2174
|
+
content: {
|
|
2175
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2176
|
+
};
|
|
2177
|
+
};
|
|
2178
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2179
|
+
429: {
|
|
2180
|
+
headers: {
|
|
2181
|
+
/** @description Seconds to wait before trying again */
|
|
2182
|
+
"Retry-After"?: number;
|
|
2183
|
+
[name: string]: unknown;
|
|
2184
|
+
};
|
|
2185
|
+
content: {
|
|
2186
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2187
|
+
};
|
|
2188
|
+
};
|
|
2189
|
+
};
|
|
2190
|
+
};
|
|
2191
|
+
listWebhooks: {
|
|
2192
|
+
parameters: {
|
|
2193
|
+
query?: never;
|
|
2194
|
+
header?: never;
|
|
2195
|
+
path?: never;
|
|
2196
|
+
cookie?: never;
|
|
2197
|
+
};
|
|
2198
|
+
requestBody?: never;
|
|
2199
|
+
responses: {
|
|
2200
|
+
/** @description Endpoints, newest first */
|
|
2201
|
+
200: {
|
|
2202
|
+
headers: {
|
|
2203
|
+
[name: string]: unknown;
|
|
2204
|
+
};
|
|
2205
|
+
content: {
|
|
2206
|
+
"application/json": {
|
|
2207
|
+
data: components["schemas"]["WebhookEndpoint"][];
|
|
2208
|
+
};
|
|
2209
|
+
};
|
|
2210
|
+
};
|
|
2211
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2212
|
+
401: {
|
|
2213
|
+
headers: {
|
|
2214
|
+
[name: string]: unknown;
|
|
2215
|
+
};
|
|
2216
|
+
content: {
|
|
2217
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2218
|
+
};
|
|
2219
|
+
};
|
|
2220
|
+
/** @description The key lacks the `webhooks` scope, or the plan has no API. */
|
|
2221
|
+
403: {
|
|
2222
|
+
headers: {
|
|
2223
|
+
[name: string]: unknown;
|
|
2224
|
+
};
|
|
2225
|
+
content: {
|
|
2226
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2227
|
+
};
|
|
2228
|
+
};
|
|
2229
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2230
|
+
429: {
|
|
2231
|
+
headers: {
|
|
2232
|
+
/** @description Seconds to wait before trying again */
|
|
2233
|
+
"Retry-After"?: number;
|
|
2234
|
+
[name: string]: unknown;
|
|
2235
|
+
};
|
|
2236
|
+
content: {
|
|
2237
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2238
|
+
};
|
|
2239
|
+
};
|
|
2240
|
+
};
|
|
2241
|
+
};
|
|
2242
|
+
createWebhook: {
|
|
2243
|
+
parameters: {
|
|
2244
|
+
query?: never;
|
|
2245
|
+
header?: {
|
|
2246
|
+
/** @description Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (`Idempotent-Replayed: true`); the same key with a different request is a 409. */
|
|
2247
|
+
"idempotency-key"?: string;
|
|
2248
|
+
};
|
|
2249
|
+
path?: never;
|
|
2250
|
+
cookie?: never;
|
|
2251
|
+
};
|
|
2252
|
+
requestBody: {
|
|
2253
|
+
content: {
|
|
2254
|
+
"application/json": components["schemas"]["WebhookEndpointRequest"];
|
|
2255
|
+
};
|
|
2256
|
+
};
|
|
2257
|
+
responses: {
|
|
2258
|
+
/** @description The endpoint and its secret */
|
|
2259
|
+
201: {
|
|
2260
|
+
headers: {
|
|
2261
|
+
[name: string]: unknown;
|
|
2262
|
+
};
|
|
2263
|
+
content: {
|
|
2264
|
+
"application/json": components["schemas"]["WebhookEndpointWithSecret"];
|
|
2265
|
+
};
|
|
2266
|
+
};
|
|
2267
|
+
/** @description The body failed validation, or the URL is one we don’t send to. */
|
|
2268
|
+
400: {
|
|
2269
|
+
headers: {
|
|
2270
|
+
[name: string]: unknown;
|
|
2271
|
+
};
|
|
2272
|
+
content: {
|
|
2273
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2274
|
+
};
|
|
2275
|
+
};
|
|
2276
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2277
|
+
401: {
|
|
2278
|
+
headers: {
|
|
2279
|
+
[name: string]: unknown;
|
|
2280
|
+
};
|
|
2281
|
+
content: {
|
|
2282
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2283
|
+
};
|
|
2284
|
+
};
|
|
2285
|
+
/** @description The key lacks the `webhooks` scope, or the mode has 10 endpoints already. */
|
|
2286
|
+
403: {
|
|
2287
|
+
headers: {
|
|
2288
|
+
[name: string]: unknown;
|
|
2289
|
+
};
|
|
2290
|
+
content: {
|
|
2291
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2292
|
+
};
|
|
2293
|
+
};
|
|
2294
|
+
/** @description The `Idempotency-Key` was used for a different request in the last 24 hours, or its first request is still running. */
|
|
2295
|
+
409: {
|
|
2296
|
+
headers: {
|
|
2297
|
+
/** @description Seconds to wait before trying again */
|
|
2298
|
+
"Retry-After"?: number;
|
|
2299
|
+
[name: string]: unknown;
|
|
2300
|
+
};
|
|
2301
|
+
content: {
|
|
2302
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2303
|
+
};
|
|
2304
|
+
};
|
|
2305
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2306
|
+
429: {
|
|
2307
|
+
headers: {
|
|
2308
|
+
/** @description Seconds to wait before trying again */
|
|
2309
|
+
"Retry-After"?: number;
|
|
2310
|
+
[name: string]: unknown;
|
|
2311
|
+
};
|
|
2312
|
+
content: {
|
|
2313
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2314
|
+
};
|
|
2315
|
+
};
|
|
2316
|
+
};
|
|
2317
|
+
};
|
|
2318
|
+
getWebhook: {
|
|
2319
|
+
parameters: {
|
|
2320
|
+
query?: never;
|
|
2321
|
+
header?: never;
|
|
2322
|
+
path: {
|
|
2323
|
+
id: string;
|
|
2324
|
+
};
|
|
2325
|
+
cookie?: never;
|
|
2326
|
+
};
|
|
2327
|
+
requestBody?: never;
|
|
2328
|
+
responses: {
|
|
2329
|
+
/** @description The endpoint */
|
|
2330
|
+
200: {
|
|
2331
|
+
headers: {
|
|
2332
|
+
[name: string]: unknown;
|
|
2333
|
+
};
|
|
2334
|
+
content: {
|
|
2335
|
+
"application/json": components["schemas"]["WebhookEndpoint"];
|
|
2336
|
+
};
|
|
2337
|
+
};
|
|
2338
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2339
|
+
401: {
|
|
2340
|
+
headers: {
|
|
2341
|
+
[name: string]: unknown;
|
|
2342
|
+
};
|
|
2343
|
+
content: {
|
|
2344
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2345
|
+
};
|
|
2346
|
+
};
|
|
2347
|
+
/** @description The key lacks the `webhooks` scope, or the plan has no API. */
|
|
2348
|
+
403: {
|
|
2349
|
+
headers: {
|
|
2350
|
+
[name: string]: unknown;
|
|
2351
|
+
};
|
|
2352
|
+
content: {
|
|
2353
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2354
|
+
};
|
|
2355
|
+
};
|
|
2356
|
+
/** @description No webhook endpoint of this key’s mode has this ID. */
|
|
2357
|
+
404: {
|
|
2358
|
+
headers: {
|
|
2359
|
+
[name: string]: unknown;
|
|
2360
|
+
};
|
|
2361
|
+
content: {
|
|
2362
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2363
|
+
};
|
|
2364
|
+
};
|
|
2365
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2366
|
+
429: {
|
|
2367
|
+
headers: {
|
|
2368
|
+
/** @description Seconds to wait before trying again */
|
|
2369
|
+
"Retry-After"?: number;
|
|
2370
|
+
[name: string]: unknown;
|
|
2371
|
+
};
|
|
2372
|
+
content: {
|
|
2373
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2374
|
+
};
|
|
2375
|
+
};
|
|
2376
|
+
};
|
|
2377
|
+
};
|
|
2378
|
+
deleteWebhook: {
|
|
2379
|
+
parameters: {
|
|
2380
|
+
query?: never;
|
|
2381
|
+
header?: never;
|
|
2382
|
+
path: {
|
|
2383
|
+
id: string;
|
|
2384
|
+
};
|
|
2385
|
+
cookie?: never;
|
|
2386
|
+
};
|
|
2387
|
+
requestBody?: never;
|
|
2388
|
+
responses: {
|
|
2389
|
+
/** @description Deleted */
|
|
2390
|
+
204: {
|
|
2391
|
+
headers: {
|
|
2392
|
+
[name: string]: unknown;
|
|
2393
|
+
};
|
|
2394
|
+
content?: never;
|
|
2395
|
+
};
|
|
2396
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2397
|
+
401: {
|
|
2398
|
+
headers: {
|
|
2399
|
+
[name: string]: unknown;
|
|
2400
|
+
};
|
|
2401
|
+
content: {
|
|
2402
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2403
|
+
};
|
|
2404
|
+
};
|
|
2405
|
+
/** @description The key lacks the `webhooks` scope, or the plan has no API. */
|
|
2406
|
+
403: {
|
|
2407
|
+
headers: {
|
|
2408
|
+
[name: string]: unknown;
|
|
2409
|
+
};
|
|
2410
|
+
content: {
|
|
2411
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2412
|
+
};
|
|
2413
|
+
};
|
|
2414
|
+
/** @description No webhook endpoint of this key’s mode has this ID. */
|
|
2415
|
+
404: {
|
|
2416
|
+
headers: {
|
|
2417
|
+
[name: string]: unknown;
|
|
2418
|
+
};
|
|
2419
|
+
content: {
|
|
2420
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2421
|
+
};
|
|
2422
|
+
};
|
|
2423
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2424
|
+
429: {
|
|
2425
|
+
headers: {
|
|
2426
|
+
/** @description Seconds to wait before trying again */
|
|
2427
|
+
"Retry-After"?: number;
|
|
2428
|
+
[name: string]: unknown;
|
|
2429
|
+
};
|
|
2430
|
+
content: {
|
|
2431
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2432
|
+
};
|
|
2433
|
+
};
|
|
2434
|
+
};
|
|
2435
|
+
};
|
|
2436
|
+
updateWebhook: {
|
|
2437
|
+
parameters: {
|
|
2438
|
+
query?: never;
|
|
2439
|
+
header?: never;
|
|
2440
|
+
path: {
|
|
2441
|
+
id: string;
|
|
2442
|
+
};
|
|
2443
|
+
cookie?: never;
|
|
2444
|
+
};
|
|
2445
|
+
requestBody: {
|
|
2446
|
+
content: {
|
|
2447
|
+
"application/json": components["schemas"]["WebhookEndpointUpdate"];
|
|
2448
|
+
};
|
|
2449
|
+
};
|
|
2450
|
+
responses: {
|
|
2451
|
+
/** @description The endpoint */
|
|
2452
|
+
200: {
|
|
2453
|
+
headers: {
|
|
2454
|
+
[name: string]: unknown;
|
|
2455
|
+
};
|
|
2456
|
+
content: {
|
|
2457
|
+
"application/json": components["schemas"]["WebhookEndpoint"];
|
|
2458
|
+
};
|
|
2459
|
+
};
|
|
2460
|
+
/** @description The body failed validation, or the URL is one we don’t send to. */
|
|
2461
|
+
400: {
|
|
2462
|
+
headers: {
|
|
2463
|
+
[name: string]: unknown;
|
|
2464
|
+
};
|
|
2465
|
+
content: {
|
|
2466
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2467
|
+
};
|
|
2468
|
+
};
|
|
2469
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2470
|
+
401: {
|
|
2471
|
+
headers: {
|
|
2472
|
+
[name: string]: unknown;
|
|
2473
|
+
};
|
|
2474
|
+
content: {
|
|
2475
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2476
|
+
};
|
|
2477
|
+
};
|
|
2478
|
+
/** @description The key lacks the `webhooks` scope, or the plan has no API. */
|
|
2479
|
+
403: {
|
|
2480
|
+
headers: {
|
|
2481
|
+
[name: string]: unknown;
|
|
2482
|
+
};
|
|
2483
|
+
content: {
|
|
2484
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2485
|
+
};
|
|
2486
|
+
};
|
|
2487
|
+
/** @description No webhook endpoint of this key’s mode has this ID. */
|
|
2488
|
+
404: {
|
|
2489
|
+
headers: {
|
|
2490
|
+
[name: string]: unknown;
|
|
2491
|
+
};
|
|
2492
|
+
content: {
|
|
2493
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2494
|
+
};
|
|
2495
|
+
};
|
|
2496
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2497
|
+
429: {
|
|
2498
|
+
headers: {
|
|
2499
|
+
/** @description Seconds to wait before trying again */
|
|
2500
|
+
"Retry-After"?: number;
|
|
2501
|
+
[name: string]: unknown;
|
|
2502
|
+
};
|
|
2503
|
+
content: {
|
|
2504
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2505
|
+
};
|
|
2506
|
+
};
|
|
2507
|
+
};
|
|
2508
|
+
};
|
|
2509
|
+
rotateWebhookSecret: {
|
|
2510
|
+
parameters: {
|
|
2511
|
+
query?: never;
|
|
2512
|
+
header?: {
|
|
2513
|
+
/** @description Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (`Idempotent-Replayed: true`); the same key with a different request is a 409. */
|
|
2514
|
+
"idempotency-key"?: string;
|
|
2515
|
+
};
|
|
2516
|
+
path: {
|
|
2517
|
+
id: string;
|
|
2518
|
+
};
|
|
2519
|
+
cookie?: never;
|
|
2520
|
+
};
|
|
2521
|
+
requestBody?: never;
|
|
2522
|
+
responses: {
|
|
2523
|
+
/** @description The endpoint and its new secret */
|
|
2524
|
+
200: {
|
|
2525
|
+
headers: {
|
|
2526
|
+
[name: string]: unknown;
|
|
2527
|
+
};
|
|
2528
|
+
content: {
|
|
2529
|
+
"application/json": components["schemas"]["WebhookEndpointWithSecret"];
|
|
2530
|
+
};
|
|
2531
|
+
};
|
|
2532
|
+
/** @description An `Idempotency-Key` that isn’t 1 to 255 printable characters. */
|
|
2533
|
+
400: {
|
|
2534
|
+
headers: {
|
|
2535
|
+
[name: string]: unknown;
|
|
2536
|
+
};
|
|
2537
|
+
content: {
|
|
2538
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2539
|
+
};
|
|
2540
|
+
};
|
|
2541
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2542
|
+
401: {
|
|
2543
|
+
headers: {
|
|
2544
|
+
[name: string]: unknown;
|
|
2545
|
+
};
|
|
2546
|
+
content: {
|
|
2547
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2548
|
+
};
|
|
2549
|
+
};
|
|
2550
|
+
/** @description The key lacks the `webhooks` scope, or the plan has no API. */
|
|
2551
|
+
403: {
|
|
2552
|
+
headers: {
|
|
2553
|
+
[name: string]: unknown;
|
|
2554
|
+
};
|
|
2555
|
+
content: {
|
|
2556
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2557
|
+
};
|
|
2558
|
+
};
|
|
2559
|
+
/** @description No webhook endpoint of this key’s mode has this ID. */
|
|
2560
|
+
404: {
|
|
2561
|
+
headers: {
|
|
2562
|
+
[name: string]: unknown;
|
|
2563
|
+
};
|
|
2564
|
+
content: {
|
|
2565
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2566
|
+
};
|
|
2567
|
+
};
|
|
2568
|
+
/** @description The `Idempotency-Key` was used for a different request in the last 24 hours, or its first request is still running. */
|
|
2569
|
+
409: {
|
|
2570
|
+
headers: {
|
|
2571
|
+
/** @description Seconds to wait before trying again */
|
|
2572
|
+
"Retry-After"?: number;
|
|
2573
|
+
[name: string]: unknown;
|
|
2574
|
+
};
|
|
2575
|
+
content: {
|
|
2576
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2577
|
+
};
|
|
2578
|
+
};
|
|
2579
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2580
|
+
429: {
|
|
2581
|
+
headers: {
|
|
2582
|
+
/** @description Seconds to wait before trying again */
|
|
2583
|
+
"Retry-After"?: number;
|
|
2584
|
+
[name: string]: unknown;
|
|
2585
|
+
};
|
|
2586
|
+
content: {
|
|
2587
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2588
|
+
};
|
|
2589
|
+
};
|
|
2590
|
+
};
|
|
2591
|
+
};
|
|
2592
|
+
listWebhookDeliveries: {
|
|
2593
|
+
parameters: {
|
|
2594
|
+
query?: {
|
|
2595
|
+
limit?: number;
|
|
2596
|
+
cursor?: string;
|
|
2597
|
+
event_id?: string;
|
|
2598
|
+
};
|
|
2599
|
+
header?: never;
|
|
2600
|
+
path: {
|
|
2601
|
+
id: string;
|
|
2602
|
+
};
|
|
2603
|
+
cookie?: never;
|
|
2604
|
+
};
|
|
2605
|
+
requestBody?: never;
|
|
2606
|
+
responses: {
|
|
2607
|
+
/** @description Attempts, newest first */
|
|
2608
|
+
200: {
|
|
2609
|
+
headers: {
|
|
2610
|
+
[name: string]: unknown;
|
|
2611
|
+
};
|
|
2612
|
+
content: {
|
|
2613
|
+
"application/json": {
|
|
2614
|
+
data: components["schemas"]["WebhookDelivery"][];
|
|
2615
|
+
next_cursor: string | null;
|
|
2616
|
+
};
|
|
2617
|
+
};
|
|
2618
|
+
};
|
|
2619
|
+
/** @description A `cursor` that isn’t one we gave, or `limit` outside 1 to 100. */
|
|
2620
|
+
400: {
|
|
2621
|
+
headers: {
|
|
2622
|
+
[name: string]: unknown;
|
|
2623
|
+
};
|
|
2624
|
+
content: {
|
|
2625
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2626
|
+
};
|
|
2627
|
+
};
|
|
2628
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2629
|
+
401: {
|
|
2630
|
+
headers: {
|
|
2631
|
+
[name: string]: unknown;
|
|
2632
|
+
};
|
|
2633
|
+
content: {
|
|
2634
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2635
|
+
};
|
|
2636
|
+
};
|
|
2637
|
+
/** @description The key lacks the `webhooks` scope, or the plan has no API. */
|
|
2638
|
+
403: {
|
|
2639
|
+
headers: {
|
|
2640
|
+
[name: string]: unknown;
|
|
2641
|
+
};
|
|
2642
|
+
content: {
|
|
2643
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2644
|
+
};
|
|
2645
|
+
};
|
|
2646
|
+
/** @description No webhook endpoint of this key’s mode has this ID. */
|
|
2647
|
+
404: {
|
|
2648
|
+
headers: {
|
|
2649
|
+
[name: string]: unknown;
|
|
2650
|
+
};
|
|
2651
|
+
content: {
|
|
2652
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2653
|
+
};
|
|
2654
|
+
};
|
|
2655
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2656
|
+
429: {
|
|
2657
|
+
headers: {
|
|
2658
|
+
/** @description Seconds to wait before trying again */
|
|
2659
|
+
"Retry-After"?: number;
|
|
2660
|
+
[name: string]: unknown;
|
|
2661
|
+
};
|
|
2662
|
+
content: {
|
|
2663
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2664
|
+
};
|
|
2665
|
+
};
|
|
2666
|
+
};
|
|
2667
|
+
};
|
|
2668
|
+
replayWebhookEvent: {
|
|
2669
|
+
parameters: {
|
|
2670
|
+
query?: never;
|
|
2671
|
+
header?: {
|
|
2672
|
+
/** @description Up to 255 printable ASCII characters, such as a UUID. A repeat of the same request within 24 hours gets the first one’s successful answer again (`Idempotent-Replayed: true`); the same key with a different request is a 409. */
|
|
2673
|
+
"idempotency-key"?: string;
|
|
2674
|
+
};
|
|
2675
|
+
path: {
|
|
2676
|
+
id: string;
|
|
2677
|
+
};
|
|
2678
|
+
cookie?: never;
|
|
2679
|
+
};
|
|
2680
|
+
requestBody: {
|
|
2681
|
+
content: {
|
|
2682
|
+
"application/json": {
|
|
2683
|
+
event_id: string;
|
|
2684
|
+
};
|
|
2685
|
+
};
|
|
2686
|
+
};
|
|
2687
|
+
responses: {
|
|
2688
|
+
/** @description The attempt */
|
|
2689
|
+
200: {
|
|
2690
|
+
headers: {
|
|
2691
|
+
[name: string]: unknown;
|
|
2692
|
+
};
|
|
2693
|
+
content: {
|
|
2694
|
+
"application/json": components["schemas"]["WebhookDelivery"];
|
|
2695
|
+
};
|
|
2696
|
+
};
|
|
2697
|
+
/** @description An `Idempotency-Key` that isn’t 1 to 255 printable characters. */
|
|
2698
|
+
400: {
|
|
2699
|
+
headers: {
|
|
2700
|
+
[name: string]: unknown;
|
|
2701
|
+
};
|
|
2702
|
+
content: {
|
|
2703
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2704
|
+
};
|
|
2705
|
+
};
|
|
2706
|
+
/** @description No API key, or one that’s unknown or revoked. */
|
|
2707
|
+
401: {
|
|
2708
|
+
headers: {
|
|
2709
|
+
[name: string]: unknown;
|
|
2710
|
+
};
|
|
2711
|
+
content: {
|
|
2712
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2713
|
+
};
|
|
2714
|
+
};
|
|
2715
|
+
/** @description The key lacks the `webhooks` scope, or the plan has no API. */
|
|
2716
|
+
403: {
|
|
2717
|
+
headers: {
|
|
2718
|
+
[name: string]: unknown;
|
|
2719
|
+
};
|
|
2720
|
+
content: {
|
|
2721
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2722
|
+
};
|
|
2723
|
+
};
|
|
2724
|
+
/** @description No such endpoint, or it wasn’t sent that event in the last 7 days. */
|
|
2725
|
+
404: {
|
|
2726
|
+
headers: {
|
|
2727
|
+
[name: string]: unknown;
|
|
2728
|
+
};
|
|
2729
|
+
content: {
|
|
2730
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2731
|
+
};
|
|
2732
|
+
};
|
|
2733
|
+
/** @description The `Idempotency-Key` was used for a different request in the last 24 hours, or its first request is still running. */
|
|
2734
|
+
409: {
|
|
2735
|
+
headers: {
|
|
2736
|
+
/** @description Seconds to wait before trying again */
|
|
2737
|
+
"Retry-After"?: number;
|
|
2738
|
+
[name: string]: unknown;
|
|
2739
|
+
};
|
|
2740
|
+
content: {
|
|
2741
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2742
|
+
};
|
|
2743
|
+
};
|
|
2744
|
+
/** @description More requests than the plan allows in 10 seconds: wait `Retry-After` seconds. */
|
|
2745
|
+
429: {
|
|
2746
|
+
headers: {
|
|
2747
|
+
/** @description Seconds to wait before trying again */
|
|
2748
|
+
"Retry-After"?: number;
|
|
2749
|
+
[name: string]: unknown;
|
|
2750
|
+
};
|
|
2751
|
+
content: {
|
|
2752
|
+
"application/problem+json": components["schemas"]["Problem"];
|
|
2753
|
+
};
|
|
2754
|
+
};
|
|
2755
|
+
};
|
|
2756
|
+
};
|
|
2757
|
+
}
|