File Access API
The File Access API returns short-lived per-file access tokens that allow the caller to download the referenced files from the underlying storage backend.
Full schemas and try-it-out forms live in the interactive API Reference.
Authentication
All endpoints require a Bearer token:
Authorization: Bearer YOUR_API_KEY
See Getting Started → Authentication.
Response envelope
Every endpoint returns the canonical envelope: { "success": true, "data": { ... } }
on success or the standard
error envelope on error.
Endpoint summary
| Method | Path | Description | Sync/Async |
|---|---|---|---|
POST | /api/v1/file-access | Mint signed access tokens for stored files | Sync |
The endpoint is in the auto_generator rate-limit category. See
Developer Guide → Usage quotas and rate limits.
POST /api/v1/file-access — Mint tokens
Request body
| Field | Type | Required | Description |
|---|---|---|---|
filePaths | array of string | yes | List of stored file paths to mint tokens for. |
source | string (betaimages or magikarp) | no | Storage backend source. |
Example
curl -X POST https://api.prezent.ai/api/v1/file-access \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filePaths": [
"uploads/co_xyz/file_abc123/context.pdf",
"uploads/co_xyz/file_def456/notes.pptx"
],
"source": "magikarp"
}'
Success response (200)
{
"success": true,
"data": {
"access_tokens": {
"uploads/co_xyz/file_abc123/context.pdf": "tok_short_lived_1",
"uploads/co_xyz/file_def456/notes.pptx": "tok_short_lived_2"
},
"message": "Tokens minted."
}
}
Use each token as documented for the underlying storage backend (typically as a query parameter on the file's signed URL).
Errors
Common error codes:
400—MISSING_REQUIRED_FIELD,INVALID_PAYLOAD.401—INVALID_API_KEY,EXPIRED_API_KEY,UNAUTHORIZED.403—FORBIDDEN(caller does not have access to one or more of the requested paths).404—RESOURCE_NOT_FOUND.422—UNPROCESSABLE_ENTITY.429—RATE_LIMIT_EXCEEDED,THROTTLED.500/503/504— standard server-side codes.
See the full catalog in Developer Guide → Error codes.