Messages

Send document message

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.

post/messages/document

Request body

fromstring required

WhatsApp id of the sender phone number

tostring required

Recipient phone number, digits only, including country code

Response

Message sent successfully

idstring uuid required

Id of the created message

Changes

Changed in 2 of the 9 revisions of this API.49

    • added the media type application/json for the response with the status 400

      response-media-type-added

    • added the media type application/json for the response with the status 401

      response-media-type-added

    • added the media type application/json for the response with the status 404

      response-media-type-added

  • 8ccfb9a461e246See the full diff
    • request body became required

      request-body-became-required

    • the from request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • the to request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • the document/link request property type/format changed from string/ to string/uri

      request-property-type-changed

    • the request property document became optional

      request-property-became-optional

    • added the non-success response with the status 400

      response-non-success-status-added

    • added the non-success response with the status 401

      response-non-success-status-added

    • added the non-success response with the status 404

      response-non-success-status-added

    • the response property id became required for the status 200

      response-property-became-required

    • the id response's property pattern ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$ was added for the status 200

      response-property-pattern-added