---
title: "Get an SMS message's media"
canonical: "https://bird.com/docs/api/reference/get-sms-message-media"
---

# Get an SMS message's media

`GET /v1/sms/messages/{message_id}/media/{media_id}`

Redirects to a short-lived URL for one attachment on a received MMS. This
endpoint is what the `url` on an entry of the message's `media` points at.
The bytes live in object storage and are served straight from there, so they
never transit the API.

The response is a `302` whose `Location` is that pre-authorized storage URL,
valid for 15 minutes; your client must follow redirects. The `Authorization`
header must be absent from the request that fetches that URL.

The `sms.received` webhook can arrive before the message is readable. If
this operation returns `404` immediately after that event, retry the same
message and media IDs with exponential backoff and a retry deadline. Retain
the event for later investigation if the deadline is reached; a `404` alone
does not distinguish a delayed message from a missing one.

An attachment is kept for 30 days after the message is received. A `410`
means the stored file is gone while the message is still readable: the
message still lists the attachment's `mime_type` and `filename`, but the
bytes cannot be served. Once the message itself expires this operation
returns `404`.

## Servers

- `https://{region}.platform.bird.com`: Regional API endpoint. Use the host for the region your organization is hosted in. Official Bird SDKs and the CLI select it automatically from your API key, so you rarely need to set it by hand.
  - `region`: `us1`, `eu1`. Default: `us1`. The region your organization's data is hosted in.

## Authentication

Use one authentication option:

- `BearerAuth`: HTTP bearer authentication. Pass the API key as a bearer token in the `Authorization` header. Workspace
keys use `bk_{region}_*`; organization master keys use `bm_{region}_*`.
The prefix identifies the region and selects the
API endpoint. Official Bird SDKs and the CLI derive the region from the key.

## Code samples

**TypeScript**

```ts
const media = await bird.sms.messages.media(
  "sms_01kya19eknftrs2s6p82asmvnh",
  "smf_01kyb2m4xq7whs0d8n3prv6tez",
);
console.log(media.contentType, media.contentLength);
```

Examples: [TypeScript](/docs/api/reference/get-sms-message-media.ts.md) · [Python](/docs/api/reference/get-sms-message-media.py.md) · [Go](/docs/api/reference/get-sms-message-media.go.md) · [PHP](/docs/api/reference/get-sms-message-media.php.md) · [CLI](/docs/api/reference/get-sms-message-media.cli.md) · [MCP](/docs/api/reference/get-sms-message-media.mcp.md) · [cURL](/docs/api/reference/get-sms-message-media.curl.md)

## Path parameters

- `message_id` (string, required): SMS message ID.
- `media_id` (string, required): Media ID, as returned in `id` on the message's `media` entry.

## Header parameters

- `X-Workspace-Id` (string, optional): Workspace context for the request. Required for dashboard authentication and master keys. Workspace keys and access tokens already identify their workspace; send that workspace or omit the header. A different one is rejected.
- `X-Organization-Id` (string, optional): Organization context for the request. Required for dashboard authentication. An API key or access token carries its own organization, so send either that organization or no header at all; a different one is rejected.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
