> ## Documentation Index
> Fetch the complete documentation index at: https://docs.okrapdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Hosted PDF

> Publish a PDF file to a clean okrapdf.dev hostname.

## 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.

<ParamField body="source" type="object" required>
  Source file or document reference. Use a file ID for passive assets or a document ID for parsed documents.
</ParamField>

<ParamField body="namespace" type="string">
  Desired DNS-label namespace. If omitted, OkraPDF generates one.
</ParamField>

<ParamField body="title" type="string">
  Human-readable title for the hosted PDF.
</ParamField>

<ParamField body="access" type="object">
  Optional access settings such as disabled, unlisted, expiry, password, download availability, and indexing.
</ParamField>

<RequestExample>
  ```bash theme={null}
  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"
    }'
  ```
</RequestExample>

### Response

```json theme={null}
{
  "namespace": "acme-report",
  "deployment": {
    "url": "https://acme-report.okrapdf.dev"
  }
}
```
