---
title: "Upload attachment to task item"
method: POST
path: "/v1/task-management/attachments"
tags: ["Task Management"]
---

# Upload attachment to task item

`POST /v1/task-management/attachments`

Upload a file attachment for a task item with proper S3 path structure: org_{orgId}/attachments/task-item/{entityType}/{entityId}/files.

## Request body

- UploadTaskItemAttachmentDto
  - `fileName` string, required — Name of the file
  - `fileType` string, required — MIME type of the file
  - `fileData` string, required — Base64 encoded file data
  - `entityType` 'vendor' | 'risk', required — Type of entity this task item belongs to (vendor or risk)
  - `entityId` string, required — ID of the entity this task item belongs to

## Response `201`

Attachment uploaded successfully

- AttachmentResponseDto
  - `id` string, required — Unique identifier for the attachment
  - `name` string, required — Original filename
  - `type` string, required — File type/MIME type
  - `size` number, required — File size in bytes
  - `downloadUrl` string, required — Signed URL for downloading the file (temporary)
  - `createdAt` string, date-time, required — Upload timestamp

---

[API](https://skmtc.net/trycompai/apis/comp-ai-api.md) · [All operations](https://skmtc.net/trycompai/apis/comp-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trycompai/comp-ai-api/revisions/726b9523fb22/schema)
