---
title: "Mídia · Referência REST"
description: "As rotas de Mídia. Todo corpo é JSON, e o erro sempre volta como um objeto com código e mensagem."
lang: "pt-BR"
canonical: "https://zaiped.com/developers/docs/reference/media"
alternate: "https://zaiped.com/en/developers/docs/reference/media"
---

# Mídia · Referência REST

## 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.

**Parâmetros de query**

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

**Resposta (object)**

- `mediaId` · string (Obrigatório)

```
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.

**Parâmetros de caminho**

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

**Resposta (object)**

- `url` · string (Obrigatório)
- `expiresAt` · number (Obrigatório)
- `mimeType` · string
- `fileName` · string

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