@apifreaks/openapi-specs 0.1.0 → 0.1.2

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.
Files changed (108) hide show
  1. package/dist/index.cjs +133 -2
  2. package/dist/index.d.cts +140 -3
  3. package/dist/index.d.ts +140 -3
  4. package/dist/index.js +131 -2
  5. package/dist/specs/commodity/commodity-fluctuation.yaml +225 -0
  6. package/dist/specs/commodity/commodity-prices.yaml +236 -0
  7. package/dist/specs/commodity/commodity-symbols.yaml +159 -0
  8. package/dist/specs/commodity/commodity-time-series.yaml +238 -0
  9. package/dist/specs/commodity/historical-commodity-prices.yaml +208 -0
  10. package/dist/specs/currency/currency-converter.yaml +193 -0
  11. package/dist/specs/currency/currency-fluctuation.yaml +211 -0
  12. package/dist/specs/currency/currency-historical-data-limit.yaml +112 -0
  13. package/dist/specs/currency/currency-rate.yaml +173 -0
  14. package/dist/specs/currency/currency-supported.yaml +176 -0
  15. package/dist/specs/currency/currency-symbols.yaml +115 -0
  16. package/dist/specs/currency/currency-time-series.yaml +232 -0
  17. package/dist/specs/currency/geolocalized-currency-conversion.yaml +214 -0
  18. package/dist/specs/currency/historical-currency-converter.yaml +195 -0
  19. package/dist/specs/currency/historical-currency-rate.yaml +180 -0
  20. package/dist/specs/dns/bulk-dns-lookup.yaml +484 -0
  21. package/dist/specs/dns/dns-history-lookup.yaml +451 -0
  22. package/dist/specs/dns/dns-lookup.yaml +360 -0
  23. package/dist/specs/dns/reverse-dns-lookup.yaml +338 -0
  24. package/dist/specs/domain/bulk-domain-checker.yaml +198 -0
  25. package/dist/specs/domain/domain-search-with-suggestions.yaml +196 -0
  26. package/dist/specs/domain/domain-search.yaml +149 -0
  27. package/dist/specs/domain/subdomain-lookup.yaml +251 -0
  28. package/dist/specs/email-validation/bulk-email-validation.yaml +403 -0
  29. package/dist/specs/email-validation/email-checker.yaml +451 -0
  30. package/dist/specs/financial/bulk-vat-rates-country.yaml +250 -0
  31. package/dist/specs/financial/financial-apis-supported-countries.yaml +152 -0
  32. package/dist/specs/financial/iban-validation.yaml +270 -0
  33. package/dist/specs/financial/swift-code-finder.yaml +146 -0
  34. package/dist/specs/financial/swift-code-lookup.yaml +156 -0
  35. package/dist/specs/financial/vat-number-validation.yaml +205 -0
  36. package/dist/specs/financial/vat-rates-by-ip.yaml +200 -0
  37. package/dist/specs/financial/vat-rates-country.yaml +212 -0
  38. package/dist/specs/general/usage-credits.yaml +188 -0
  39. package/dist/specs/geocoding/forward-geocoding.yaml +292 -0
  40. package/dist/specs/geocoding/reverse-geocoding.yaml +237 -0
  41. package/dist/specs/geodb/administrative-units-details.yaml +180 -0
  42. package/dist/specs/geodb/administrative-units-levels.yaml +140 -0
  43. package/dist/specs/geodb/administrative-units.yaml +168 -0
  44. package/dist/specs/geodb/cities.yaml +209 -0
  45. package/dist/specs/geodb/countries-details.yaml +207 -0
  46. package/dist/specs/geodb/countries.yaml +199 -0
  47. package/dist/specs/geodb/flags-supported.yaml +119 -0
  48. package/dist/specs/geodb/flags.yaml +170 -0
  49. package/dist/specs/geodb/regions.yaml +76 -0
  50. package/dist/specs/geodb/subregions.yaml +158 -0
  51. package/dist/specs/ip-intelligence/bulk-ip-lookup.yaml +895 -0
  52. package/dist/specs/ip-intelligence/bulk-ip-threat-intelligence.yaml +310 -0
  53. package/dist/specs/ip-intelligence/ip-locator.yaml +708 -0
  54. package/dist/specs/ip-intelligence/ip-threat-intelligence.yaml +230 -0
  55. package/dist/specs/other/astronomy-data.yaml +632 -0
  56. package/dist/specs/pdf/delete-pdf-page.yaml +193 -0
  57. package/dist/specs/pdf/linearize-pdf.yaml +187 -0
  58. package/dist/specs/pdf/merge-pdf.yaml +193 -0
  59. package/dist/specs/pdf/pdf-compress.yaml +208 -0
  60. package/dist/specs/pdf/pdf-decrypt.yaml +202 -0
  61. package/dist/specs/pdf/pdf-encrypt.yaml +213 -0
  62. package/dist/specs/pdf/pdf-extract-pages.yaml +199 -0
  63. package/dist/specs/pdf/pdf-file-status.yaml +148 -0
  64. package/dist/specs/pdf/pdf-file.yaml +136 -0
  65. package/dist/specs/pdf/pdf-files.yaml +85 -0
  66. package/dist/specs/pdf/pdf-resource-download.yaml +117 -0
  67. package/dist/specs/pdf/pdf-resource-upload-binary.yaml +152 -0
  68. package/dist/specs/pdf/pdf-resource-upload.yaml +163 -0
  69. package/dist/specs/pdf/pdf-restrict.yaml +246 -0
  70. package/dist/specs/pdf/pdf-split-pages.yaml +208 -0
  71. package/dist/specs/pdf/pdf-task-status.yaml +187 -0
  72. package/dist/specs/pdf/pdf-to-image.yaml +844 -0
  73. package/dist/specs/pdf/pdf-unrestrict.yaml +221 -0
  74. package/dist/specs/pdf/rotate-pdf-pages.yaml +207 -0
  75. package/dist/specs/phone-validation/bulk-phone-number-validation.yaml +374 -0
  76. package/dist/specs/phone-validation/phone-number-validation.yaml +344 -0
  77. package/dist/specs/scraper/web-scraper.yaml +479 -0
  78. package/dist/specs/screenshot/bulk-screenshot.yaml +728 -0
  79. package/dist/specs/screenshot/website-screenshot.yaml +822 -0
  80. package/dist/specs/ssl/ssl-certificate-chain-lookup.yaml +593 -0
  81. package/dist/specs/ssl/ssl-certificate-lookup.yaml +478 -0
  82. package/dist/specs/timezone/timezone-converter.yaml +249 -0
  83. package/dist/specs/timezone/timezone-lookup.yaml +712 -0
  84. package/dist/specs/user-agent/bulk-user-agent-parser.yaml +340 -0
  85. package/dist/specs/user-agent/user-agent-parser.yaml +271 -0
  86. package/dist/specs/weather/air-quality.yaml +590 -0
  87. package/dist/specs/weather/bulk-live-weather.yaml +654 -0
  88. package/dist/specs/weather/flood-forecast.yaml +519 -0
  89. package/dist/specs/weather/historical-weather.yaml +842 -0
  90. package/dist/specs/weather/live-weather.yaml +633 -0
  91. package/dist/specs/weather/marine-weather.yaml +806 -0
  92. package/dist/specs/weather/time-series-weather.yaml +821 -0
  93. package/dist/specs/weather/weather-forecast.yaml +935 -0
  94. package/dist/specs/whois/asn-lookup.yaml +618 -0
  95. package/dist/specs/whois/bulk-whois-lookup.yaml +827 -0
  96. package/dist/specs/whois/domain-whois-history-lookup.yaml +445 -0
  97. package/dist/specs/whois/reverse-whois.yaml +566 -0
  98. package/dist/specs/whois/whois-domain-lookup.yaml +537 -0
  99. package/dist/specs/whois/whois-ip-lookup.yaml +1123 -0
  100. package/dist/specs/zip-code/bulk-zip-code-lookup.yaml +232 -0
  101. package/dist/specs/zip-code/zip-code-api.yaml +216 -0
  102. package/dist/specs/zip-code/zip-code-distance-match.yaml +239 -0
  103. package/dist/specs/zip-code/zip-code-distance.yaml +233 -0
  104. package/dist/specs/zip-code/zip-codes-by-city.yaml +201 -0
  105. package/dist/specs/zip-code/zip-codes-by-region.yaml +200 -0
  106. package/dist/specs/zip-code/zip-codes-radius-search.yaml +262 -0
  107. package/package.json +6 -2
  108. package/specs/pdf/merge-pdf.json +2 -2
@@ -0,0 +1,208 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: PDF Compress API - Reduce PDF File Size Programmatically
4
+ version: 1.0.0
5
+ description: 'Compress a PDF file to reduce its file size. Supports four compression levels: low (preserves quality), balanced (optimal ratio), high (significant reduction), and extreme (maximum compression). Accepts a file upload or an existing file ID. Returns a task ID for tracking the compression progress.'
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 Compress API Server
13
+ paths:
14
+ /pdf/compress:
15
+ post:
16
+ tags:
17
+ - PDF Operations APIs
18
+ summary: Compress a PDF file
19
+ description: This API compresses a given PDF file to reduce its file serize.
20
+ parameters:
21
+ - name: format
22
+ in: query
23
+ required: false
24
+ schema:
25
+ type: string
26
+ enum:
27
+ - json
28
+ - xml
29
+ default: json
30
+ description: Specifies the desired format for the API response. Choose 'json' for a JSON object or 'xml' for an XML structure.
31
+ - name: file_id
32
+ in: query
33
+ required: false
34
+ schema:
35
+ type: string
36
+ description: The unique ID of a PDF file already uploaded to the API Freaks server. Use this as an alternative to uploading a new file.
37
+ - name: output
38
+ in: query
39
+ required: false
40
+ schema:
41
+ type: string
42
+ default: compressed_pdf
43
+ description: Name of the output PDF.
44
+ - name: compression_level
45
+ in: query
46
+ required: true
47
+ schema:
48
+ type: string
49
+ enum:
50
+ - low
51
+ - balanced
52
+ - high
53
+ - extreme
54
+ default: balanced
55
+ description: Controls how aggressively the PDF is compressed. Lower levels preserve more quality, while higher levels reduce file size more.
56
+ - name: destroy
57
+ in: query
58
+ required: false
59
+ schema:
60
+ type: boolean
61
+ description: If set to true, the input file(s) will be deleted from the server immediately after the output is generated.
62
+ - name: webhook_url
63
+ in: query
64
+ required: false
65
+ schema:
66
+ type: string
67
+ description: The URL to which the webhook notification will be sent after the task is completed.
68
+ - name: webhook_failure_notification
69
+ in: query
70
+ required: false
71
+ schema:
72
+ type: boolean
73
+ description: If true, a notification will also be sent by email in case the webhook request fails all the retries. The email notification will be sent to the requesting user or their organization’s admin if part of one.
74
+ - name: X-Webhook-Authorization
75
+ in: header
76
+ required: false
77
+ schema:
78
+ type: string
79
+ description: 'Optional custom header for webhook requests. Format: `Key:Value` (e.g., `Authorization:Bearer token123`). This will be sent as an HTTP header in the webhook call.'
80
+ requestBody:
81
+ description: Multipart form-data body carrying the PDF file to compress. Alternatively, reference an already-uploaded file via the file_id query parameter instead of uploading here.
82
+ required: false
83
+ content:
84
+ multipart/form-data:
85
+ schema:
86
+ $ref: '#/components/schemas/PdfFileUploadRequest'
87
+ responses:
88
+ '200':
89
+ description: Compression task created successfully
90
+ content:
91
+ application/json:
92
+ schema:
93
+ $ref: '#/components/schemas/PdfTaskResponse'
94
+ examples:
95
+ success:
96
+ summary: Task created
97
+ value:
98
+ taskId: ce4b1a38-6cfc-4373-9bd7-ff186fbd8e7e
99
+ inputIds:
100
+ - f2ba4b50-6f8a-43ae-b42d-96937f50cd89
101
+ '400':
102
+ description: Bad Request — Missing/invalid parameters or file ID
103
+ content:
104
+ application/json:
105
+ examples:
106
+ MissingCompressionLevel:
107
+ summary: Missing required compression_level parameter
108
+ value:
109
+ error: Invalid Param Exception
110
+ message: please pass correct parameters
111
+ path: /v1.0/pdf/compress
112
+ status: 400
113
+ timestamp: '2026-07-27T10:50:09.307Z'
114
+ MissingFileOrID:
115
+ summary: Neither a file nor a file ID was provided
116
+ value:
117
+ timestamp: '2026-07-27T10:50:09.886Z'
118
+ path: /v1.0/pdf/compress
119
+ status: 400
120
+ error: Missing File or ID
121
+ message: Please provide either a file or a file ID.
122
+ InvalidID:
123
+ summary: file_id is malformed or does not exist
124
+ value:
125
+ error: Invalid File ID Provided
126
+ message: Please provide a valid file ID
127
+ path: /v1.0/pdf/compress
128
+ status: 400
129
+ timestamp: '2026-07-27T10:50:25.910Z'
130
+ schema:
131
+ $ref: '#/components/schemas/ErrorResponse'
132
+ '415':
133
+ description: Unsupported Media Type — File type not supported
134
+ content:
135
+ application/json:
136
+ examples:
137
+ InvalidPDF:
138
+ summary: Uploaded file is not a supported type
139
+ value:
140
+ timestamp: '2026-07-27T10:50:18.409Z'
141
+ path: /v1.0/pdf/compress
142
+ status: 415
143
+ error: Unsupported File Type
144
+ message: The provided file type is not supported. Refer to the documentation for valid file types.
145
+ schema:
146
+ $ref: '#/components/schemas/ErrorResponse'
147
+ operationId: compressPdf
148
+ components:
149
+ securitySchemes:
150
+ ApiKeyAuthHeader:
151
+ type: apiKey
152
+ in: header
153
+ name: X-apiKey
154
+ description: Pass your API key via the X-apiKey request header.
155
+ ApiKeyAuthQuery:
156
+ type: apiKey
157
+ in: query
158
+ name: apiKey
159
+ description: Pass your API key via the apiKey query parameter.
160
+ schemas:
161
+ PdfTaskResponse:
162
+ type: object
163
+ description: Response containing the task ID and input file IDs for a PDF processing task.
164
+ required:
165
+ - taskId
166
+ properties:
167
+ taskId:
168
+ type: string
169
+ description: Task ID of the requested task, used to check the task status.
170
+ inputIds:
171
+ type: array
172
+ items:
173
+ type: string
174
+ description: File IDs for the input files provided for the task. Not returned when destroy parameter is true.
175
+ PdfFileUploadRequest:
176
+ type: object
177
+ description: Multipart form-data request body containing the PDF file to process.
178
+ properties:
179
+ file:
180
+ type: string
181
+ format: binary
182
+ description: Raw PDF file bytes sent as a multipart/form-data field named 'file'. Omit this field entirely and pass file_id in the query string instead to use an already-uploaded file.
183
+ required: []
184
+ ErrorResponse:
185
+ type: object
186
+ description: Standard error envelope returned by the API on failed requests.
187
+ required:
188
+ - message
189
+ properties:
190
+ error:
191
+ type: string
192
+ description: Short error category or exception type.
193
+ message:
194
+ type: string
195
+ description: Human-readable error message describing the failure.
196
+ path:
197
+ type: string
198
+ description: API endpoint path that produced the error.
199
+ status:
200
+ type: integer
201
+ description: HTTP status code returned with the error.
202
+ timestamp:
203
+ type: string
204
+ format: date-time
205
+ description: Timestamp when the error occurred (ISO 8601).
206
+ security:
207
+ - ApiKeyAuthHeader: []
208
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,202 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: PDF Decrypt API Reference
4
+ version: 1.0.0
5
+ description: Remove all encryption from a PDF file, including open passwords and permission restrictions. Accepts a file upload or an existing file ID with the file password. Returns a task ID for tracking the decryption progress.
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 Decrypt API Server
13
+ paths:
14
+ /pdf/decrypt:
15
+ post:
16
+ tags:
17
+ - PDF Security APIs
18
+ summary: Remove all encryption from a PDF
19
+ description: This API decrypts PDF files, removing all encryption, including open passwords and permission restrictions.
20
+ parameters:
21
+ - name: format
22
+ in: query
23
+ required: false
24
+ schema:
25
+ type: string
26
+ enum:
27
+ - json
28
+ - xml
29
+ default: json
30
+ description: Specifies the desired format for the API response. Choose 'json' for a JSON object or 'xml' for an XML structure.
31
+ - name: file_id
32
+ in: query
33
+ required: false
34
+ schema:
35
+ type: string
36
+ description: The unique ID of a PDF file already uploaded to the API Freaks server. Use this as an alternative to uploading a new file directly.
37
+ - name: destroy
38
+ in: query
39
+ required: false
40
+ schema:
41
+ type: boolean
42
+ description: If set to `true`, the input file(s) will be permanently deleted from the server immediately after the output PDF is generated.
43
+ - name: output
44
+ in: query
45
+ required: false
46
+ schema:
47
+ type: string
48
+ description: The desired name for the output decrypted PDF file. If not provided, a default name will be assigned.
49
+ - name: file_password
50
+ in: query
51
+ required: true
52
+ schema:
53
+ type: string
54
+ description: The password to unlock the input file if it is protected. Either the owner password or user password can be provided. The owner password takes precedence. Password Length should be between 6 and 128 characters.
55
+ - name: webhook_url
56
+ in: query
57
+ required: false
58
+ schema:
59
+ type: string
60
+ description: The URL to which the webhook notification will be sent after the task is completed.
61
+ - name: webhook_failure_notification
62
+ in: query
63
+ required: false
64
+ schema:
65
+ type: boolean
66
+ description: If true, a notification will also be sent by email in case the webhook request fails all the retries. The email notification will be sent to the requesting user or their organization’s admin if part of one.
67
+ - name: X-Webhook-Authorization
68
+ in: header
69
+ required: false
70
+ schema:
71
+ type: string
72
+ description: 'Optional custom header for webhook requests. Format: `Key:Value` (e.g., `Authorization:Bearer token123`). This will be sent as an HTTP header in the webhook call.'
73
+ requestBody:
74
+ description: Multipart form-data body carrying the PDF file to decrypt. Alternatively, reference an already-uploaded file via the file_id query parameter instead of uploading here.
75
+ required: false
76
+ content:
77
+ multipart/form-data:
78
+ schema:
79
+ $ref: '#/components/schemas/PdfFileUploadRequest'
80
+ responses:
81
+ '200':
82
+ description: Decrypt task created successfully. An incorrect file_password is not rejected synchronously — the task is created, then fails asynchronously; poll the task status endpoint and check for status "failed" with error "Invalid PDF Password".
83
+ content:
84
+ application/json:
85
+ schema:
86
+ $ref: '#/components/schemas/PDFResponse'
87
+ examples:
88
+ success:
89
+ summary: Task created
90
+ value:
91
+ taskId: f91ec747-1dc6-4be5-be4b-4d6ff66ed386
92
+ inputIds:
93
+ - a5f8aca9-d19a-4ee0-90e3-d15f62df1e06
94
+ '400':
95
+ description: Bad Request — Missing/invalid parameters or file ID
96
+ content:
97
+ application/json:
98
+ examples:
99
+ MissingPassword:
100
+ summary: Missing required file_password parameter
101
+ value:
102
+ error: Invalid Param Exception
103
+ message: please pass correct parameters
104
+ path: /v1.0/pdf/decrypt
105
+ status: 400
106
+ timestamp: '2026-07-27T10:56:16.863Z'
107
+ MissingFileOrID:
108
+ summary: Neither a file nor a file ID was provided
109
+ value:
110
+ timestamp: '2026-07-27T10:56:17.498Z'
111
+ path: /v1.0/pdf/decrypt-pdf
112
+ status: 400
113
+ error: Missing File or ID
114
+ message: Please provide either a file or a file ID.
115
+ InvalidID:
116
+ summary: file_id is malformed or does not exist
117
+ value:
118
+ timestamp: '2026-07-27T10:56:18.138Z'
119
+ path: /v1.0/pdf/decrypt
120
+ status: 400
121
+ error: Invalid File ID Provided
122
+ message: Please provide a valid file ID
123
+ schema:
124
+ $ref: '#/components/schemas/ErrorResponse'
125
+ '415':
126
+ description: Unsupported Media Type — File type not supported
127
+ content:
128
+ application/json:
129
+ schema:
130
+ $ref: '#/components/schemas/ErrorResponse'
131
+ examples:
132
+ UnsupportedFileType:
133
+ summary: Uploaded file is not a supported type
134
+ value:
135
+ timestamp: '2026-07-27T10:56:50.780Z'
136
+ path: /v1.0/pdf/decrypt-pdf
137
+ status: 415
138
+ error: Unsupported File Type
139
+ message: The provided file type is not supported. Refer to the documentation for valid file types.
140
+ operationId: decryptPdf
141
+ components:
142
+ securitySchemes:
143
+ ApiKeyAuthHeader:
144
+ type: apiKey
145
+ in: header
146
+ name: X-apiKey
147
+ description: Pass your API key via the X-apiKey request header.
148
+ ApiKeyAuthQuery:
149
+ type: apiKey
150
+ in: query
151
+ name: apiKey
152
+ description: Pass your API key via the apiKey query parameter.
153
+ schemas:
154
+ PDFResponse:
155
+ type: object
156
+ required:
157
+ - taskId
158
+ - inputIds
159
+ properties:
160
+ taskId:
161
+ type: string
162
+ description: Task ID of the requested task, used to check the task status.
163
+ inputIds:
164
+ type: array
165
+ items:
166
+ type: string
167
+ description: File IDs for the input files provided for the task. Not returned when destroy parameter is true.
168
+ description: Response containing the task ID and input file IDs for a PDF processing task.
169
+ PdfFileUploadRequest:
170
+ type: object
171
+ description: Multipart form-data request body containing the PDF file to process.
172
+ required: []
173
+ properties:
174
+ file:
175
+ type: string
176
+ format: binary
177
+ description: Raw PDF file bytes sent as a multipart/form-data field named 'file'. Omit this field entirely and pass file_id in the query string instead to use an already-uploaded file.
178
+ ErrorResponse:
179
+ type: object
180
+ description: Standard error envelope returned by the API on failed requests.
181
+ required:
182
+ - message
183
+ properties:
184
+ error:
185
+ type: string
186
+ description: Short error category or exception type.
187
+ message:
188
+ type: string
189
+ description: Human-readable error message describing the failure.
190
+ path:
191
+ type: string
192
+ description: API endpoint path that produced the error.
193
+ status:
194
+ type: integer
195
+ description: HTTP status code returned with the error.
196
+ timestamp:
197
+ type: string
198
+ format: date-time
199
+ description: Timestamp when the error occurred (ISO 8601).
200
+ security:
201
+ - ApiKeyAuthHeader: []
202
+ - ApiKeyAuthQuery: []
@@ -0,0 +1,213 @@
1
+ openapi: 3.1.1
2
+ info:
3
+ title: PDF Encrypt API Reference
4
+ version: 1.0.0
5
+ description: Encrypt a PDF file with password protection and permission restrictions. Supports setting owner and user passwords, printing, copying, and editing permissions.
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 Encrypt API Server
13
+ paths:
14
+ /pdf/encrypt:
15
+ post:
16
+ tags:
17
+ - PDF Security APIs
18
+ summary: Add password protection to a PDF
19
+ description: This API encrypts a PDF file by setting a password required to open it.
20
+ parameters:
21
+ - name: format
22
+ in: query
23
+ required: false
24
+ schema:
25
+ type: string
26
+ enum:
27
+ - json
28
+ - xml
29
+ default: json
30
+ description: Specifies the desired format for the API response. Choose 'json' for a JSON object or 'xml' for an XML structure.
31
+ - name: file_id
32
+ in: query
33
+ required: false
34
+ schema:
35
+ type: string
36
+ description: The unique ID of a PDF file already uploaded to the API Freaks server. Use this as an alternative to uploading a new file directly.
37
+ - name: destroy
38
+ in: query
39
+ required: false
40
+ schema:
41
+ type: boolean
42
+ description: If set to `true`, the input file(s) will be permanently deleted from the server immediately after the output PDF is generated.
43
+ - name: output
44
+ in: query
45
+ required: false
46
+ schema:
47
+ type: string
48
+ description: The desired name for the output encrypted PDF file. If not provided, a default name will be assigned.
49
+ - name: file_password
50
+ in: query
51
+ required: false
52
+ schema:
53
+ type: string
54
+ description: The password to unlock the input file if it is already protected. Either the owner password or user password can be provided. The owner password takes precedence. Password Length should be between 6 and 128 characters.
55
+ - name: user_password
56
+ in: query
57
+ required: true
58
+ schema:
59
+ type: string
60
+ description: Sets the user password required to open and view the encrypted PDF file. Password Length should be between 6 and 128 characters.
61
+ - name: owner_password
62
+ in: query
63
+ required: false
64
+ schema:
65
+ type: string
66
+ description: Sets the owner password for the PDF file. This password provides full access, including the ability to remove restrictions. If not provided, the `user_password` will also be used as the owner password. Password Length should be between 6 and 128 characters.
67
+ - name: webhook_url
68
+ in: query
69
+ required: false
70
+ schema:
71
+ type: string
72
+ description: The URL to which the webhook notification will be sent after the task is completed.
73
+ - name: webhook_failure_notification
74
+ in: query
75
+ required: false
76
+ schema:
77
+ type: boolean
78
+ description: If true, a notification will also be sent by email in case the webhook request fails all the retries. The email notification will be sent to the requesting user or their organization’s admin if part of one.
79
+ - name: X-Webhook-Authorization
80
+ in: header
81
+ required: false
82
+ schema:
83
+ type: string
84
+ description: 'Optional custom header for webhook requests. Format: `Key:Value` (e.g., `Authorization:Bearer token123`). This will be sent as an HTTP header in the webhook call.'
85
+ requestBody:
86
+ description: Multipart form-data body carrying the PDF file to encrypt. Alternatively, reference an already-uploaded file via the file_id query parameter instead of uploading here.
87
+ required: false
88
+ content:
89
+ multipart/form-data:
90
+ schema:
91
+ $ref: '#/components/schemas/PdfFileUploadRequest'
92
+ responses:
93
+ '200':
94
+ description: PDF encrypt successfully
95
+ content:
96
+ application/json:
97
+ schema:
98
+ $ref: '#/components/schemas/PDFResponse'
99
+ examples:
100
+ success:
101
+ summary: Task created
102
+ value:
103
+ taskId: c11f7d84-33f5-46da-a64c-e70b3704284e
104
+ inputIds:
105
+ - 2d11e722-85cc-4105-b345-f395d48b326e
106
+ '400':
107
+ description: Bad Request — Missing/invalid parameters, file ID, or password
108
+ content:
109
+ application/json:
110
+ examples:
111
+ MissingPassword:
112
+ summary: Missing required user_password parameter
113
+ value:
114
+ error: Invalid Param Exception
115
+ message: please pass correct parameters
116
+ path: /v1.0/pdf/encrypt
117
+ status: 400
118
+ timestamp: '2026-07-27T10:55:36.936Z'
119
+ WeakPassword:
120
+ summary: Password does not meet strength requirements
121
+ value:
122
+ timestamp: '2026-07-27T10:55:37.534Z'
123
+ path: /v1.0/pdf/encrypt-pdf
124
+ status: 400
125
+ error: Weak Password Provided
126
+ message: Please provide a strong password. Refer to the documentation for password requirements.
127
+ InvalidID:
128
+ summary: file_id is malformed or does not exist
129
+ value:
130
+ timestamp: '2026-07-27T10:55:38.063Z'
131
+ path: /v1.0/pdf/encrypt
132
+ status: 400
133
+ error: Invalid File ID Provided
134
+ message: Please provide a valid file ID
135
+ schema:
136
+ $ref: '#/components/schemas/ErrorResponse'
137
+ '415':
138
+ description: Unsupported Media Type — File type not supported
139
+ content:
140
+ application/json:
141
+ examples:
142
+ UnsupportedFileType:
143
+ summary: Uploaded file is not a supported type
144
+ value:
145
+ timestamp: '2026-07-27T10:55:38.634Z'
146
+ path: /v1.0/pdf/encrypt-pdf
147
+ status: 415
148
+ error: Unsupported File Type
149
+ message: The provided file type is not supported. Refer to the documentation for valid file types.
150
+ schema:
151
+ $ref: '#/components/schemas/ErrorResponse'
152
+ operationId: encryptPdf
153
+ components:
154
+ securitySchemes:
155
+ ApiKeyAuthHeader:
156
+ type: apiKey
157
+ in: header
158
+ name: X-apiKey
159
+ description: Pass your API key via the X-apiKey request header.
160
+ ApiKeyAuthQuery:
161
+ type: apiKey
162
+ in: query
163
+ name: apiKey
164
+ description: Pass your API key via the apiKey query parameter.
165
+ schemas:
166
+ PDFResponse:
167
+ type: object
168
+ description: Response containing the task ID and input file IDs for a PDF processing task.
169
+ required:
170
+ - taskId
171
+ properties:
172
+ taskId:
173
+ type: string
174
+ description: Task ID of the requested task, used to check the task status.
175
+ inputIds:
176
+ type: array
177
+ items:
178
+ type: string
179
+ description: File IDs for the input files provided for the task. Not returned when destroy parameter is true.
180
+ PdfFileUploadRequest:
181
+ type: object
182
+ description: Multipart form-data request body containing the PDF file to process.
183
+ required: []
184
+ properties:
185
+ file:
186
+ type: string
187
+ format: binary
188
+ description: Raw PDF file bytes sent as a multipart/form-data field named 'file'. Omit this field entirely and pass file_id in the query string instead to use an already-uploaded file.
189
+ ErrorResponse:
190
+ type: object
191
+ description: Standard error envelope returned by the API on failed requests.
192
+ required:
193
+ - message
194
+ properties:
195
+ error:
196
+ type: string
197
+ description: Short error category or exception type.
198
+ message:
199
+ type: string
200
+ description: Human-readable error message describing the failure.
201
+ path:
202
+ type: string
203
+ description: API endpoint path that produced the error.
204
+ status:
205
+ type: integer
206
+ description: HTTP status code returned with the error.
207
+ timestamp:
208
+ type: string
209
+ format: date-time
210
+ description: Timestamp when the error occurred (ISO 8601).
211
+ security:
212
+ - ApiKeyAuthHeader: []
213
+ - ApiKeyAuthQuery: []