POST
/
v1
/
tasks
/
{taskId}
/
attachments
Upload attachment to task
curl --request POST \
  --url https://api.trycomp.ai/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"
}'
{
  "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"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Headers

X-Organization-Id
string

Organization ID (required for session auth, optional for API key auth)

Path Parameters

taskId
string
required

Unique task identifier

Example:

"tsk_abc123def456"

Body

application/json
fileName
string
required

Name of the file

Maximum length: 255
Example:

"document.pdf"

fileType
enum<string>
required

MIME type of the file

Available options:
image/jpeg,
image/png,
image/gif,
image/webp,
application/pdf,
text/plain,
application/msword,
application/vnd.openxmlformats-officedocument.wordprocessingml.document
Example:

"application/pdf"

fileData
string
required

Base64 encoded file data

Example:

"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="

description
string

Description of the attachment

Maximum length: 500
Example:

"Meeting notes from Q4 planning session"

Response

Attachment uploaded successfully

id
string
required

Unique identifier for the attachment

Example:

"att_abc123def456"

name
string
required

Original filename

Example:

"document.pdf"

type
string
required

File type/MIME type

Example:

"application/pdf"

size
number
required

File size in bytes

Example:

1024000

downloadUrl
string
required

Signed URL for downloading the file (temporary)

Example:

"https://bucket.s3.amazonaws.com/path/to/file.pdf?signature=..."

createdAt
string<date-time>
required

Upload timestamp

Example:

"2024-01-15T10:30:00Z"