Skip to main content
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"
}
'
{
  "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
}

Documentation Index

Fetch the complete documentation index at: https://www.trycomp.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

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)

Body

application/json
purpose
enum<string>
required

What the file is for. Controls where the file is stored and which feature is expected to consume the returned s3Key.

Available options:
questionnaire,
policy_pdf,
evidence,
attachment,
general
Example:

"questionnaire"

fileName
string
required

Original filename, used for the stored object name. Non-alphanumeric characters are replaced with underscores.

Example:

"vendor-security-questionnaire.xlsx"

fileType
string
required

MIME type of the file (e.g. application/pdf, text/csv). Recorded as metadata and passed to the feature endpoint; the PUT itself is content-type agnostic, so the upload never fails on a header mismatch.

Example:

"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"

Response

201 - application/json
uploadUrl
string
required

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=..."

s3Key
string
required

The S3 key the file will land at. Pass this to the feature endpoint (e.g. questionnaire upload-and-parse) instead of base64 file data.

Example:

"org_abc/uploads/questionnaire/1735000000-questionnaire.xlsx"

expiresIn
number
required

Seconds until the presigned URL expires.

Example:

900