Skip to content

Upload a file to a request

POST
/v1/audits/{auditId}/requests/{requestId}/files
curl --request POST \
--url https://api.varman.io/v1/audits/aud_abc123/requests/aur_abc123/files \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "fileName": "document.pdf", "fileType": "application/pdf", "fileData": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==", "s3Key": "org_abc123/uploads/attachment/1700000000000-rbac-matrix.xlsx", "description": "Meeting notes from Q4 planning session", "userId": "usr_abc123def456" }'

Uploads a file as evidence and links it to the request. AI clients upload via /v1/uploads/presign (purpose=attachment) first and pass the s3Key.

auditId
required
string

Example

aud_abc123

Audit ID

requestId
required
string

Example

aur_abc123

Audit request ID

Media typeapplication/json
object
fileName
required

Name of the file

string
<= 255 characters

Example

document.pdf
fileType
required

MIME type of the file

string

Example

application/pdf
fileData

Base64-encoded file contents. For the web UI / direct callers. AI/MCP clients should instead upload via /v1/uploads/presign (purpose=attachment) and pass s3Key — base64 through an LLM is impractically slow and times out. Provide exactly one of fileData or s3Key.

string

Example

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==
s3Key

Key of a file already uploaded via /v1/uploads/presign (purpose=attachment). The server fetches the bytes from storage — no base64 needed. Provide exactly one of fileData or s3Key.

string

Example

org_abc123/uploads/attachment/1700000000000-rbac-matrix.xlsx
description

Description of the attachment

string
<= 500 characters

Example

Meeting notes from Q4 planning session
userId

User ID of the user uploading the attachment (required for API key auth, ignored for JWT auth)

string

Example

usr_abc123def456