# Enviar media

## Send Media

<mark style="color:green;">`POST`</mark> `https://api2.wazend.net/message/sendMedia/{{instance_name}}`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| apiKey       | `<api_token>`      |

**Body**

```json
{
    "number": "51924079147", //Número de destinatario con código de país
    "mediatype": "image", // image, video or document
    "mimetype": "image/png", // Tipo de media/extension
    "caption": "Subtítulo de prueba",
    "media": "https://wazend.net/wp-content/uploads/2024/03/cropped-Logo-19.png", /* url or base64 */
    "fileName": "Imagen.png"
}
```

| Name        | Type              | Description                                              |
| ----------- | ----------------- | -------------------------------------------------------- |
| `number`    | string            | Número de la persona destinataria con el código del país |
| `mediatype` | string            | Puede ser 'image', 'document', 'video', o 'audio'.       |
| `caption`   | string (opcional) | Es el texto para acompañar el documento enviado.         |
| `media`     | string            | URL del archivo.                                         |
| `filename`  | string            | Nombre del archivo.                                      |

**Response**

{% tabs %}
{% tab title="201" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "key": {
        "remoteJid": "51924079147@s.whatsapp.net",
        "fromMe": true,
        "id": "3EB0C4387F675853B15C1C0E8F93A4A3A2608B7E"
    },
    "pushName": "",
    "status": "PENDING",
    "message": {
        "imageMessage": {
            "url": "https://mmg.whatsapp.net/o1/v/t62.7118-24/f1/m231/up-oil-image-7b6112b0-67aa-4157-a371-7fa5eed08e32?ccb=9-4&#x26;oh=01_Q5AaIGxbLScHLKYXiDKx5zxKooDeofQ5e4Cleo_Z0h4yY98c&#x26;oe=6767257A&#x26;_nc_sid=e6ed6c&#x26;mms3=true",
            "mimetype": "image/png",
            "caption": "Subtítulo de prueba",
            "fileSha256": "8EkQFWufyTZpV7p0qY2ahMXR8zWp9rWn4IYi1xbk8EA=",
            "fileLength": "22252",
            "height": 632,
            "width": 485,
            "mediaKey": "qGvEc1yuvelSManSZwaHgrU3ckIAB1tYIER3Td/RZto=",
            "fileEncSha256": "abDTJU6NKPvfEM7XPhte988m7bBwBZPsRZuydc8//50=",
            "directPath": "/o1/v/t62.7118-24/f1/m231/up-oil-image-7b6112b0-67aa-4157-a371-7fa5eed08e32?ccb=9-4&#x26;oh=01_Q5AaIGxbLScHLKYXiDKx5zxKooDeofQ5e4Cleo_Z0h4yY98c&#x26;oe=6767257A&#x26;_nc_sid=e6ed6c",
            "mediaKeyTimestamp": "1732228547",
            "jpegThumbnail": "/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wAARCAAqACADASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAgQFAwYA/8QAJxAAAgEDAgYCAwEAAAAAAAAAAQIDAAQREyEFEjFBUWEigTKRobH/xAAXAQEBAQEAAAAAAAAAAAAAAAACAwAB/8QAHREBAAIDAQADAAAAAAAAAAAAAQACAxESISIxsf/aAAwDAQACEQMRAD8Aiafqt0t49ASuJDl9NVUdWPQZo9OqXCEeQtAIBImdTmY7IcY/oNV6K/JNw634RE8NZrsWmkUljjLuR887ZGMfqkdP1Ve14k0dzfXT4BYrGkYbJDLkDPrv4pNlLsWY5Zjkn3SuaZhjWnTaXTWHDWlhVXl1McpONjgf7XlhLHCgk+BQXVrIYD8SvcFhscUalVC31OKhskyytlaNZ3GZGJJP3TenWVncwR2kYZuUBep70+EDAEbg7g1XNWxZ6hoieRpXkikyqLycpBIPy+j2qbccTkli5WJ6EKAp6Hznv7qvQk1OnNXablG1mvJ+Tk441nntYX/FRiQgHGBXSLJFgBenYCtcb0WB4FPLlcj7J1rzP//Z",
            "contextInfo": {}
        }
    },
    "contextInfo": {},
    "messageType": "imageMessage",
    "messageTimestamp": 1732228547,
    "instanceId": "a593600e-e145-43f4-8be9-b281ed63bcf8",
    "source": "unknown"
}
</code></pre>

{% endtab %}

{% tab title="404" %}

```json
{
    "status": 404,
    "error": "Not Found",
    "response": {
        "message": [
            "The \"82\" instance does not exist"
        ]
    }
}
```

{% 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://wazends-organization.gitbook.io/wazend/enviar-mensajes/enviar-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.
