Get a presigned URL to upload a file
const url = 'https://api.varman.io/v1/uploads/presign';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"purpose":"questionnaire","fileName":"vendor-security-questionnaire.xlsx","fileType":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.varman.io/v1/uploads/presign \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "purpose": "questionnaire", "fileName": "vendor-security-questionnaire.xlsx", "fileType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }'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 s3Key instead of sending file data. Bytes never pass through the LLM.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Organization ID (required for session auth, optional for API key auth)
Request Bodyrequired
Section titled “Request Bodyrequired”object
What the file is for. Controls where the file is stored and which feature is expected to consume the returned s3Key.
Example
questionnaireOriginal filename, used for the stored object name. Non-alphanumeric characters are replaced with underscores.
Example
vendor-security-questionnaire.xlsxMIME 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.sheetResponses
Section titled “Responses”object
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.
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.
Seconds until the presigned URL expires.
Example
{ "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}