Skip to main content

GET /v1/file/download/{filetoken}

Endpoint URL Format:
Replace {filetoken} with the actual filetoken identifier. For example:
Key Features:
  • Exclusive Access: The endpoint strictly controls access, allowing only the account owner with the correct filetoken to retrieve the associated file.
  • Secure File Retrieval: Files are securely stored and can only be accessed through the authenticated API endpoint using the filetoken.
  • File Token Based: Uses a unique filetoken identifier to access files stored in PDF.co’s built-in file storage.
Files must be uploaded to PDF.co’s built-in file storage at https://app.pdf.co/files to obtain a filetoken. The filetoken is used to securely reference and retrieve files through the API.

Request Headers

Response

The endpoint returns the file content directly with the appropriate Content-Type header based on the file type. The response is a binary file stream.

Response Headers

Error Responses

If an error occurs, the endpoint returns a JSON response with the following structure:

Example Response (Success)

On successful request, the endpoint returns the file binary content directly. The following example shows the response headers for a PDF file:
Response Headers:

Example Error Response

To see the main response codes, please refer to the Response Codes page.
Inconsistent URL Encoding in cURL Output: When using cURL to make API requests, the output JSON may show URL characters encoded as Unicode escape sequences. For example, the ampersand character (&) may appear as \u0026 in the cURL output. This is normal JSON encoding behavior and does not affect the validity of the URL. The URL will function correctly when used, as JSON parsers automatically decode these escape sequences. If you’re parsing the response programmatically, your JSON parser will handle this conversion automatically.

Code Samples