curl --request POST \
--url http://localhost:3333/v1/tasks/{taskId}/attachments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileName": "document.pdf",
"fileType": "application/pdf",
"fileData": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==",
"description": "Meeting notes from Q4 planning session",
"userId": "usr_abc123def456"
}
'{
"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"
}Upload a file attachment to a specific task
curl --request POST \
--url http://localhost:3333/v1/tasks/{taskId}/attachments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fileName": "document.pdf",
"fileType": "application/pdf",
"fileData": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==",
"description": "Meeting notes from Q4 planning session",
"userId": "usr_abc123def456"
}
'{
"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"
}API key for authentication
Unique task identifier
"tsk_abc123def456"
Name of the file
255"document.pdf"
MIME type of the file
"application/pdf"
Base64 encoded file data
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="
Description of the attachment
500"Meeting notes from Q4 planning session"
User ID of the user uploading the attachment (required for API key auth, ignored for JWT auth)
"usr_abc123def456"
Attachment uploaded successfully
Unique identifier for the attachment
"att_abc123def456"
Original filename
"document.pdf"
File type/MIME type
"application/pdf"
File size in bytes
1024000
Signed URL for downloading the file (temporary)
"https://bucket.s3.amazonaws.com/path/to/file.pdf?signature=..."
Upload timestamp
"2024-01-15T10:30:00Z"
Was this page helpful?