# Mensagem de media

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

<figure><img src="/files/HWDSnYS9bRB7HaBHG14M" 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.astraapi.com/integrando/mensagens/mensagem-de-media.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
