> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wazzapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Document Message

> Send a document/file message.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/messages/send/document
openapi: 3.1.0
info:
  title: wazzapi Public API
  description: >-
    Public API surface for external API-key clients. Only stable /api/v1
    endpoints are included.


    ## Webhook deliveries

    This reference also includes the webhook requests Wazzapi sends to your
    endpoint for incoming messages, message status updates, and device status
    changes. See the `Incoming webhooks` section in the sidebar for headers,
    payload fields, and concrete examples.
  version: 1.0.0
servers: []
security: []
tags:
  - name: Incoming webhooks
    description: >-
      POST deliveries that Wazzapi sends to your webhook endpoint after you
      subscribe to supported events. Verify the signature against the raw body
      and return a 2xx response quickly.
paths:
  /api/v1/messages/send/document:
    post:
      tags:
        - messages
      summary: Send Document Message
      description: Send a document/file message.
      operationId: send_document_message_api_v1_messages_send_document_post
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMessageRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SendMessageRequest:
      properties:
        phone_number:
          type: string
          maxLength: 50
          minLength: 5
          title: Phone Number
          description: Recipient phone number in E.164 or local WhatsApp format.
        content:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Content
          description: Message text body. Required unless template_id supplies the content.
        template_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Template Id
        custom_variables:
          additionalProperties:
            type: string
          type: object
          title: Custom Variables
          description: Template variables merged into the outgoing content before queueing.
        message_type:
          type: string
          title: Message Type
          description: >-
            Outbound object type. Supported values: text, image, video, voice,
            document, location, contact.
          default: text
        media_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Type
          description: >-
            Optional media type hint, typically image, video, document, or
            audio.
        media_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Url
          description: Publicly fetchable URL for media/document payloads.
        media_base64:
          anyOf:
            - type: string
            - type: 'null'
          title: Media Base64
          description: >-
            Base64-encoded media content or data URI (data:…;base64,…). Takes
            precedence over media_url when both are provided.
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
          description: >-
            Filename for document sends. Required when media_base64 is used for
            documents. If not provided for URL-based sends, it is inferred from
            the URL path.
        mimetype:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
          description: >-
            MIME type hint (e.g. 'image/png', 'application/pdf'). Required when
            media_base64 is raw base64 (not a data URI). If omitted, guessed
            from filename or defaults to 'application/octet-stream'.
        caption:
          anyOf:
            - type: string
            - type: 'null'
          title: Caption
          description: Optional caption for image, video, and document messages.
        latitude:
          anyOf:
            - type: number
            - type: 'null'
          title: Latitude
          description: Latitude for location messages.
        longitude:
          anyOf:
            - type: number
            - type: 'null'
          title: Longitude
          description: Longitude for location messages.
        location_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Title
          description: Display label sent with a location pin.
        location_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Address
          description: Optional address or fallback label for location messages.
        contacts:
          anyOf:
            - items:
                additionalProperties:
                  type: string
                type: object
              type: array
            - type: 'null'
          title: Contacts
          description: >-
            Contact cards for contact messages. The first item is serialized to
            a vCard for delivery.
        whatsapp_account_id:
          type: string
          format: uuid
          title: Whatsapp Account Id
        contact_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Contact Id
        scheduled_for:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Scheduled For
          description: >-
            Optional future delivery time. When set, the API returns
            status=scheduled instead of queueing immediately.
        validate_phone:
          type: boolean
          title: Validate Phone
          description: >-
            When true, validate the destination phone before accepting the
            request.
          default: true
        status_callback_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Callback Url
          description: Reserved callback URL for downstream status delivery integrations.
      type: object
      required:
        - phone_number
        - whatsapp_account_id
      title: SendMessageRequest
      description: Request to send a direct message.
      examples:
        - content: Hi {{firstName}}, your order is ready.
          custom_variables:
            firstName: Rani
          message_type: text
          phone_number: '6281234567890'
          validate_phone: true
          whatsapp_account_id: c053d8ef-6c19-4ecb-9cc5-a4a64be79d92
        - caption: April invoice
          content: Invoice attached
          media_type: document
          media_url: https://example.com/files/invoice.pdf
          message_type: document
          phone_number: '6281234567890'
          whatsapp_account_id: c053d8ef-6c19-4ecb-9cc5-a4a64be79d92
        - content: Store location
          latitude: -6.208763
          location_address: Central Jakarta
          location_title: Jakarta HQ
          longitude: 106.845599
          message_type: location
          phone_number: '6281234567890'
          whatsapp_account_id: c053d8ef-6c19-4ecb-9cc5-a4a64be79d92
        - contacts:
            - fullName: Wazzapi Support
              organization: Wazzapi
              phoneNumber: '6281234567890'
          content: Main contact
          message_type: contact
          phone_number: '6281234567890'
          whatsapp_account_id: c053d8ef-6c19-4ecb-9cc5-a4a64be79d92
    SendMessageResponse:
      properties:
        success:
          type: boolean
          title: Success
        message_id:
          type: string
          format: uuid
          title: Message Id
        status:
          type: string
          title: Status
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Id
      type: object
      required:
        - success
        - message_id
        - status
      title: SendMessageResponse
      description: Response from sending a message.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````