Get a presigned URL to upload a file
curl --request POST \
--url https://api.trycomp.ai/v1/uploads/presign \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"purpose": "questionnaire",
"fileName": "vendor-security-questionnaire.xlsx",
"fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purpose: 'questionnaire',
fileName: 'vendor-security-questionnaire.xlsx',
fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
};
fetch('https://api.trycomp.ai/v1/uploads/presign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/uploads/presign"
payload = {
"purpose": "questionnaire",
"fileName": "vendor-security-questionnaire.xlsx",
"fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
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_x/uploads/...?X-Amz-Signature=...",
"s3Key": "org_abc/uploads/questionnaire/1735000000-questionnaire.xlsx",
"expiresIn": 900
}Uploads
Get a presigned URL to upload a file | Comp AI API
Returns a presigned S3 URL plus the s3Key the file lands at. PUT the raw file bytes to that URL, then call the feature tool (e.g. upload-and-parse) with the.
POST
/
v1
/
uploads
/
presign
Get a presigned URL to upload a file
curl --request POST \
--url https://api.trycomp.ai/v1/uploads/presign \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"purpose": "questionnaire",
"fileName": "vendor-security-questionnaire.xlsx",
"fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
purpose: 'questionnaire',
fileName: 'vendor-security-questionnaire.xlsx',
fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
};
fetch('https://api.trycomp.ai/v1/uploads/presign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/uploads/presign"
payload = {
"purpose": "questionnaire",
"fileName": "vendor-security-questionnaire.xlsx",
"fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
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_x/uploads/...?X-Amz-Signature=...",
"s3Key": "org_abc/uploads/questionnaire/1735000000-questionnaire.xlsx",
"expiresIn": 900
}Headers
Body
application/json
Response
201 - application/json
Presigned S3 URL. Send the raw file bytes with a plain HTTP PUT to this URL — no Content-Type or auth headers are required (the signature is in the URL). Then call the feature endpoint with the s3Key below.
Example:
"https://bucket.s3.us-east-1.amazonaws.com/org_x/uploads/...?X-Amz-Signature=..."
Was this page helpful?

