Skip to content

Get Attachment

GET /api/attachments/{id}

This endpoint returns the attachment for a specific id.

Attachment IDs are stored in the id field of the attachments array in the Search Inbox response.

Example

sh
curl --request GET \
     --url https://api.mailisk.com/api/attachments/{id} \
     --header 'Accept: application/json' \
     --header 'X-Api-Key: {Api Key}'
js
const attachment = await mailisk.getAttachment(attachmentId);

Response

json
{
  "data": {
    "id": "5e0c23bc-dc1c-49f3-8d92-9a0d85527019",
    "filename": "lorem-ipsum.txt",
    "content_type": "text/plain",
    "size": 446,
    "expires_at": "2026-04-28T08:24:58.000Z",
    "download_url": "https://example.com/attachments/1777112698913_5e0c23bc-dc1c-49f3-8d92-9a0d85527019.txt"
  }
}

Request

Path Params

NameDescription
idThe UUID of the attachment to get.

Response

Typescript type

typescript
interface Attachment {
  data: {
    /** Unique identifier for the attachment */
    id: string;
    /** Filename of the attachment */
    filename: string;
    /** Content type of the attachment */
    content_type: string;
    /** Size in bytes of the attachment */
    size: number;
    /** The datetime when this attachment will be deleted */
    expires_at: string | null;
    /** The URL to the attachment */
    download_url: string;
  };
}