---
title: "Send document message"
method: POST
path: "/messages/document"
tags: ["Messages"]
---

# Send document message

`POST /messages/document`

Provide either `id`, for a media previously uploaded through `POST /messages/upload-media`, or `link`, a public URL WhatsApp can download from.

Requires an open service window: the recipient must have messaged the business in the last 24 hours. Use `POST /messages/template` to reach recipients outside that window.

## Request body

- object
  - `from` string, required — WhatsApp id of the sender phone number
  - `to` string, required — Recipient phone number, digits only, including country code
  - `document` object — The document to send. Provide either `id` or `link`
    - `id` string — Id of a media uploaded through `POST /messages/upload-media`
    - `link` string, uri — Public URL of the media
    - `caption` string — Caption shown with the document
    - `filename` string — File name shown to the recipient

## Response `200`

Message sent successfully

- object
  - `id` string, uuid, required — Id of the created message

## Other responses

- `400` — Bad request — invalid input data, or the message was rejected by the WhatsApp Cloud API (e.g. invalid template)
- `401` — Unauthorized
- `404` — Sender phone number not found or not linked to a WhatsApp Business Account

## Changes

- **2026-08-07** `30bd33ee45c9` — 3 info
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `401`
  - added the media type `application/json` for the response with the status `404`
- **2026-07-28** `8ccfb9a461e2` — 4 breaking, 6 info
  - request body became required
  - the `from` request property's minLength was increased from `0` to `1`
  - the `to` request property's minLength was increased from `0` to `1`
  - the `document/link` request property type/format changed from `string`/`` to `string`/`uri`
  - …6 more

[Change history](https://skmtc.dev/indigohive/apis/cogfy-messenger-public-api/changes/messages/document/post.md)

---

[API](https://skmtc.dev/indigohive/apis/cogfy-messenger-public-api.md) · [All operations](https://skmtc.dev/indigohive/apis/cogfy-messenger-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/indigohive/cogfy-messenger-public-api/revisions/30bd33ee45c9/schema)
