Attachments

4 Trellis API endpoints for attachments, with the scopes, parameters and response each one takes.

Upload a file to a project

POST/workspace/{handle}/projects/{projectKey}/attachments

Scopes

Needs a token holding issues:write.

Path parameters

handlestringRequired

Workspace handle, as it appears in the Trellis URL.

projectKeystringRequired

Project key, e.g. `T-001`.

Request bodymultipart/form-data

object

filestring (binary)Required

The file to upload. The maximum size depends on the workspace plan.

reference_idstring

ID of the roadmap item the upload belongs to, when `reference_type` is `roadmap_item`.

reference_typestring

Set to `roadmap_item` with `reference_id` when a viewer uploads to a roadmap item they created.

Responses

201Created

AttachmentResponse

created_atstring
idstring
scan_statusstring
size_kbinteger (int32)
urlstring

defaultError. Handlers answer with the JSON `Error` body; workspace, authentication and rate-limit checks that run before the handler answer with a plain-text message.

See Errors for the fields it carries.

Delete a project file

DELETE/workspace/{handle}/projects/{projectKey}/attachments/{id}

Scopes

Needs a token holding issues:write.

Path parameters

handlestringRequired

Workspace handle, as it appears in the Trellis URL.

projectKeystringRequired

Project key, e.g. `T-001`.

idstringRequired

Responses

204No Content

defaultError. Handlers answer with the JSON `Error` body; workspace, authentication and rate-limit checks that run before the handler answer with a plain-text message.

See Errors for the fields it carries.

Get a short-lived download URL for a project file

GET/workspace/{handle}/projects/{projectKey}/attachments/{id}/url

Scopes

Needs a token holding issues:read, issues:write or projects:read.

Path parameters

handlestringRequired

Workspace handle, as it appears in the Trellis URL.

projectKeystringRequired

Project key, e.g. `T-001`.

idstringRequired

Query parameters

downloadstring

Set to `1` or `true` to get a URL that downloads the file as an attachment with its original filename.

Responses

200OK

AttachmentURL

urlstring

409Conflict

AttachmentNotClean

errorstring
scan_statusstring

defaultError. Handlers answer with the JSON `Error` body; workspace, authentication and rate-limit checks that run before the handler answer with a plain-text message.

See Errors for the fields it carries.

List a project's files

POST/workspace/{handle}/projects/{projectKey}/attachments/list

Scopes

Needs a token holding issues:read, issues:write or projects:read.

Path parameters

handlestringRequired

Workspace handle, as it appears in the Trellis URL.

projectKeystringRequired

Project key, e.g. `T-001`.

Request bodyapplication/json

PaginationAndFilters

exclude_pending_deletionboolean
exclude_user_idsarray of stringnullable
filtersanynullable
ids_onlyboolean
include_invitesboolean
label_idsarray of stringnullable
limitintegernullable
pageintegernullable
querystringnullable
role_excludearray of stringnullable
role_slugsarray of stringnullable
sort_bystringnullable
sort_dirstringnullable
statusesarray of stringnullable

Responses

200OK

object

countinteger

Unfiltered item count, where the endpoint reports one. Omitted when zero.

dataarray of ProjectFileResponsenullable
9 fields
content_typestring
created_atstring
created_byUserReference
5 fields
avatarstring
avatar_gradientstring
emailstring
idstring
namestring
filenamestring
idstring
keystring
scan_statusstring
size_kbinteger (int32)
urlstring
limitinteger

Page size used for this response. Omitted when zero.

pageinteger

Current page, starting at 1. Omitted when zero.

totalinteger

Number of items matching the filters. Omitted when zero.

defaultError. Handlers answer with the JSON `Error` body; workspace, authentication and rate-limit checks that run before the handler answer with a plain-text message.

See Errors for the fields it carries.