Skip to content
Barynt v1.0.12

Attachments

REST API: list, add (file or link), read and remove attachments of an issue.

Files and links attached to an issue. Every call needs the scope shown and a key (or token) that belongs to someone who may do this in the app. See Authentication and basics.

GET /api/v1/issues/{id}/attachments

Scope: issues:read

List an issue’s attachments (files and links), oldest first. url is where to view each one: a link’s own address, or for a file a signed download URL that needs no token and works until urlExpiresAt (one hour) — fetch again for a fresh one.

Path parameters

NameTypeRequiredDescription
idstringyesThe issue’s id.

Example

Terminal window
curl "$BARYNT_URL/api/v1/issues/$ISSUE_ID/attachments" \
-H "Authorization: Bearer $BARYNT_API_KEY"

Response

{
"data": [
{
"id": "att_3f9c1d",
"issueId": "i_4k2n1x",
"kind": "file",
"name": "safari-checkout.png",
"url": "https://files.example.com/issues/attachments/i_4k2n1x/…?X-Amz-Signature=…",
"urlExpiresAt": "2026-03-04T16:40:00.000Z",
"mimeType": "image/png",
"size": 184213,
"author": { "id": "u_1a2b3c", "name": "Alex Kim" },
"created": "2026-03-02T10:07:00.000Z"
},
{
"id": "att_8k2m4n",
"issueId": "i_4k2n1x",
"kind": "link",
"name": "github.com",
"url": "https://github.com/acme/web/pull/812",
"urlExpiresAt": null,
"mimeType": null,
"size": null,
"author": { "id": "u_7h3j2k", "name": "Priya Shah" },
"created": "2026-03-03T08:30:00.000Z"
}
]
}

POST /api/v1/issues/{id}/attachments

Scope: issues:write

Attach a link or a file — exactly one of url, content or key. A file up to 10 MB can come inline as base64; a larger one (up to 100 MB) is uploaded first via POST /api/v1/issues/{id}/attachments/uploads and then created here with its key. Needs the right to edit the issue. Errors name the reason: invalid_source, invalid_url, invalid_name, invalid_content, too_large, upload_rejected.

Path parameters

NameTypeRequiredDescription
idstringyesThe issue’s id.

Body

NameTypeRequiredDescription
urlstringA link attachment: an http(s) address.
contentstringA file inline: its bytes as base64, or a data: URL (which also sets mimeType). Up to 10 MB.
keystringA file uploaded beforehand — the key from the uploads endpoint, after the PUT.
namestringThe file name, e.g. screenshot.png — required for a file. For a link it defaults to the host.
mimeTypestringe.g. image/png. Guessed from the file name if omitted.

Example

Terminal window
curl -X POST "$BARYNT_URL/api/v1/issues/$ISSUE_ID/attachments" \
-H "Authorization: Bearer $BARYNT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "safari-checkout.png", "content": "iVBORw0KGgoAAAANSUhEUgAA…" }'

Request

{
"name": "safari-checkout.png",
"content": "iVBORw0KGgoAAAANSUhEUgAA…"
}

Response

// 201 Created
{
"data": {
"id": "att_3f9c1d",
"issueId": "i_4k2n1x",
"kind": "file",
"name": "safari-checkout.png",
"url": "https://files.example.com/issues/attachments/i_4k2n1x/…?X-Amz-Signature=…",
"urlExpiresAt": "2026-03-04T16:40:00.000Z",
"mimeType": "image/png",
"size": 184213,
"author": { "id": "u_1a2b3c", "name": "Alex Kim" },
"created": "2026-03-04T15:40:00.000Z"
}
}

POST /api/v1/issues/{id}/attachments/uploads

Scope: issues:write

Step one for a large file (up to 100 MB): returns an uploadUrl to PUT the bytes to directly, with the given headers, within 2 minutes. Then create the attachment with POST /api/v1/issues/{id}/attachments and the returned key.

Path parameters

NameTypeRequiredDescription
idstringyesThe issue’s id.

Body

NameTypeRequiredDescription
fileNamestringyesThe file’s name.
contentLengthnumberyesSize in bytes.
contentTypestringMIME type. Guessed from the file name if omitted.

Example

Terminal window
curl -X POST "$BARYNT_URL/api/v1/issues/$ISSUE_ID/attachments/uploads" \
-H "Authorization: Bearer $BARYNT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "fileName": "screen-recording.mp4", "contentLength": 48213004 }'

Request

{
"fileName": "screen-recording.mp4",
"contentLength": 48213004
}

Response

// 201 Created
{
"data": {
"key": "attachments/i_4k2n1x/6f1c…e2.mp4",
"uploadUrl": "https://files.example.com/issues/attachments/i_4k2n1x/6f1c…e2.mp4?X-Amz-Signature=…",
"method": "PUT",
"headers": { "Content-Type": "video/mp4" },
"expiresAt": "2026-03-04T15:42:00.000Z"
}
}

GET /api/v1/attachments/{id}

Scope: issues:read

Get one attachment with a freshly signed url — for when an earlier one has expired.

Path parameters

NameTypeRequiredDescription
idstringyesThe attachment’s id.

Example

Terminal window
curl "$BARYNT_URL/api/v1/attachments/$ATTACHMENT_ID" \
-H "Authorization: Bearer $BARYNT_API_KEY"

Response

{
"data": {
"id": "att_3f9c1d",
"issueId": "i_4k2n1x",
"kind": "file",
"name": "safari-checkout.png",
"url": "https://files.example.com/issues/attachments/i_4k2n1x/…?X-Amz-Signature=…",
"urlExpiresAt": "2026-03-04T16:40:00.000Z",
"mimeType": "image/png",
"size": 184213,
"author": { "id": "u_1a2b3c", "name": "Alex Kim" },
"created": "2026-03-02T10:07:00.000Z"
}
}

DELETE /api/v1/attachments/{id}

Scope: issues:write

Remove an attachment; a file is deleted from storage too. Needs the right to edit the issue.

Path parameters

NameTypeRequiredDescription
idstringyesThe attachment’s id.

Example

Terminal window
curl -X DELETE "$BARYNT_URL/api/v1/attachments/$ATTACHMENT_ID" \
-H "Authorization: Bearer $BARYNT_API_KEY"

Response

{
"data": { "id": "att_3f9c1d" }
}