LemuAIDocs

Attachments · 2 min read

Upload an Attachment

Upload a file to a LemuTickets ticket, or to attach to a comment

Open in ChatGPTOpen in ClaudeMarkdown

Uploads a file of up to 25 MB, such as an invoice, a photo of a damaged product or a log file. You can attach it to a ticket straight away, or upload it first and then attach it to a comment with Add a comment (attachment_ids).

POST/v1/attachments

Attaching to a ticket needs the tickets.write scope in the ticket's project.

Request body#

Send the file as multipart/form-data, not JSON.

FieldTypeRequiredDescription
filefileYesThe file. Up to 25 MB.
ticketstringNoThe ticket key (SUP-1042) or id to attach the file to. Leave it out to upload a file for a comment you post next.
inlinebooleanNotrue for an image shown inside a comment's text rather than as a separate file. Default false.

Executables and scripts are refused, by extension (for example .exe, .msi, .bat, .sh, .js, .apk, .dmg, .ps1, .vbs, .jar) and by content.

Example request:

cURL
curl -X POST https://api.tickets.lemuai.com/v1/attachments \
  -H "Authorization: Bearer ltk_live_your_api_key" \
  -F "file=@invoice-58213.pdf;type=application/pdf" \
  -F "ticket=SUP-1042"

To attach the file to a comment, upload it without ticket (or with the same ticket), then send its id in attachment_ids:

cURL
curl -X POST https://api.tickets.lemuai.com/v1/tickets/SUP-1042/comments \
  -H "Authorization: Bearer ltk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "body": "Please find the credit note attached.",
    "visibility": "public",
    "attachment_ids": ["a9c1e3b5-d7f2-4a4c-9e6b-8d0f2a4c6e8b"]
  }'

Response#

201

JSON
{
  "id": "a9c1e3b5-d7f2-4a4c-9e6b-8d0f2a4c6e8b",
  "filename": "invoice-58213.pdf",
  "content_type": "application/pdf",
  "size_bytes": 182344,
  "scan_status": "clean",
  "inline": false,
  "ticket_id": "2f9c7e1a-5b3d-4c8e-9a6f-1d0e2b4c6a8f",
  "comment_id": null,
  "created_at": "2026-11-25T10:05:33.902000+00:00",
  "download_url": "<signed link to the file>",
  "download_expires_in": 900
}
FieldTypeDescription
idstringThe attachment's id. Use it in attachment_ids.
filenamestringThe file name, cleaned of unsafe characters.
content_typestringThe file's type.
size_bytesintegerThe size.
scan_statusstringclean when the file is stored and can be downloaded.
inlinebooleanWhether it is an inline image.
ticket_idstring or nullThe ticket it belongs to.
comment_idstring or nullThe comment it belongs to, once attached to one.
created_atstringWhen it was uploaded.
download_urlstring or nullA link to download the file. It works for 15 minutes.
download_expires_ininteger or nullSeconds until download_url stops working (900).

Downloading a file#

download_url expires after 15 minutes, so don't store it. To get a fresh link later, call:

cURL
curl https://api.tickets.lemuai.com/v1/attachments/a9c1e3b5-d7f2-4a4c-9e6b-8d0f2a4c6e8b \
  -H "Authorization: Bearer ltk_live_your_api_key"

It returns the same fields with a new download_url.

Errors#

StatuscodeWhen
404ticket_not_foundticket does not exist, or you cannot see it
422file_too_largeThe file is over 25 MB
422empty_fileThe file is empty
422blocked_file_typeThe file is an executable or script
422invalid_fieldsfile is missing