---
title: "Upload a PDF to a policy version (UI-only)"
method: POST
path: "/v1/policies/{id}/pdf"
tags: ["Policies"]
---

# Upload a PDF to a policy version (UI-only)

`POST /v1/policies/{id}/pdf`

Uploads a PDF via multipart `file` or base64 `fileData` JSON. Defaults to the latest draft if no `versionId`; 400 if no draft is available. UI-only — AI clients should use the presigned `/pdf/upload-url` + `/pdf/confirm` flow.

## Path parameters

- `id` string, required

## Headers

- `X-Organization-Id` string

## Request body

- union
  - object — Multipart file upload (recommended)
    - `file` string, binary, required
    - `versionId` string — Target version ID. If omitted, uploads to the latest draft version.
  - object — JSON with base64-encoded file data
    - `fileName` string, required
    - `fileType` string, required
    - `fileData` string, required — Base64-encoded file content
    - `versionId` string — Target version ID. If omitted, uploads to the latest draft version.

## Response `201`

## Changes

- **2026-06-04** `d7d0199d846f` — 1 info
  - the endpoint scheme security `oauth2` was removed from the API
- **2026-05-29** `5382c53ab431` — 1 info
  - the endpoint scheme security `oauth2` was added to the API
- **2026-05-28** `fa180e2dc668` — 2 breaking, 2 info
  - removed `subschema #1, subschema #2` from the request body `oneOf` list (media type: multipart/form-data)
  - removed `subschema #1, subschema #2` from the request body `oneOf` list (media type: application/json)
  - added `subschema #1, subschema #2` to the request body `oneOf` list (media type: multipart/form-data)
  - added `subschema #1, subschema #2` to the request body `oneOf` list (media type: application/json)
- **2026-05-28** `73c1d2d2da5d` — 1 breaking, 4 warning, 2 info
  - the request's body type/format changed from `object`/`` to ``/``
  - removed the request property `fileData`
  - removed the request property `fileName`
  - removed the request property `fileType`
  - …3 more
- **2026-05-28** `7c0713bef5b1` — 1 breaking
  - added required request body

[Change history](https://skmtc.dev/trycompai/apis/comp-ai-api/changes/v1/policies/:id/pdf/post.md)

---

[API](https://skmtc.dev/trycompai/apis/comp-ai-api.md) · [All operations](https://skmtc.dev/trycompai/apis/comp-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trycompai/comp-ai-api/revisions/726b9523fb22/schema)
