curl -X POST https://api.okrapdf.com/v1/host \
-H "Authorization: Bearer $OKRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": { "file_id": "file_abc123" },
"namespace": "acme-report",
"title": "Acme Report"
}'
Hosting
Create Hosted PDF
Publish a PDF file to a clean okrapdf.dev hostname.
POST
/
v1
/
host
curl -X POST https://api.okrapdf.com/v1/host \
-H "Authorization: Bearer $OKRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": { "file_id": "file_abc123" },
"namespace": "acme-report",
"title": "Acme Report"
}'
Overview
Publish an existing PDF from/v1/files or /v1/documents as https://{namespace}.okrapdf.dev. Internal storage keys such as original.pdf are not exposed.
object
required
Source file or document reference. Use a file ID for passive assets or a document ID for parsed documents.
string
Desired DNS-label namespace. If omitted, okraPDF generates one.
string
Human-readable title for the hosted PDF.
object
Optional access settings such as disabled, unlisted, expiry, password, download availability, and indexing.
curl -X POST https://api.okrapdf.com/v1/host \
-H "Authorization: Bearer $OKRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": { "file_id": "file_abc123" },
"namespace": "acme-report",
"title": "Acme Report"
}'
Response
{
"namespace": "acme-report",
"deployment": {
"url": "https://acme-report.okrapdf.dev"
}
}