@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,199 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: PDF Generator API - Bulk PDF Generation from CSV
4
+ version: 1.0.0
5
+ 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.
6
+ contact:
7
+ name: APIFreaks Support
8
+ url: https://apifreaks.com/contact
9
+ email: support@apifreaks.com
10
+ servers:
11
+ - url: https://api.apifreaks.com/v1.0
12
+ description: PDF Generator API Server
13
+ paths:
14
+ /pdf/template/generate/bulk:
15
+ post:
16
+ tags:
17
+ - PDF Template APIs
18
+ summary: Generate PDFs in bulk from a CSV
19
+ 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.
20
+ parameters:
21
+ - name: template_id
22
+ in: query
23
+ required: true
24
+ schema:
25
+ type: string
26
+ description: The template to render, from the APIFreaks PDF Template Builder. Copy it from your dashboard when you save the template.
27
+ - name: version
28
+ in: query
29
+ required: false
30
+ schema:
31
+ type: string
32
+ pattern: ^v
33
+ 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.
34
+ requestBody:
35
+ description: Multipart form-data body carrying the CSV file to render. Each row in the CSV is one record and produces one PDF.
36
+ required: true
37
+ content:
38
+ multipart/form-data:
39
+ schema:
40
+ $ref: '#/components/schemas/CsvUploadRequest'
41
+ responses:
42
+ '200':
43
+ description: PDFs generated successfully. The response is an array of results, one entry per CSV row, each with its own pdf_url.
44
+ content:
45
+ application/json:
46
+ schema:
47
+ type: array
48
+ items:
49
+ $ref: '#/components/schemas/TemplateGenerationResponse'
50
+ examples:
51
+ success:
52
+ summary: Generated PDFs for two rows
53
+ value:
54
+ - template_id: 73691bce-1c58-4370-acc6-64b2dd14f81c
55
+ 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
56
+ created_at: '2026-08-10T14:12:47.887Z'
57
+ expiration_time: '2026-11-10T14:12:47.887Z'
58
+ - template_id: 73691bce-1c58-4370-acc6-64b2dd14f81c
59
+ 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
60
+ created_at: '2026-08-10T14:12:47.940Z'
61
+ expiration_time: '2026-11-10T14:12:47.940Z'
62
+ '400':
63
+ description: Bad Request — Missing parameters, a file that is not a CSV, or data larger than 10 MB.
64
+ content:
65
+ application/json:
66
+ schema:
67
+ $ref: '#/components/schemas/ErrorResponse'
68
+ examples:
69
+ CsvFileRequired:
70
+ summary: Uploaded file is not a CSV
71
+ value:
72
+ timestamp: '2026-08-10T14:13:14.497Z'
73
+ path: /v1.0/generate-pdf/bulk
74
+ status: 400
75
+ error: CSV File Required
76
+ message: Only CSV files are supported. Please upload a valid CSV file.
77
+ '401':
78
+ description: Unauthorized — The API key is missing or invalid.
79
+ content:
80
+ application/json:
81
+ schema:
82
+ $ref: '#/components/schemas/ErrorResponse'
83
+ examples:
84
+ InvalidApiKey:
85
+ summary: Provided API key is invalid
86
+ value:
87
+ error: API Access Exception
88
+ message: 'Provided API key is invalid. [For Technical Support: support@apifreaks.com]'
89
+ path: /v1.0/pdf/template/generate/bulk
90
+ status: 401
91
+ timestamp: '2026-08-10T14:13:14.996Z'
92
+ '403':
93
+ description: Forbidden — The account does not have access to this template.
94
+ content:
95
+ application/json:
96
+ schema:
97
+ $ref: '#/components/schemas/ErrorResponse'
98
+ '404':
99
+ description: Not Found — No template matches the template_id, or the requested version does not exist.
100
+ content:
101
+ application/json:
102
+ schema:
103
+ $ref: '#/components/schemas/ErrorResponse'
104
+ '415':
105
+ description: Unsupported Media Type — The request Content-Type is not supported for this endpoint.
106
+ content:
107
+ application/json:
108
+ schema:
109
+ $ref: '#/components/schemas/ErrorResponse'
110
+ '422':
111
+ description: Unprocessable Entity — The request contains invalid or missing data.
112
+ content:
113
+ application/json:
114
+ schema:
115
+ $ref: '#/components/schemas/ErrorResponse'
116
+ '500':
117
+ description: Internal Server Error — An unexpected error occurred, or the PDF could not be generated.
118
+ content:
119
+ application/json:
120
+ schema:
121
+ $ref: '#/components/schemas/ErrorResponse'
122
+ '504':
123
+ description: Gateway Timeout — The request went past the 100 second processing limit.
124
+ content:
125
+ application/json:
126
+ schema:
127
+ $ref: '#/components/schemas/ErrorResponse'
128
+ operationId: generatePdfsFromCsv
129
+ components:
130
+ securitySchemes:
131
+ ApiKeyAuthHeader:
132
+ type: apiKey
133
+ in: header
134
+ name: X-apikey
135
+ description: Pass your API key via the X-apikey request header.
136
+ ApiKeyAuthQuery:
137
+ type: apiKey
138
+ in: query
139
+ name: apiKey
140
+ description: Pass your API key via the apiKey query parameter.
141
+ schemas:
142
+ TemplateGenerationResponse:
143
+ type: object
144
+ description: Result of a PDF generation request, containing the hosted URL of the generated PDF.
145
+ required:
146
+ - template_id
147
+ - pdf_url
148
+ - created_at
149
+ - expiration_time
150
+ properties:
151
+ template_id:
152
+ type: string
153
+ description: The template that was rendered.
154
+ pdf_url:
155
+ type: string
156
+ description: Hosted URL of the generated PDF.
157
+ created_at:
158
+ type: string
159
+ format: date-time
160
+ description: When the PDF was generated (ISO 8601).
161
+ expiration_time:
162
+ type: string
163
+ format: date-time
164
+ description: When the hosted PDF expires (ISO 8601).
165
+ CsvUploadRequest:
166
+ type: object
167
+ description: Multipart form-data request body containing the CSV file to render in bulk.
168
+ required:
169
+ - file
170
+ properties:
171
+ file:
172
+ type: string
173
+ format: binary
174
+ description: A CSV file uploaded as form-data where each row is one record. One PDF is generated per row.
175
+ ErrorResponse:
176
+ type: object
177
+ description: Standard error envelope returned by the API on failed requests.
178
+ required:
179
+ - message
180
+ properties:
181
+ error:
182
+ type: string
183
+ description: Short error category or exception type.
184
+ message:
185
+ type: string
186
+ description: Human-readable error message describing the failure.
187
+ path:
188
+ type: string
189
+ description: API endpoint path that produced the error.
190
+ status:
191
+ type: integer
192
+ description: HTTP status code returned with the error.
193
+ timestamp:
194
+ type: string
195
+ format: date-time
196
+ description: Timestamp when the error occurred (ISO 8601).
197
+ security:
198
+ - ApiKeyAuthHeader: []
199
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,316 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: PDF Generator API - Create PDFs from Templates
4
+ version: 1.0.0
5
+ 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.
6
+ contact:
7
+ name: APIFreaks Support
8
+ url: https://apifreaks.com/contact
9
+ email: support@apifreaks.com
10
+ servers:
11
+ - url: https://api.apifreaks.com/v1.0
12
+ description: PDF Generator API Server
13
+ paths:
14
+ /pdf/template/generate:
15
+ post:
16
+ tags:
17
+ - PDF Template APIs
18
+ summary: Generate a PDF from a template
19
+ 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.
20
+ parameters:
21
+ - name: template_id
22
+ in: query
23
+ required: true
24
+ schema:
25
+ type: string
26
+ description: The template to render, from the APIFreaks PDF Template Builder. Copy it from your dashboard when you save the template.
27
+ - name: version
28
+ in: query
29
+ required: false
30
+ schema:
31
+ type: string
32
+ pattern: ^v
33
+ 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.
34
+ - name: data_url
35
+ in: query
36
+ required: false
37
+ schema:
38
+ type: string
39
+ format: uri
40
+ 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.
41
+ requestBody:
42
+ 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.
43
+ required: false
44
+ content:
45
+ application/json:
46
+ schema:
47
+ type: object
48
+ additionalProperties: true
49
+ description: Free-form JSON object whose keys map to the fields bound in the template.
50
+ examples:
51
+ resumeTemplate:
52
+ summary: Resume template data
53
+ value:
54
+ candidate_name: Ava Thompson
55
+ candidate_title: Senior Operations Analyst
56
+ email: ava.thompson@example.com
57
+ phone: +1 (555) 381-2048
58
+ city: Austin, TX
59
+ portfolio_url: portfolio.example.com
60
+ 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.
61
+ company_name: Northwind Logistics
62
+ job_title: Operations Analyst
63
+ employment_period: 2021 - Present
64
+ job_achievement_1: Led weekly KPI reporting for finance, fulfillment, and customer success stakeholders across three business units.
65
+ job_achievement_2: Reduced manual reconciliation work by 35% through workflow redesign and documentation automation.
66
+ job_achievement_3: Spearheaded a cross-team initiative that improved on-time delivery metrics by 18% within six months.
67
+ skills:
68
+ - skill: Process Improvement
69
+ level: Advanced
70
+ years: '7'
71
+ - skill: Stakeholder Reporting
72
+ level: Expert
73
+ years: '8'
74
+ - skill: Cross-functional Coordination
75
+ level: Advanced
76
+ years: '5'
77
+ - skill: Workflow Documentation
78
+ level: Advanced
79
+ years: '6'
80
+ degree: B.S. in Information Systems
81
+ institution: University of Texas
82
+ graduation_year: '2018'
83
+ certification_1: Certified Business Analysis Professional (CBAP)
84
+ certification_2: Six Sigma Green Belt
85
+ languages: English (Native), Spanish (Professional)
86
+ businessReport:
87
+ summary: Business report template data
88
+ value:
89
+ report_title: Quarterly Business Report
90
+ report_period: Q4 2024
91
+ prepared_by: Marketing Team
92
+ revenue: 125000
93
+ growth_rate: 15
94
+ customer_count: 520
95
+ monthly_comparison:
96
+ - metric: Revenue
97
+ previous: $108,000
98
+ current: $125,000
99
+ change: +15.7%
100
+ - metric: Active Customers
101
+ previous: '480'
102
+ current: '520'
103
+ change: +8.3%
104
+ responses:
105
+ '200':
106
+ description: PDF generated successfully. The response contains the hosted URL of the rendered PDF along with its creation and expiration times.
107
+ content:
108
+ application/json:
109
+ schema:
110
+ $ref: '#/components/schemas/TemplateGenerationResponse'
111
+ examples:
112
+ success:
113
+ summary: Generated PDF
114
+ value:
115
+ template_id: 73691bce-1c58-4370-acc6-64b2dd14f81c
116
+ pdf_url: https://s3.eu-central-2.wasabisys.com/w.storage.apifreaks.com/pdf_templates/73691bce-1c58-4370-acc6-64b2dd14f81c/Candidate%20Resume_20260810141214723405.pdf
117
+ created_at: '2026-08-10T14:12:17.673Z'
118
+ expiration_time: '2026-11-10T14:12:17.673Z'
119
+ '400':
120
+ description: Bad Request — Missing or malformed parameters, missing data, or an unreachable data_url.
121
+ content:
122
+ application/json:
123
+ schema:
124
+ $ref: '#/components/schemas/ErrorResponse'
125
+ examples:
126
+ MissingTemplateId:
127
+ summary: template_id is missing
128
+ value:
129
+ error: Invalid Param Exception
130
+ message: please pass correct parameters
131
+ path: /v1.0/pdf/template/generate
132
+ status: 400
133
+ timestamp: '2026-08-10T14:13:13.195Z'
134
+ InvalidVersion:
135
+ summary: version does not start with v
136
+ value:
137
+ timestamp: '2026-08-10T14:13:13.689Z'
138
+ path: /v1.0/generate-pdf
139
+ status: 400
140
+ error: Invalid Template Version
141
+ message: Please provide a valid template version starting with 'v'.
142
+ NoData:
143
+ summary: No data supplied to fill the template
144
+ value:
145
+ timestamp: '2026-08-10T14:13:14.172Z'
146
+ path: /v1.0/generate-pdf
147
+ status: 400
148
+ error: Template Data Not Provided
149
+ message: No data provided for the template. Please provide valid data to generate pdf.
150
+ '401':
151
+ description: Unauthorized — The API key is missing or invalid.
152
+ content:
153
+ application/json:
154
+ schema:
155
+ $ref: '#/components/schemas/ErrorResponse'
156
+ examples:
157
+ InvalidApiKey:
158
+ summary: Provided API key is invalid
159
+ value:
160
+ error: API Access Exception
161
+ message: 'Provided API key is invalid. [For Technical Support: support@apifreaks.com]'
162
+ path: /v1.0/pdf/template/generate
163
+ status: 401
164
+ timestamp: '2026-08-10T14:13:14.996Z'
165
+ '403':
166
+ description: Forbidden — The account does not have access to this template.
167
+ content:
168
+ application/json:
169
+ schema:
170
+ $ref: '#/components/schemas/ErrorResponse'
171
+ examples:
172
+ AccessDenied:
173
+ summary: No access to the template
174
+ value:
175
+ timestamp: '2026-08-10T14:13:15.000Z'
176
+ path: /v1.0/generate-pdf
177
+ status: 403
178
+ error: Template Access Denied
179
+ message: Your account does not have access to this template.
180
+ '404':
181
+ description: Not Found — No template matches the template_id, or the requested version does not exist.
182
+ content:
183
+ application/json:
184
+ schema:
185
+ $ref: '#/components/schemas/ErrorResponse'
186
+ examples:
187
+ TemplateNotFound:
188
+ summary: No template matches the template_id
189
+ value:
190
+ timestamp: '2026-08-10T14:13:14.677Z'
191
+ path: /v1.0/generate-pdf
192
+ status: 404
193
+ error: Template Not Found
194
+ message: Please provide a valid template ID.
195
+ '415':
196
+ description: Unsupported Media Type — The request Content-Type is not supported for this endpoint.
197
+ content:
198
+ application/json:
199
+ schema:
200
+ $ref: '#/components/schemas/ErrorResponse'
201
+ examples:
202
+ UnsupportedMediaType:
203
+ summary: Content-Type is not supported
204
+ value:
205
+ timestamp: '2026-08-10T14:13:15.500Z'
206
+ path: /v1.0/generate-pdf
207
+ status: 415
208
+ error: Unsupported Media Type
209
+ message: The request Content-Type is not supported for this endpoint.
210
+ '422':
211
+ description: Unprocessable Entity — The request contains invalid or missing data.
212
+ content:
213
+ application/json:
214
+ schema:
215
+ $ref: '#/components/schemas/ErrorResponse'
216
+ examples:
217
+ InvalidData:
218
+ summary: Invalid or missing data
219
+ value:
220
+ timestamp: '2026-08-10T14:13:16.100Z'
221
+ path: /v1.0/generate-pdf
222
+ status: 422
223
+ error: Invalid Template Data
224
+ message: The request contains invalid or missing data.
225
+ '500':
226
+ description: Internal Server Error — An unexpected error occurred, or the PDF could not be generated.
227
+ content:
228
+ application/json:
229
+ schema:
230
+ $ref: '#/components/schemas/ErrorResponse'
231
+ examples:
232
+ GenerationFailed:
233
+ summary: PDF could not be generated
234
+ value:
235
+ timestamp: '2026-08-10T14:13:16.700Z'
236
+ path: /v1.0/generate-pdf
237
+ status: 500
238
+ error: PDF Generation Failed
239
+ message: The PDF could not be generated. Try the request again.
240
+ '504':
241
+ description: Gateway Timeout — The request went past the 100 second processing limit.
242
+ content:
243
+ application/json:
244
+ schema:
245
+ $ref: '#/components/schemas/ErrorResponse'
246
+ examples:
247
+ ProcessingLimit:
248
+ summary: Request exceeded the 100 second processing limit
249
+ value:
250
+ timestamp: '2026-08-10T14:13:17.300Z'
251
+ path: /v1.0/generate-pdf
252
+ status: 504
253
+ error: Processing Timeout
254
+ message: The request went past the 100 second processing limit. Reduce the input size or retry.
255
+ operationId: generatePdfFromTemplate
256
+ components:
257
+ securitySchemes:
258
+ ApiKeyAuthHeader:
259
+ type: apiKey
260
+ in: header
261
+ name: X-apikey
262
+ description: Pass your API key via the X-apikey request header.
263
+ ApiKeyAuthQuery:
264
+ type: apiKey
265
+ in: query
266
+ name: apiKey
267
+ description: Pass your API key via the apiKey query parameter.
268
+ schemas:
269
+ TemplateGenerationResponse:
270
+ type: object
271
+ description: Result of a PDF generation request, containing the hosted URL of the generated PDF.
272
+ required:
273
+ - template_id
274
+ - pdf_url
275
+ - created_at
276
+ - expiration_time
277
+ properties:
278
+ template_id:
279
+ type: string
280
+ description: The template that was rendered.
281
+ pdf_url:
282
+ type: string
283
+ description: Hosted URL of the generated PDF.
284
+ created_at:
285
+ type: string
286
+ format: date-time
287
+ description: When the PDF was generated (ISO 8601).
288
+ expiration_time:
289
+ type: string
290
+ format: date-time
291
+ description: When the hosted PDF expires (ISO 8601).
292
+ ErrorResponse:
293
+ type: object
294
+ description: Standard error envelope returned by the API on failed requests.
295
+ required:
296
+ - message
297
+ properties:
298
+ error:
299
+ type: string
300
+ description: Short error category or exception type.
301
+ message:
302
+ type: string
303
+ description: Human-readable error message describing the failure.
304
+ path:
305
+ type: string
306
+ description: API endpoint path that produced the error.
307
+ status:
308
+ type: integer
309
+ description: HTTP status code returned with the error.
310
+ timestamp:
311
+ type: string
312
+ format: date-time
313
+ description: Timestamp when the error occurred (ISO 8601).
314
+ security:
315
+ - ApiKeyAuthHeader: []
316
+ - ApiKeyAuthQuery: []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apifreaks/openapi-specs",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Public OpenAPI 3.1 specifications for all APIFreaks API products.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",