Request a presigned URL to upload a policy PDF
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
}Policies
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.
POST
/
v1
/
policies
/
{id}
/
pdf
/
upload-url
Request a presigned URL to upload a policy PDF
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
}Headers
Body
application/json
Response
201 - application/json
Was this page helpful?

