4 Trellis API endpoints for attachments, with the scopes, parameters and response each one takes.
Upload a file to a project
/workspace/{handle}/projects/{projectKey}/attachmentsScopes
Needs a token holding issues:write.
Path parameters
handlestringRequiredWorkspace handle, as it appears in the Trellis URL.
projectKeystringRequiredProject key, e.g. `T-001`.
Request bodymultipart/form-data
object
filestring (binary)RequiredThe file to upload. The maximum size depends on the workspace plan.
reference_idstringID of the roadmap item the upload belongs to, when `reference_type` is `roadmap_item`.
reference_typestringSet to `roadmap_item` with `reference_id` when a viewer uploads to a roadmap item they created.
Responses
201Created
AttachmentResponse
created_atstringidstringscan_statusstringsize_kbinteger (int32)urlstringdefaultError. 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
/workspace/{handle}/projects/{projectKey}/attachments/{id}Scopes
Needs a token holding issues:write.
Path parameters
handlestringRequiredWorkspace handle, as it appears in the Trellis URL.
projectKeystringRequiredProject key, e.g. `T-001`.
idstringRequiredResponses
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
/workspace/{handle}/projects/{projectKey}/attachments/{id}/urlScopes
Needs a token holding issues:read, issues:write or projects:read.
Path parameters
handlestringRequiredWorkspace handle, as it appears in the Trellis URL.
projectKeystringRequiredProject key, e.g. `T-001`.
idstringRequiredQuery parameters
downloadstringSet to `1` or `true` to get a URL that downloads the file as an attachment with its original filename.
Responses
200OK
AttachmentURL
urlstring409Conflict
AttachmentNotClean
errorstringscan_statusstringdefaultError. 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
/workspace/{handle}/projects/{projectKey}/attachments/listScopes
Needs a token holding issues:read, issues:write or projects:read.
Path parameters
handlestringRequiredWorkspace handle, as it appears in the Trellis URL.
projectKeystringRequiredProject key, e.g. `T-001`.
Request bodyapplication/json
PaginationAndFilters
exclude_pending_deletionbooleanexclude_user_idsarray of stringnullablefiltersanynullableids_onlybooleaninclude_invitesbooleanlabel_idsarray of stringnullablelimitintegernullablepageintegernullablequerystringnullablerole_excludearray of stringnullablerole_slugsarray of stringnullablesort_bystringnullablesort_dirstringnullablestatusesarray of stringnullableResponses
200OK
object
countintegerUnfiltered item count, where the endpoint reports one. Omitted when zero.
dataarray of ProjectFileResponsenullable9 fields
content_typestringcreated_atstringcreated_byUserReference5 fields
avatarstringavatar_gradientstringemailstringidstringnamestringfilenamestringidstringkeystringscan_statusstringsize_kbinteger (int32)urlstringlimitintegerPage size used for this response. Omitted when zero.
pageintegerCurrent page, starting at 1. Omitted when zero.
totalintegerNumber 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.