Skip to main content
Returns a short-lived presigned URL for downloading a specific document from an application.
GET /api/external/applications/{id}/documents/{docId}

Authentication

Requires an API key with applications:read scope. The application must belong to the organization associated with the API key.
Authorization: Bearer klara_{client_id}.{secret}

Path parameters

id
string
required
UUID of the application.
docId
string
required
UUID of the document.

Response

Returns 200 OK with a presigned download URL.
url
string
Presigned S3 URL valid for 1 hour. Use this to download the file directly.
file_name
string
Original file name.
file_type
string
MIME type of the file (e.g., application/pdf, image/jpeg).

Examples

# Get the download URL
curl "https://app.klara-ai.com/api/external/applications/550e8400.../documents/770e8400..." \
  -H "Authorization: Bearer klara_abc123def456.your-secret-here"

# Then download the file
curl -o document.pdf "https://s3.amazonaws.com/..."
Response:
{
  "url": "https://s3.amazonaws.com/bucket/org-id/applications/app-id/1706123456-passport-scan.pdf?X-Amz-...",
  "file_name": "passport-scan.pdf",
  "file_type": "application/pdf"
}
Download URLs expire after 1 hour. If the URL has expired, request a new one by calling this endpoint again.

Errors

StatusErrorCause
401Invalid API keyAPI key is invalid, expired, or inactive
401API key missing required scopes: applications:readKey lacks the required scope
404Application not foundApplication does not exist or belongs to a different organization
404Document not foundDocument does not exist or does not belong to this application
500Internal server errorAn unexpected error occurred