WhatsApp · Arazzo Workflow

WhatsApp Upload and Send Document

Version 1.0.0

Upload a document file and send it to a recipient with a display filename.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub ArazzoWorkflows

Provider

whatsapp

Workflows

upload-media-send-document
Upload a document and deliver it to a WhatsApp user as a document message.
Uploads a document file to obtain a media ID, then sends a document message referencing that media ID with the supplied display filename and caption.
2 steps inputs: accessToken, caption, file, fileType, filename, phoneNumberId, to outputs: mediaId, messageId
1
uploadDocument
Upload the binary document file to the WhatsApp media endpoint to obtain a reusable media ID.
2
sendDocument
Send a document message to the recipient referencing the uploaded media ID with the supplied display filename.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: WhatsApp Upload and Send Document
  summary: Upload a document file and send it to a recipient with a display filename.
  description: >-
    Delivers a file such as a PDF invoice or receipt to a WhatsApp user. The
    workflow uploads the binary document to the WhatsApp media store to obtain a
    reusable media ID, then sends a document message that references that media
    ID along with the filename the recipient should see and an optional caption.
    Every step spells out its request inline so the flow can be read and executed
    without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: mediaApi
  url: ../openapi/whatsapp-media-api-openapi.yml
  type: openapi
- name: messagesApi
  url: ../openapi/whatsapp-messages-api-openapi.yml
  type: openapi
workflows:
- workflowId: upload-media-send-document
  summary: Upload a document and deliver it to a WhatsApp user as a document message.
  description: >-
    Uploads a document file to obtain a media ID, then sends a document message
    referencing that media ID with the supplied display filename and caption.
  inputs:
    type: object
    required:
    - accessToken
    - phoneNumberId
    - to
    - file
    - fileType
    - filename
    properties:
      accessToken:
        type: string
        description: Access token with whatsapp_business_messaging permission.
      phoneNumberId:
        type: string
        description: The WhatsApp phone number ID that sends the message.
      to:
        type: string
        description: Recipient phone number in E.164 format without the leading plus.
      file:
        type: string
        description: The binary document file content to upload.
      fileType:
        type: string
        description: MIME type of the document (e.g. application/pdf).
      filename:
        type: string
        description: Filename to display to the recipient.
      caption:
        type: string
        description: Optional caption text to display with the document.
  steps:
  - stepId: uploadDocument
    description: >-
      Upload the binary document file to the WhatsApp media endpoint to obtain a
      reusable media ID.
    operationId: uploadMedia
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: phone-number-id
      in: path
      value: $inputs.phoneNumberId
    requestBody:
      contentType: multipart/form-data
      payload:
        file: $inputs.file
        type: $inputs.fileType
        messaging_product: whatsapp
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      mediaId: $response.body#/id
  - stepId: sendDocument
    description: >-
      Send a document message to the recipient referencing the uploaded media ID
      with the supplied display filename.
    operationId: sendMessage
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.accessToken
    - name: phone-number-id
      in: path
      value: $inputs.phoneNumberId
    requestBody:
      contentType: application/json
      payload:
        messaging_product: whatsapp
        recipient_type: individual
        to: $inputs.to
        type: document
        document:
          id: $steps.uploadDocument.outputs.mediaId
          filename: $inputs.filename
          caption: $inputs.caption
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      messageId: $response.body#/messages/0/id
  outputs:
    mediaId: $steps.uploadDocument.outputs.mediaId
    messageId: $steps.sendDocument.outputs.messageId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/whatsapp-upload-media-send-document-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.