> For the complete documentation index, see [llms.txt](https://docs.astraapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.astraapi.com/integrando/mensagens/mensagem-de-media.md).

# Mensagem de media

Permite enviar uma media para um número que tenha WhatsApp

Permite enviar qualquer tipo de media como image, video, pdf.

<figure><img src="https://2903885385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQBZfML65wCNYTfm6Z1yV%2Fuploads%2FeiRJykgYojX3t422Hvap%2Fimagem.jpeg?alt=media&amp;token=faee324e-3e29-40e5-b936-e999c2ae880e" alt=""><figcaption></figcaption></figure>

### Exemplo de body a ser enviado

```json
{
    "caption": "test",
    "phone": "5579999999@s.whatsapp.net",
    "url": "https://www.tecnologiaefloresta.com.br/imagens/uploads/2016/06/floresta-no-outono.jpg",
    "gif": false,
    "mediaType": "image"
}
```

<mark style="color:green;">`POST`</mark> `https://api.astraapi.com/api/message/send/url/{{instanceId}}`

#### Path Parameters

| Name                                         | Type   | Description     |
| -------------------------------------------- | ------ | --------------- |
| instanceId<mark style="color:red;">\*</mark> | Number | id da instancia |
|                                              | String |                 |

#### Headers

| Name                                            | Type   | Description            |
| ----------------------------------------------- | ------ | ---------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Seu token de segurança |

#### Request Body

| Name                                      | Type    | Description                                                                                                                                         |
| ----------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| caption<mark style="color:red;">\*</mark> | String  | Legenda da media                                                                                                                                    |
| phone<mark style="color:red;">\*</mark>   | String  | telefone ou grupo que vai receber a media                                                                                                           |
| url<mark style="color:red;">\*</mark>     | String  | link da media                                                                                                                                       |
| gif                                       | Boolean | No caso de vídeos se for passado true nesse campo ele será enviado como gif                                                                         |
| mediaType                                 | String  | <p>Tipo da media (image,video,audio, document.<br>Esse parâmetro é opcional, caso nao seja passado o tipo da media será captado com base na url</p> |

{% tabs %}
{% tab title="200: OK id da mensagem" %}

```json
{
    "id": "BAE5426A378EF278"
}
```

{% endtab %}
{% endtabs %}
