For the complete documentation index, see llms.txt. This page is also available as Markdown.

Download Document

Downloads the actual file content of a specific customer document.

This endpoint returns the raw binary file data with appropriate Content-Type headers for direct file download or display in applications

Endpoint

GET/v2/customer/{customerId}/file/{id}

Link

Request

Path Parameters

Parameter

Type

Description

Required

Example

customerId

string

Customer ID that owns the document.

Yes

"cust_12345"

id

string

Document unique ID to download.

Yes

"doc_abc123"

Headers

Key

Value

Required

Authorization

123

Yes

Accept

*/* or specific MIME type

No


Response (200 OK)

Returns the raw binary file content with appropriate HTTP headers for file download.

Response Headers

Header

Description

Example

Content-Type

MIME type of the document

application/pdf

Content-Length

File size in bytes

2048576

Content-Disposition

File download behavior

attachment; filename="passport.pdf"

Cache-Control

Caching directives

private, max-age=3600

Response Body

Raw binary content of the requested document file.


Examples

Request

bash

PDF Document Download Example

Request:

bash

Response Headers:

text

Response Body: Raw PDF binary data

Image Document Download Example

Request:

bash

Response Headers:

text

Response Body: Raw JPEG binary data

Programming Language Examples

Python Download Example

python

JavaScript/Node.js Download Example

javascript

Java Download Example

java

Common Download Scenarios

1. PDF Document Download

Request:

bash

Expected Response:

  • Content-Type: application/pdf

  • File: PDF binary data

2. Image Document Download

Request:

bash

Expected Response:

  • Content-Type: image/jpeg or image/png

  • File: Image binary data

3. Direct Browser Display

HTML Example:

html

4. Inline Display in Application

JavaScript Example:

javascript


Error Responses

  1. Document Not Found:

    text

  2. Customer Not Found:

    text

  3. Unauthorized:

    text

  4. Access Denied:

    text


Notes

  • Binary Response: This endpoint returns raw binary data, not JSON

  • File Size: Large files are streamed efficiently

  • Security: Documents are accessed with proper authentication and authorization checks

  • Caching: Responses include cache headers for performance optimization

  • Bandwidth: Consider file sizes when downloading multiple documents

Best Practices:

  • Always check response status code before processing binary data

  • Use appropriate Accept headers when expecting specific file types

  • Handle large files with streaming to avoid memory issues

  • Verify file integrity after download using Content-Length header

  • Implement proper error handling for network failures

Supported File Types:

  • PDF: application/pdf

  • Images: image/jpeg, image/png, image/gif

  • Documents: application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document

  • Text: text/plain

Download Limits:

  • Maximum file size: 50MB

  • Rate limiting: 100 downloads per hour per user

  • Concurrent downloads: 5 simultaneous downloads per user

Last updated