List attachments
list_attachmentsList attachments on an OpenProject container (work packages, wiki pages, meetings, documents, budgets, comments) with IDs, sizes, and virus-scan status to identify downloadable files before downloading.
Instructions
List the files attached to one container.
Containers are work packages, wiki pages, meetings, documents, budgets and comments. Use this to discover attachment ids before calling download_attachment, or to check what a work package already carries. The upstream collection is not paginated, so it is fetched in full: the envelope always reports has_more=false and a total equal to the row count.
Returns the standard list envelope; each row has id, file_name, size_bytes, content_type, description, author, created_at and status. status is the virus-scan state — 'uploaded' and 'scanned' are downloadable, 'quarantined' files are not, and anything else is still being scanned and is readable only by its uploader.
Pitfalls: container_id identifies the container, not the file. A 404 means the container does not exist or the module providing it (meetings, budgets, documents) is not enabled on this instance. Forum posts are a valid API container but have no discovery path here.
Related: download_attachment fetches the bytes for one row, upload_attachment adds a file to the same containers, and get_work_package(include=['attachments']) returns these rows inline for a single work package.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_id | Yes | Numeric id of the container itself: the work package id, wiki page id, meeting id, document id, budget id, or activity id. Never an attachment id. | |
| container_type | Yes | Kind of object that owns the files. Use 'comment' for files attached to a work-package comment — those live on the activity, so pass the activity id from list_work_package_comments as container_id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sums | No | Present only when show_sums was requested. | |
| items | No | The page of results. | |
| notes | No | Degradation markers: capped aggregations, unavailable modules, … | |
| groups | No | Present only when group_by was requested. | |
| pagination | Yes | Total/page/page_size/has_more. |