Upload task evidence
const url = 'https://api.varman.io/v1/tasks/tsk_abc123def456/attachments';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"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"}'};
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/tasks/tsk_abc123def456/attachments \ --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" }'Upload an evidence attachment to a task so auditors and reviewers can trace completion back to source documentation.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
tsk_abc123def456Unique task identifier
Request Bodyrequired
Section titled “Request Bodyrequired”object
Name of the file
Example
document.pdfMIME type of the file
Example
application/pdfBase64-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.
Example
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==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.
Example
org_abc123/uploads/attachment/1700000000000-rbac-matrix.xlsxDescription of the attachment
Example
Meeting notes from Q4 planning sessionUser ID of the user uploading the attachment (required for API key auth, ignored for JWT auth)
Example
usr_abc123def456Responses
Section titled “Responses”Attachment uploaded successfully
object
Unique identifier for the attachment
Original filename
File type/MIME type
File size in bytes
Signed URL for downloading the file (temporary)
Upload timestamp
Example
{ "id": "att_abc123def456", "entityId": "tsk_abc123def456", "entityType": "task", "fileName": "evidence.pdf", "fileType": "application/pdf", "fileSize": 123456, "createdAt": "2024-01-01T00:00:00Z", "createdBy": "usr_abc123def456"}Invalid file data or file too large
object
Example
{ "message": "File exceeds maximum allowed size"}Unauthorized - Invalid authentication
object
Example
{ "message": "Unauthorized"}Task not found
object
Example
{ "message": "Task with ID tsk_abc123def456 not found"}