curl --request POST \
--url https://api.trycomp.ai/v1/policies/{id}/pdf/upload-url \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileName": "acceptable-use-v1.pdf",
"fileType": "application/pdf"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'acceptable-use-v1.pdf', fileType: 'application/pdf'})
};
fetch('https://api.trycomp.ai/v1/policies/{id}/pdf/upload-url', 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/upload-url"
payload = {
"fileName": "acceptable-use-v1.pdf",
"fileType": "application/pdf"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"uploadUrl": "https://bucket.s3.us-east-1.amazonaws.com/org_xxx/policies/pol_xxx/...?X-Amz-Signature=...",
"s3Key": "org_abc/policies/pol_xyz/1735000000-acceptable-use-v1.pdf",
"expiresIn": 900
}Request a presigned URL to upload a policy PDF | Comp AI API
Generates a presigned S3 URL for uploading a policy PDF directly to storage. Use this when attaching a PDF to a compliance policy — the file bytes are.
curl --request POST \
--url https://api.trycomp.ai/v1/policies/{id}/pdf/upload-url \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileName": "acceptable-use-v1.pdf",
"fileType": "application/pdf"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileName: 'acceptable-use-v1.pdf', fileType: 'application/pdf'})
};
fetch('https://api.trycomp.ai/v1/policies/{id}/pdf/upload-url', 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/upload-url"
payload = {
"fileName": "acceptable-use-v1.pdf",
"fileType": "application/pdf"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"uploadUrl": "https://bucket.s3.us-east-1.amazonaws.com/org_xxx/policies/pol_xxx/...?X-Amz-Signature=...",
"s3Key": "org_abc/policies/pol_xyz/1735000000-acceptable-use-v1.pdf",
"expiresIn": 900
}Authorizations
API key for authentication
Headers
Organization ID (required for session auth, optional for API key auth)
Path Parameters
Policy ID
"pol_abc123def456"
Body
Filename of the PDF (e.g., "policy-v1.pdf"). Non-alphanumeric characters will be replaced with underscores when storing in S3.
"acceptable-use-v1.pdf"
MIME type of the file. Must be "application/pdf" — the presigned URL enforces this at upload time.
"application/pdf"
Optional version ID to attach the PDF to. Omit to attach the PDF at the policy level (legacy path).
"pv_abc123def456"
Response
Presigned S3 URL. PUT the raw file bytes to this URL with header Content-Type: application/pdf. No auth headers required — the signature is in the URL.
"https://bucket.s3.us-east-1.amazonaws.com/org_xxx/policies/pol_xxx/...?X-Amz-Signature=..."
The S3 key the file will land at. Pass this back to the confirm endpoint after a successful upload.
"org_abc/policies/pol_xyz/1735000000-acceptable-use-v1.pdf"
Seconds until the presigned URL expires.
900
Was this page helpful?

