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

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

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

Accepts either a multipart file upload or a base64-encoded JSON body. Used by the web UI where the browser supplies the file directly. NOT recommended for MCP/AI clients — base64 of large files through an LLM is extremely slow, and the.

## 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 (optional)
  - object — JSON with base64-encoded file data
    - `fileName` string, required
    - `fileType` string, required
    - `fileData` string, required — Base64-encoded file content
    - `versionId` string

## Response `201`

## Changes

- **2026-05-28** `73c1d2d2da5d` — 1 breaking, 4 warning, 2 info
  - the request's body type changed from `object` to no type
  - 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/73c1d2d2da5d/schema)
