---
title: "Get attachment"
method: GET
path: "/messages/{messageId}/attachments/{index}"
tags: ["Messages"]
---

# Get attachment

`GET /messages/{messageId}/attachments/{index}`

## Request

- Base URL: `https://inboxapp.com/api/v2`
- URL: `https://inboxapp.com/api/v2/messages/{messageId}/attachments/{index}`
- Auth: HTTP bearer

`200` with a fresh URL once ready, `202` while the media is pending or processing. A card index is `invalidRequest`.

## Path parameters

- `messageId` string, required
- `index` integer, required

## Response `200`

OK

- AttachmentMedia: An image, GIF, video, audio clip or file. Its `url` expires, so fetch it again when needed.
  - `index` integer, required: The attachment's stable position in `attachments`, which `GET /messages/{messageId}/attachments/{index}` takes.
  - `kind` 'image' | 'gif' | 'video' | 'audio' | 'file', required
  - `filename` string, nullable, required
  - `contentType` string, nullable, required
  - `sizeBytes` union, required
    - number
    - 'Infinity' | '-Infinity' | 'NaN'
  - `width` union, required
    - number
    - 'Infinity' | '-Infinity' | 'NaN'
  - `height` union, required
    - number
    - 'Infinity' | '-Infinity' | 'NaN'
  - `aspectRatio` union, required: Width divided by height.
    - number
    - 'Infinity' | '-Infinity' | 'NaN'
  - `durationSeconds` union, required: Video and audio only.
    - number
    - 'Infinity' | '-Infinity' | 'NaN'
  - `status` 'ready' | 'pending' | 'processing' | 'failed', required: `ready` once `url` is usable. `pending` and `processing` while Inboxapp stores a copy: resolve the attachment again later. `failed` when Inboxapp gave up.
  - `url` string, nullable, required: Set exactly when `status` is `ready`.
  - `expiresAt` string, date-time, nullable, required: When `url` stops working. Null for URLs that don't expire. Get a fresh URL from `GET /messages/{messageId}/attachments/{index}`.
  - `poster` object, nullable, required: The still frame shown before a video plays. Video only, and only once usable.
    - `url` string, required
    - `expiresAt` string, date-time, nullable, required: When `url` stops working. Null for URLs that don't expire. Get a fresh URL from `GET /messages/{messageId}/attachments/{index}`.
    - `width` union, required
      - number
      - 'Infinity' | '-Infinity' | 'NaN'
    - `height` union, required
      - number
      - 'Infinity' | '-Infinity' | 'NaN'

## Other responses

- `202`: Accepted
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable Entity
- `429`: Too Many Requests
- `500`: Internal Server Error
- `502`: Bad Gateway
- `503`: Service Unavailable

---

[API](https://skmtc.dev/inboxapp/apis/inboxapp-api.md) · [All operations](https://skmtc.dev/inboxapp/apis/inboxapp-api/llms.txt) · [OpenAPI document](https://skmtc.dev/inboxapp/apis/inboxapp-api/revisions/7f9bbf45e851?raw)
