Skip to content

attachment_get

Fetch an attachment’s name, type, size, download URL, and expiry. Use it to check whether an uploaded file still exists, or to get a fresh URL for it. Files are uploaded over HTTP; see upload attachments.

{
"cmd": "attachment_get",
"attachment_id": "550e8400-e29b-41d4-a716-446655440000"
}
Field Type Required Description
attachment_id string Yes ID of the attachment, as returned by the upload. Surrounding spaces are trimmed.

The response command is attachment_info, not attachment_get.

{
"cmd": "attachment_info",
"attachment": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "diagram.png",
"mime_type": "image/png",
"size": 28431,
"url": "https://chat.example.com/attachments/550e8400-e29b-41d4-a716-446655440000",
"expires_at": 1788177600,
"permanent": false,
"width": 1280,
"height": 720
}
}

attachment is an attachment object. This command returns metadata only; download the file from attachment.url. width and height appear only for images whose size the server measured.

This response goes to the caller only.

Any member can call it, for any attachment ID. It isn’t limited to your own uploads or to channels you can view.

val When
Attachment not found or expired No attachment has this ID, or it has expired.
Validation message attachment_id is missing or blank, for example attachment_id: Required.