---
title: "Media · REST reference"
description: "The Media routes. Every body is JSON, and an error always comes back as an object with a code and a message."
lang: "en-US"
canonical: "https://zaiped.com/en/developers/docs/reference/media"
alternate: "https://zaiped.com/developers/docs/reference/media"
---

# Media · REST reference

## POST /v1/media

Upload media to send

Raw bytes in the request body with the `Content-Type` of the file (image, video, audio, document). Returns a `mediaId` to use as `media: { path }` in send_message. Not available as an MCP tool.

**Query parameters**

- `numberId` · string (Required): The number id, as returned by list_numbers.

**Response (object)**

- `mediaId` · string (Required)

```
curl -X POST "https://zaiped.com/v1/media" \
  -H "Authorization: Bearer zp_..."
```

## GET /v1/media/{messageId}

Get a download URL for received media

The `messageId` comes in the `message.received` webhook event. The URL is signed and short-lived.

**Path parameters**

- `messageId` · string (Required): The Zaiped message id from the webhook event.

**Response (object)**

- `url` · string (Required)
- `expiresAt` · number (Required)
- `mimeType` · string
- `fileName` · string

```
curl -X GET "https://zaiped.com/v1/media/YOUR_MESSAGE_ID" \
  -H "Authorization: Bearer zp_..."
```