---
title: "Add files to task"
method: POST
path: "/projects/{project_id}/tasks/{id}/add_files_to_task"
tags: ["Tasks"]
---

# Add files to task

`POST /projects/{project_id}/tasks/{id}/add_files_to_task`

Upload files to a task. Files attach at the task level (task.files, i.e. firm-uploaded files, listed in attached_files with uploaded_by=firm). Provide either a publicly accessible URL for Truss to download, or a signed_id from POST /projects/{project_id}/tasks/direct_upload after uploading the file bytes directly to cloud storage. Requires the files_write scope, plus files_read because the response includes presigned download URLs.

## Path parameters

- `project_id` integer, required
- `id` integer, required

## Request body

- object
  - `files` object[], required — List of files to attach to the task
    - `filename` string, required — File name (extension is required)
    - `content_type` string, required — MIME type of the file (e.g. application/pdf)
    - `url` string, uri — Publicly accessible URL from which Truss will download the file
    - `signed_id` string — Blob signed ID, an alternative to a download URL. You get this from POST /projects/{project_id}/tasks/direct_upload

## Response `200`

Files added to task successfully; returns the task with its attached_files

- TaskExtended
  - `id` integer
  - `name` string — Name of the task
  - `description` string — Description of the task - supports limited subset of HTML &lt;b&gt;, &lt;ul&gt;, &lt;li&gt;, &lt;br&gt;, and &lt;a&gt;.
  - `description_as_string` string — Plain text description of the task
  - `status` 'to_do' | 'pending_review' | 'approved' — Status of the task
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `assignees` Assignee[]
    - `id` integer
    - `display_name` string
    - `name` string
    - `email` string, nullable — Contact's global primary email, or null if the contact has none.
  - `comments` Comment[]
    - `id` integer
    - `commentable_type` string — Type of the commentable (e.g. "Task")
    - `commentable_id` integer — ID of the commentable (e.g. "Task")
    - `commenter_type` string — Type of the commenter (e.g. "User" or "Assignee")
    - `commenter_id` integer — ID of the commenter (e.g. "User" or "Assignee")
    - `content` string — HTML content of the comment
    - `content_as_string` string — Plain text content of the comment
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `project` Project — Summary representation of a project. Contains scalar attributes plus the owning user and status — no assignees, tasks, tags, or entity. Use GET /projects/{id}, or POST /projects, for the ProjectExtended representation that includes those associations.
    - `id` integer
    - `name` string
    - `tax_year` integer, nullable — Four-digit year parsed from the project name, or null if the name contains no recent year.
    - `idempotency_key` string, nullable
    - `metadata` object
    - `last_uploaded` string, date-time, nullable — When a file was last uploaded to this project, or null if none has been.
    - `updated_at` string, date-time
    - `archived_at` string, date-time, nullable — When the project was archived, or null if it is active.
    - `user` User
      - `id` integer
      - `email` string
      - `first_name` string
      - `last_name` string
      - `idempotency_key` string, nullable
    - `project_status` ProjectStatus
      - `id` integer
      - `name` string
      - `position` integer
  - `attached_files` AttachedFile[] — Task-level and assignee task file attachments. On GET task, the uploaded_by query parameter narrows this to firm-uploaded (task-level) or client-uploaded (assignee task) files.
    - `attachment_id` integer — Identifier used to retrieve this file's text extraction.
    - `blob_id` integer
    - `filename` string
    - `content_type` string
    - `byte_size` integer
    - `download_url` string, uri, nullable — Temporary download URL valid for 10 minutes.
    - `created_at` string, date-time

## Other responses

- `400` — No files provided, invalid file data, or invalid file URL
- `404` — project or task not found
- `422` — Unsupported file extension, blob not found for signed_id, or empty file

---

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