File Upload
Upload File Using Base64
Creates a temporary file using base64
source data. You may use this temporary file URL with other API methods. Temporary files are automatically permanently removed after 1 hour.
POST /v1/file/upload/base64
Attributes
Attributes are case-sensitive and should be inside JSON for POST request. for example: { "url": "https://example.com/file1.pdf" }
Attribute | Type | Required | Default | Description |
---|---|---|---|---|
file | string | Yes | - | Base64-encoded file bytes. |
name | string | No | - | File name for the generated output, the input must be in string format. |
expiration | integer | No | 60 | Set the expiration time for the output link in minutes. After this specified duration, any generated output file(s) will be automatically deleted from PDF.co Temporary Files Storage. The maximum duration for link expiration varies based on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf templates, documents) consider using PDF.co Built-In Files Storage. |
Query parameters
No query parameters accepted.
Responses
Parameter | Type | Description |
---|---|---|
url | string | Direct URL to the final PDF file stored in S3. |
outputLinkValidTill | string | Timestamp indicating when the output link will expire |
error | boolean | Indicates whether an error occurred (false means success) |
status | string | Status code of the request (200, 404, 500, etc.). For more information, see Response Codes. |
name | string | Name of the output file |
credits | integer | Number of credits consumed by the request |
remainingCredits | integer | Number of credits remaining in the account |
duration | integer | Time taken for the operation in milliseconds |
Example
Response
To see the main response codes, please refer to the Response Codes page.