Get knowledge document file
A short-lived (60 second) signed download URL for the original PDF behind a document created from a PDF upload. Not available for pasted-text documents.
Requires the read:knowledge_base scope.
GET /brands/{brand_id}/knowledge-documents/{document_id}/fileAuthorization
| Header | Type | Required |
|---|---|---|
Authorization | Bearer asky_sk_… | required |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
brand_id | uuid | required | From List brands |
document_id | uuid | required | From List knowledge documents |
Request
cURL
curl --request GET \
--url 'https://api.askylabs.com/v1/brands/242546de-4cee-4a7d-952e-f6aa60c63ef8/knowledge-documents/d29a6f31-1c4e-4b8a-9d2f-7a0c3e5b8f61/file' \
--header 'Authorization: Bearer <api-key>'Response
200
{
"data": {
"url": "https://xyzcompany.supabase.co/storage/v1/object/sign/knowledge-base-files/242546de.../d29a6f31....pdf?token=...",
"expires_in_seconds": 60
},
"request_id": "req_9f2b8a3c1e7d4f6a8b0c"
}Response fields
| Field | Type | Description |
|---|---|---|
data.url | string | required. Signed download URL, valid for expires_in_seconds |
data.expires_in_seconds | integer | required. Always 60 |
request_id | string | required. Also returned as the x-request-id header. Quote it when contacting support |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | The document has no file — it was not created from a PDF |
| 401 | invalid_token | The key is missing, malformed, or does not exist |
| 401 | token_expired | The key passed its expiry date |
| 401 | token_revoked | The key was revoked |
| 403 | insufficient_scope | The key does not carry read:knowledge_base |
| 404 | not_found | The brand does not exist, document_id does not belong to this brand, or this key is not allowed to reach it |
| 429 | rate_limited | Over 300 requests per minute |
Notes
The URL expires in 60 seconds. Use it immediately rather than caching it — download the file right after this call, and re-call this endpoint for a fresh URL if it expires.
Only PDF-sourced documents have a file at all. A paste document (or a legacy mcp one)
returns 400 invalid_request here. Check source_type first with
Get knowledge document or
List knowledge documents if you’re not sure which kind
you have.
Last updated on