---
title: "Downloads a file from a URL and sends it to a chat"
method: POST
path: "/api/messages/sendFileFromUrl"
tags: ["messages"]
---

# Downloads a file from a URL and sends it to a chat

`POST /api/messages/sendFileFromUrl`

Downloads a file from a URL and sends it to a chat

## Request body

- object
  - `to` string, required — Recipient chat ID
  - `url` string, uri, required — URL of the file to download
  - `filename` string, required — Filename for the sent file
  - `caption` string — Caption for the file
  - `headers` object — HTTP headers for the download request

## Response `200`

Successful response

- union — Message ID or success status
  - string
  - boolean

## Other responses

- `400` — Validation error
- `500` — Internal server error

---

[API](https://skmtc.net/open-wa/apis/open-wa-api.md) · [All operations](https://skmtc.net/open-wa/apis/open-wa-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/open-wa/open-wa-api/versions/2f344d03d2a9/schema)
