@apifreaks/openapi-specs 0.1.2 → 0.2.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.
@@ -0,0 +1,290 @@
1
+ {
2
+ "openapi": "3.1.1",
3
+ "info": {
4
+ "title": "PDF Generator API - Bulk PDF Generation from CSV",
5
+ "version": "1.0.0",
6
+ "description": "Generate one PDF per row from an uploaded CSV file against a template you designed in the APIFreaks PDF Template Builder. Each row is processed independently, and the response returns an array of results, each with its own pdf_url. Authentication is done with your APIFreaks API key passed in the X-apikey header.",
7
+ "contact": {
8
+ "name": "APIFreaks Support",
9
+ "url": "https://apifreaks.com/contact",
10
+ "email": "support@apifreaks.com"
11
+ }
12
+ },
13
+ "servers": [
14
+ {
15
+ "url": "https://api.apifreaks.com/v1.0",
16
+ "description": "PDF Generator API Server"
17
+ }
18
+ ],
19
+ "paths": {
20
+ "/pdf/template/generate/bulk": {
21
+ "post": {
22
+ "tags": ["PDF Template APIs"],
23
+ "summary": "Generate PDFs in bulk from a CSV",
24
+ "description": "Upload a CSV file where each row is one record. The API generates one PDF per row and returns an array of results, each with its own pdf_url. Rows are processed independently, so a failure in one row does not block the rest of the batch. The response gives a row-by-row breakdown of which PDFs succeeded and which failed.",
25
+ "parameters": [
26
+ {
27
+ "name": "template_id",
28
+ "in": "query",
29
+ "required": true,
30
+ "schema": {
31
+ "type": "string"
32
+ },
33
+ "description": "The template to render, from the APIFreaks PDF Template Builder. Copy it from your dashboard when you save the template."
34
+ },
35
+ {
36
+ "name": "version",
37
+ "in": "query",
38
+ "required": false,
39
+ "schema": {
40
+ "type": "string",
41
+ "pattern": "^v"
42
+ },
43
+ "description": "Template version to render, e.g. v2. Must start with v. Omit this parameter entirely to use the latest version; the literal value 'latest' is not accepted by the API."
44
+ }
45
+ ],
46
+ "requestBody": {
47
+ "description": "Multipart form-data body carrying the CSV file to render. Each row in the CSV is one record and produces one PDF.",
48
+ "required": true,
49
+ "content": {
50
+ "multipart/form-data": {
51
+ "schema": {
52
+ "$ref": "#/components/schemas/CsvUploadRequest"
53
+ }
54
+ }
55
+ }
56
+ },
57
+ "responses": {
58
+ "200": {
59
+ "description": "PDFs generated successfully. The response is an array of results, one entry per CSV row, each with its own pdf_url.",
60
+ "content": {
61
+ "application/json": {
62
+ "schema": {
63
+ "type": "array",
64
+ "items": {
65
+ "$ref": "#/components/schemas/TemplateGenerationResponse"
66
+ }
67
+ },
68
+ "examples": {
69
+ "success": {
70
+ "summary": "Generated PDFs for two rows",
71
+ "value": [
72
+ {
73
+ "template_id": "73691bce-1c58-4370-acc6-64b2dd14f81c",
74
+ "pdf_url": "https://s3.eu-central-2.wasabisys.com/w.storage.apifreaks.com/pdf_templates/73691bce-1c58-4370-acc6-64b2dd14f81c/Candidate%20Resume_20260810141245054106_1.pdf",
75
+ "created_at": "2026-08-10T14:12:47.887Z",
76
+ "expiration_time": "2026-11-10T14:12:47.887Z"
77
+ },
78
+ {
79
+ "template_id": "73691bce-1c58-4370-acc6-64b2dd14f81c",
80
+ "pdf_url": "https://s3.eu-central-2.wasabisys.com/w.storage.apifreaks.com/pdf_templates/73691bce-1c58-4370-acc6-64b2dd14f81c/Candidate%20Resume_20260810141245054154_2.pdf",
81
+ "created_at": "2026-08-10T14:12:47.940Z",
82
+ "expiration_time": "2026-11-10T14:12:47.940Z"
83
+ }
84
+ ]
85
+ }
86
+ }
87
+ }
88
+ }
89
+ },
90
+ "400": {
91
+ "description": "Bad Request \u2014 Missing parameters, a file that is not a CSV, or data larger than 10 MB.",
92
+ "content": {
93
+ "application/json": {
94
+ "schema": {
95
+ "$ref": "#/components/schemas/ErrorResponse"
96
+ },
97
+ "examples": {
98
+ "CsvFileRequired": {
99
+ "summary": "Uploaded file is not a CSV",
100
+ "value": {
101
+ "timestamp": "2026-08-10T14:13:14.497Z",
102
+ "path": "/v1.0/generate-pdf/bulk",
103
+ "status": 400,
104
+ "error": "CSV File Required",
105
+ "message": "Only CSV files are supported. Please upload a valid CSV file."
106
+ }
107
+ }
108
+ }
109
+ }
110
+ }
111
+ },
112
+ "401": {
113
+ "description": "Unauthorized \u2014 The API key is missing or invalid.",
114
+ "content": {
115
+ "application/json": {
116
+ "schema": {
117
+ "$ref": "#/components/schemas/ErrorResponse"
118
+ },
119
+ "examples": {
120
+ "InvalidApiKey": {
121
+ "summary": "Provided API key is invalid",
122
+ "value": {
123
+ "error": "API Access Exception",
124
+ "message": "Provided API key is invalid. [For Technical Support: support@apifreaks.com]",
125
+ "path": "/v1.0/pdf/template/generate/bulk",
126
+ "status": 401,
127
+ "timestamp": "2026-08-10T14:13:14.996Z"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ },
134
+ "403": {
135
+ "description": "Forbidden \u2014 The account does not have access to this template.",
136
+ "content": {
137
+ "application/json": {
138
+ "schema": {
139
+ "$ref": "#/components/schemas/ErrorResponse"
140
+ }
141
+ }
142
+ }
143
+ },
144
+ "404": {
145
+ "description": "Not Found \u2014 No template matches the template_id, or the requested version does not exist.",
146
+ "content": {
147
+ "application/json": {
148
+ "schema": {
149
+ "$ref": "#/components/schemas/ErrorResponse"
150
+ }
151
+ }
152
+ }
153
+ },
154
+ "415": {
155
+ "description": "Unsupported Media Type \u2014 The request Content-Type is not supported for this endpoint.",
156
+ "content": {
157
+ "application/json": {
158
+ "schema": {
159
+ "$ref": "#/components/schemas/ErrorResponse"
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "422": {
165
+ "description": "Unprocessable Entity \u2014 The request contains invalid or missing data.",
166
+ "content": {
167
+ "application/json": {
168
+ "schema": {
169
+ "$ref": "#/components/schemas/ErrorResponse"
170
+ }
171
+ }
172
+ }
173
+ },
174
+ "500": {
175
+ "description": "Internal Server Error \u2014 An unexpected error occurred, or the PDF could not be generated.",
176
+ "content": {
177
+ "application/json": {
178
+ "schema": {
179
+ "$ref": "#/components/schemas/ErrorResponse"
180
+ }
181
+ }
182
+ }
183
+ },
184
+ "504": {
185
+ "description": "Gateway Timeout \u2014 The request went past the 100 second processing limit.",
186
+ "content": {
187
+ "application/json": {
188
+ "schema": {
189
+ "$ref": "#/components/schemas/ErrorResponse"
190
+ }
191
+ }
192
+ }
193
+ }
194
+ },
195
+ "operationId": "generatePdfsFromCsv"
196
+ }
197
+ }
198
+ },
199
+ "components": {
200
+ "securitySchemes": {
201
+ "ApiKeyAuthHeader": {
202
+ "type": "apiKey",
203
+ "in": "header",
204
+ "name": "X-apikey",
205
+ "description": "Pass your API key via the X-apikey request header."
206
+ },
207
+ "ApiKeyAuthQuery": {
208
+ "type": "apiKey",
209
+ "in": "query",
210
+ "name": "apiKey",
211
+ "description": "Pass your API key via the apiKey query parameter."
212
+ }
213
+ },
214
+ "schemas": {
215
+ "TemplateGenerationResponse": {
216
+ "type": "object",
217
+ "description": "Result of a PDF generation request, containing the hosted URL of the generated PDF.",
218
+ "required": ["template_id", "pdf_url", "created_at", "expiration_time"],
219
+ "properties": {
220
+ "template_id": {
221
+ "type": "string",
222
+ "description": "The template that was rendered."
223
+ },
224
+ "pdf_url": {
225
+ "type": "string",
226
+ "description": "Hosted URL of the generated PDF."
227
+ },
228
+ "created_at": {
229
+ "type": "string",
230
+ "format": "date-time",
231
+ "description": "When the PDF was generated (ISO 8601)."
232
+ },
233
+ "expiration_time": {
234
+ "type": "string",
235
+ "format": "date-time",
236
+ "description": "When the hosted PDF expires (ISO 8601)."
237
+ }
238
+ }
239
+ },
240
+ "CsvUploadRequest": {
241
+ "type": "object",
242
+ "description": "Multipart form-data request body containing the CSV file to render in bulk.",
243
+ "required": ["file"],
244
+ "properties": {
245
+ "file": {
246
+ "type": "string",
247
+ "format": "binary",
248
+ "description": "A CSV file uploaded as form-data where each row is one record. One PDF is generated per row."
249
+ }
250
+ }
251
+ },
252
+ "ErrorResponse": {
253
+ "type": "object",
254
+ "description": "Standard error envelope returned by the API on failed requests.",
255
+ "required": ["message"],
256
+ "properties": {
257
+ "error": {
258
+ "type": "string",
259
+ "description": "Short error category or exception type."
260
+ },
261
+ "message": {
262
+ "type": "string",
263
+ "description": "Human-readable error message describing the failure."
264
+ },
265
+ "path": {
266
+ "type": "string",
267
+ "description": "API endpoint path that produced the error."
268
+ },
269
+ "status": {
270
+ "type": "integer",
271
+ "description": "HTTP status code returned with the error."
272
+ },
273
+ "timestamp": {
274
+ "type": "string",
275
+ "format": "date-time",
276
+ "description": "Timestamp when the error occurred (ISO 8601)."
277
+ }
278
+ }
279
+ }
280
+ }
281
+ },
282
+ "security": [
283
+ {
284
+ "ApiKeyAuthHeader": []
285
+ },
286
+ {
287
+ "ApiKeyAuthQuery": []
288
+ }
289
+ ]
290
+ }