Skip to main content
POST
/
v1
/
policies
/
{id}
/
pdf
Upload a PDF to a policy version (UI-only)
curl --request POST \
  --url https://api.trycomp.ai/v1/policies/{id}/pdf \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form 'file=<string>' \
  --form 0.file='@example-file'
const form = new FormData();
form.append('file', '<string>');
form.append('0.file', '{
"fileName": "example-file"
}');

const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};

options.body = form;

fetch('https://api.trycomp.ai/v1/policies/{id}/pdf', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.trycomp.ai/v1/policies/{id}/pdf"

files = { "0.file": ("example-file", open("example-file", "rb")) }
payload = { "file": "<string>" }
headers = {"X-API-Key": "<api-key>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)

Authorizations

X-API-Key
string
header
required

API key for authentication

Headers

X-Organization-Id
string

Organization ID (required for session auth, optional for API key auth)

Path Parameters

id
string
required

Policy ID

Example:

"pol_abc123def456"

Body

Multipart file upload (recommended)

file
file
required
versionId
string

Target version ID. If omitted, uploads to the latest draft version.

Response

201 - undefined