@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,444 @@
1
+ {
2
+ "openapi": "3.1.1",
3
+ "info": {
4
+ "title": "PDF Generator API - Create PDFs from Templates",
5
+ "version": "1.0.0",
6
+ "description": "Generate PDFs from templates you design once in the APIFreaks PDF Template Builder. Send JSON in the request body or provide a data_url, and the API renders your template into a hosted PDF document. 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": {
21
+ "post": {
22
+ "tags": ["PDF Template APIs"],
23
+ "summary": "Generate a PDF from a template",
24
+ "description": "Renders the template identified by template_id with the JSON data supplied in the request body (or fetched from data_url). Returns a hosted URL for the generated PDF. Provide either a request body or a data_url; one of the two is required. The keys of the data object are the fields you bound when you designed the template in the APIFreaks PDF Template Builder, so the exact shape is up to you. Pin the version parameter to a specific template version (e.g. version=v2) so later design changes never touch what is already live; omit it to use the latest version.",
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
+ "name": "data_url",
47
+ "in": "query",
48
+ "required": false,
49
+ "schema": {
50
+ "type": "string",
51
+ "format": "uri"
52
+ },
53
+ "description": "A URL the API fetches your JSON data from, instead of the request body. Provide this when you are not sending a request body."
54
+ }
55
+ ],
56
+ "requestBody": {
57
+ "description": "The template's data as a JSON object. The keys are the fields you bound when you designed the template, so the exact shape is up to you. Provide the body when you are not passing a data_url; one of the two is required.",
58
+ "required": false,
59
+ "content": {
60
+ "application/json": {
61
+ "schema": {
62
+ "type": "object",
63
+ "additionalProperties": true,
64
+ "description": "Free-form JSON object whose keys map to the fields bound in the template."
65
+ },
66
+ "examples": {
67
+ "resumeTemplate": {
68
+ "summary": "Resume template data",
69
+ "value": {
70
+ "candidate_name": "Ava Thompson",
71
+ "candidate_title": "Senior Operations Analyst",
72
+ "email": "ava.thompson@example.com",
73
+ "phone": "+1 (555) 381-2048",
74
+ "city": "Austin, TX",
75
+ "portfolio_url": "portfolio.example.com",
76
+ "profile_summary": "Analytical operations professional with 8+ years of experience improving reporting pipelines, streamlining process documentation, and coordinating cross-functional delivery for distributed teams across multiple time zones.",
77
+ "company_name": "Northwind Logistics",
78
+ "job_title": "Operations Analyst",
79
+ "employment_period": "2021 - Present",
80
+ "job_achievement_1": "Led weekly KPI reporting for finance, fulfillment, and customer success stakeholders across three business units.",
81
+ "job_achievement_2": "Reduced manual reconciliation work by 35% through workflow redesign and documentation automation.",
82
+ "job_achievement_3": "Spearheaded a cross-team initiative that improved on-time delivery metrics by 18% within six months.",
83
+ "skills": [
84
+ {
85
+ "skill": "Process Improvement",
86
+ "level": "Advanced",
87
+ "years": "7"
88
+ },
89
+ {
90
+ "skill": "Stakeholder Reporting",
91
+ "level": "Expert",
92
+ "years": "8"
93
+ },
94
+ {
95
+ "skill": "Cross-functional Coordination",
96
+ "level": "Advanced",
97
+ "years": "5"
98
+ },
99
+ {
100
+ "skill": "Workflow Documentation",
101
+ "level": "Advanced",
102
+ "years": "6"
103
+ }
104
+ ],
105
+ "degree": "B.S. in Information Systems",
106
+ "institution": "University of Texas",
107
+ "graduation_year": "2018",
108
+ "certification_1": "Certified Business Analysis Professional (CBAP)",
109
+ "certification_2": "Six Sigma Green Belt",
110
+ "languages": "English (Native), Spanish (Professional)"
111
+ }
112
+ },
113
+ "businessReport": {
114
+ "summary": "Business report template data",
115
+ "value": {
116
+ "report_title": "Quarterly Business Report",
117
+ "report_period": "Q4 2024",
118
+ "prepared_by": "Marketing Team",
119
+ "revenue": 125000,
120
+ "growth_rate": 15,
121
+ "customer_count": 520,
122
+ "monthly_comparison": [
123
+ {
124
+ "metric": "Revenue",
125
+ "previous": "$108,000",
126
+ "current": "$125,000",
127
+ "change": "+15.7%"
128
+ },
129
+ {
130
+ "metric": "Active Customers",
131
+ "previous": "480",
132
+ "current": "520",
133
+ "change": "+8.3%"
134
+ }
135
+ ]
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ },
142
+ "responses": {
143
+ "200": {
144
+ "description": "PDF generated successfully. The response contains the hosted URL of the rendered PDF along with its creation and expiration times.",
145
+ "content": {
146
+ "application/json": {
147
+ "schema": {
148
+ "$ref": "#/components/schemas/TemplateGenerationResponse"
149
+ },
150
+ "examples": {
151
+ "success": {
152
+ "summary": "Generated PDF",
153
+ "value": {
154
+ "template_id": "73691bce-1c58-4370-acc6-64b2dd14f81c",
155
+ "pdf_url": "https://s3.eu-central-2.wasabisys.com/w.storage.apifreaks.com/pdf_templates/73691bce-1c58-4370-acc6-64b2dd14f81c/Candidate%20Resume_20260810141214723405.pdf",
156
+ "created_at": "2026-08-10T14:12:17.673Z",
157
+ "expiration_time": "2026-11-10T14:12:17.673Z"
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "400": {
165
+ "description": "Bad Request \u2014 Missing or malformed parameters, missing data, or an unreachable data_url.",
166
+ "content": {
167
+ "application/json": {
168
+ "schema": {
169
+ "$ref": "#/components/schemas/ErrorResponse"
170
+ },
171
+ "examples": {
172
+ "MissingTemplateId": {
173
+ "summary": "template_id is missing",
174
+ "value": {
175
+ "error": "Invalid Param Exception",
176
+ "message": "please pass correct parameters",
177
+ "path": "/v1.0/pdf/template/generate",
178
+ "status": 400,
179
+ "timestamp": "2026-08-10T14:13:13.195Z"
180
+ }
181
+ },
182
+ "InvalidVersion": {
183
+ "summary": "version does not start with v",
184
+ "value": {
185
+ "timestamp": "2026-08-10T14:13:13.689Z",
186
+ "path": "/v1.0/generate-pdf",
187
+ "status": 400,
188
+ "error": "Invalid Template Version",
189
+ "message": "Please provide a valid template version starting with 'v'."
190
+ }
191
+ },
192
+ "NoData": {
193
+ "summary": "No data supplied to fill the template",
194
+ "value": {
195
+ "timestamp": "2026-08-10T14:13:14.172Z",
196
+ "path": "/v1.0/generate-pdf",
197
+ "status": 400,
198
+ "error": "Template Data Not Provided",
199
+ "message": "No data provided for the template. Please provide valid data to generate pdf."
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "401": {
207
+ "description": "Unauthorized \u2014 The API key is missing or invalid.",
208
+ "content": {
209
+ "application/json": {
210
+ "schema": {
211
+ "$ref": "#/components/schemas/ErrorResponse"
212
+ },
213
+ "examples": {
214
+ "InvalidApiKey": {
215
+ "summary": "Provided API key is invalid",
216
+ "value": {
217
+ "error": "API Access Exception",
218
+ "message": "Provided API key is invalid. [For Technical Support: support@apifreaks.com]",
219
+ "path": "/v1.0/pdf/template/generate",
220
+ "status": 401,
221
+ "timestamp": "2026-08-10T14:13:14.996Z"
222
+ }
223
+ }
224
+ }
225
+ }
226
+ }
227
+ },
228
+ "403": {
229
+ "description": "Forbidden \u2014 The account does not have access to this template.",
230
+ "content": {
231
+ "application/json": {
232
+ "schema": {
233
+ "$ref": "#/components/schemas/ErrorResponse"
234
+ },
235
+ "examples": {
236
+ "AccessDenied": {
237
+ "summary": "No access to the template",
238
+ "value": {
239
+ "timestamp": "2026-08-10T14:13:15.000Z",
240
+ "path": "/v1.0/generate-pdf",
241
+ "status": 403,
242
+ "error": "Template Access Denied",
243
+ "message": "Your account does not have access to this template."
244
+ }
245
+ }
246
+ }
247
+ }
248
+ }
249
+ },
250
+ "404": {
251
+ "description": "Not Found \u2014 No template matches the template_id, or the requested version does not exist.",
252
+ "content": {
253
+ "application/json": {
254
+ "schema": {
255
+ "$ref": "#/components/schemas/ErrorResponse"
256
+ },
257
+ "examples": {
258
+ "TemplateNotFound": {
259
+ "summary": "No template matches the template_id",
260
+ "value": {
261
+ "timestamp": "2026-08-10T14:13:14.677Z",
262
+ "path": "/v1.0/generate-pdf",
263
+ "status": 404,
264
+ "error": "Template Not Found",
265
+ "message": "Please provide a valid template ID."
266
+ }
267
+ }
268
+ }
269
+ }
270
+ }
271
+ },
272
+ "415": {
273
+ "description": "Unsupported Media Type \u2014 The request Content-Type is not supported for this endpoint.",
274
+ "content": {
275
+ "application/json": {
276
+ "schema": {
277
+ "$ref": "#/components/schemas/ErrorResponse"
278
+ },
279
+ "examples": {
280
+ "UnsupportedMediaType": {
281
+ "summary": "Content-Type is not supported",
282
+ "value": {
283
+ "timestamp": "2026-08-10T14:13:15.500Z",
284
+ "path": "/v1.0/generate-pdf",
285
+ "status": 415,
286
+ "error": "Unsupported Media Type",
287
+ "message": "The request Content-Type is not supported for this endpoint."
288
+ }
289
+ }
290
+ }
291
+ }
292
+ }
293
+ },
294
+ "422": {
295
+ "description": "Unprocessable Entity \u2014 The request contains invalid or missing data.",
296
+ "content": {
297
+ "application/json": {
298
+ "schema": {
299
+ "$ref": "#/components/schemas/ErrorResponse"
300
+ },
301
+ "examples": {
302
+ "InvalidData": {
303
+ "summary": "Invalid or missing data",
304
+ "value": {
305
+ "timestamp": "2026-08-10T14:13:16.100Z",
306
+ "path": "/v1.0/generate-pdf",
307
+ "status": 422,
308
+ "error": "Invalid Template Data",
309
+ "message": "The request contains invalid or missing data."
310
+ }
311
+ }
312
+ }
313
+ }
314
+ }
315
+ },
316
+ "500": {
317
+ "description": "Internal Server Error \u2014 An unexpected error occurred, or the PDF could not be generated.",
318
+ "content": {
319
+ "application/json": {
320
+ "schema": {
321
+ "$ref": "#/components/schemas/ErrorResponse"
322
+ },
323
+ "examples": {
324
+ "GenerationFailed": {
325
+ "summary": "PDF could not be generated",
326
+ "value": {
327
+ "timestamp": "2026-08-10T14:13:16.700Z",
328
+ "path": "/v1.0/generate-pdf",
329
+ "status": 500,
330
+ "error": "PDF Generation Failed",
331
+ "message": "The PDF could not be generated. Try the request again."
332
+ }
333
+ }
334
+ }
335
+ }
336
+ }
337
+ },
338
+ "504": {
339
+ "description": "Gateway Timeout \u2014 The request went past the 100 second processing limit.",
340
+ "content": {
341
+ "application/json": {
342
+ "schema": {
343
+ "$ref": "#/components/schemas/ErrorResponse"
344
+ },
345
+ "examples": {
346
+ "ProcessingLimit": {
347
+ "summary": "Request exceeded the 100 second processing limit",
348
+ "value": {
349
+ "timestamp": "2026-08-10T14:13:17.300Z",
350
+ "path": "/v1.0/generate-pdf",
351
+ "status": 504,
352
+ "error": "Processing Timeout",
353
+ "message": "The request went past the 100 second processing limit. Reduce the input size or retry."
354
+ }
355
+ }
356
+ }
357
+ }
358
+ }
359
+ }
360
+ },
361
+ "operationId": "generatePdfFromTemplate"
362
+ }
363
+ }
364
+ },
365
+ "components": {
366
+ "securitySchemes": {
367
+ "ApiKeyAuthHeader": {
368
+ "type": "apiKey",
369
+ "in": "header",
370
+ "name": "X-apikey",
371
+ "description": "Pass your API key via the X-apikey request header."
372
+ },
373
+ "ApiKeyAuthQuery": {
374
+ "type": "apiKey",
375
+ "in": "query",
376
+ "name": "apiKey",
377
+ "description": "Pass your API key via the apiKey query parameter."
378
+ }
379
+ },
380
+ "schemas": {
381
+ "TemplateGenerationResponse": {
382
+ "type": "object",
383
+ "description": "Result of a PDF generation request, containing the hosted URL of the generated PDF.",
384
+ "required": ["template_id", "pdf_url", "created_at", "expiration_time"],
385
+ "properties": {
386
+ "template_id": {
387
+ "type": "string",
388
+ "description": "The template that was rendered."
389
+ },
390
+ "pdf_url": {
391
+ "type": "string",
392
+ "description": "Hosted URL of the generated PDF."
393
+ },
394
+ "created_at": {
395
+ "type": "string",
396
+ "format": "date-time",
397
+ "description": "When the PDF was generated (ISO 8601)."
398
+ },
399
+ "expiration_time": {
400
+ "type": "string",
401
+ "format": "date-time",
402
+ "description": "When the hosted PDF expires (ISO 8601)."
403
+ }
404
+ }
405
+ },
406
+ "ErrorResponse": {
407
+ "type": "object",
408
+ "description": "Standard error envelope returned by the API on failed requests.",
409
+ "required": ["message"],
410
+ "properties": {
411
+ "error": {
412
+ "type": "string",
413
+ "description": "Short error category or exception type."
414
+ },
415
+ "message": {
416
+ "type": "string",
417
+ "description": "Human-readable error message describing the failure."
418
+ },
419
+ "path": {
420
+ "type": "string",
421
+ "description": "API endpoint path that produced the error."
422
+ },
423
+ "status": {
424
+ "type": "integer",
425
+ "description": "HTTP status code returned with the error."
426
+ },
427
+ "timestamp": {
428
+ "type": "string",
429
+ "format": "date-time",
430
+ "description": "Timestamp when the error occurred (ISO 8601)."
431
+ }
432
+ }
433
+ }
434
+ }
435
+ },
436
+ "security": [
437
+ {
438
+ "ApiKeyAuthHeader": []
439
+ },
440
+ {
441
+ "ApiKeyAuthQuery": []
442
+ }
443
+ ]
444
+ }