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)Policies
Upload a PDF to a policy version (UI-only) | Comp AI API
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.
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
API key for authentication
Headers
Organization ID (required for session auth, optional for API key auth)
Path Parameters
Policy ID
Example:
"pol_abc123def456"
Body
multipart/form-dataapplication/json
Response
201 - undefined
Was this page helpful?

