Skip to main content

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

MethodPathDescriptionSync/Async
POST/api/v1/file-accessMint signed access tokens for stored filesSync

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

FieldTypeRequiredDescription
filePathsarray of stringyesList of stored file paths to mint tokens for.
sourcestring (betaimages or magikarp)noStorage 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:

  • 400MISSING_REQUIRED_FIELD, INVALID_PAYLOAD.
  • 401INVALID_API_KEY, EXPIRED_API_KEY, UNAUTHORIZED.
  • 403FORBIDDEN (caller does not have access to one or more of the requested paths).
  • 404RESOURCE_NOT_FOUND.
  • 422UNPROCESSABLE_ENTITY.
  • 429RATE_LIMIT_EXCEEDED, THROTTLED.
  • 500 / 503 / 504 — standard server-side codes.

See the full catalog in Developer Guide → Error codes.