Upload attachment to task item
POST
/v1/task-management/attachments
const url = 'https://api.varman.io/v1/task-management/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==","entityType":"vendor","entityId":"vnd_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/task-management/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==", "entityType": "vendor", "entityId": "vnd_abc123def456" }'Upload a file attachment for a task item with proper S3 path structure: org_{orgId}/attachments/task-item/{entityType}/{entityId}/files.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
fileName
required
Name of the file
string
Example
document.pdffileType
required
MIME type of the file
string
Example
application/pdffileData
required
Base64 encoded file data
string
Example
iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==entityType
required
Type of entity this task item belongs to (vendor or risk)
string
Example
vendorentityId
required
ID of the entity this task item belongs to
string
Example
vnd_abc123def456Responses
Section titled “Responses”Attachment uploaded successfully
Media typeapplication/json
object
id
required
Unique identifier for the attachment
string
name
required
Original filename
string
type
required
File type/MIME type
string
size
required
File size in bytes
number
downloadUrl
required
Signed URL for downloading the file (temporary)
string
createdAt
required
Upload timestamp
string format: date-time
Example
{ "id": "att_abc123def456", "name": "document.pdf", "type": "application/pdf", "size": 1024000, "downloadUrl": "https://bucket.s3.amazonaws.com/path/to/file.pdf?signature=...", "createdAt": "2024-01-15T10:30:00Z"}