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

# Send a message

> **Protocols:** Linked Device API · Meta Cloud API

**Required scope:** `messages:write`



## OpenAPI

````yaml api-reference/features/communicate-graph.json POST /graph/whatsapp/{version}/{phoneNumberId}/messages
openapi: 3.0.3
info:
  title: Communicate Polymorfa Graph API methods
  version: 1.0.0
  description: Task-focused communicate methods exposed by the Polymorfa Graph API.
servers: []
security: []
paths:
  /graph/whatsapp/{version}/{phoneNumberId}/messages:
    post:
      tags:
        - Messages
      summary: Send a message
      description: |-
        **Protocols:** Linked Device API · Meta Cloud API

        **Required scope:** `messages:write`
      operationId: graphSendMessage
      parameters:
        - schema:
            type: string
            example: v21.0
          required: true
          name: version
          in: path
          description: Specifies version for this path parameter.
        - schema:
            type: string
            example: '123456789012345'
          required: true
          name: phoneNumberId
          in: path
          description: Identifier for the phone number.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/graph__GraphSendMessageRequest'
      responses:
        '200':
          description: Message sent, or status update accepted
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/graph__GraphSendMessageResponse'
                  - $ref: '#/components/schemas/graph__GraphSuccessResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '403':
          description: Permission error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '404':
          description: Object does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/graph__GraphError'
      security:
        - graph__BearerAuth: []
      servers:
        - url: https://api.polymorfa.com
components:
  schemas:
    graph__GraphSendMessageRequest:
      type: object
      properties:
        messaging_product:
          type: string
          example: whatsapp
          description: Messaging product associated with this Graph API object.
        recipient_type:
          type: string
          description: Category assigned to recipient.
        to:
          type: string
          example: '15551234567'
          description: Specifies to for this graph graph send message request.
        type:
          type: string
          enum:
            - text
            - image
            - video
            - document
            - audio
            - sticker
            - location
            - contacts
            - reaction
            - interactive
            - template
          description: |-
            Type discriminator for this object.

            <!-- polymorfa-input-table -->
            **Allowed values**
            | Value | Meaning |
            | --- | --- |
            | `text` | Text. |
            | `image` | Image. |
            | `video` | Video. |
            | `document` | Document. |
            | `audio` | Audio. |
            | `sticker` | Sticker. |
            | `location` | Location. |
            | `contacts` | Contacts. |
            | `reaction` | Reaction. |
            | `interactive` | Interactive. |
            | `template` | Template. |
        text:
          type: object
          properties:
            body:
              type: string
              description: Primary text content shown to the recipient.
            preview_url:
              type: boolean
              description: >-
                Whether WhatsApp renders a link preview for URLs in the text
                message.
          description: Text content carried by this object.
        image:
          type: object
          properties:
            id:
              type: string
              description: Identifier for this resource.
            link:
              type: string
              description: Link associated with this resource.
            caption:
              type: string
              description: Caption shown with the attached media.
            filename:
              type: string
              description: Filename presented for the media attachment.
            voice:
              type: boolean
              description: >-
                Whether WhatsApp treats this media payload as a push-to-talk
                voice message; set this only for audio attachments.
          description: Image attached to or representing this resource.
        video:
          type: object
          properties:
            id:
              type: string
              description: Identifier for this resource.
            link:
              type: string
              description: Link associated with this resource.
            caption:
              type: string
              description: Caption shown with the attached media.
            filename:
              type: string
              description: Filename presented for the media attachment.
            voice:
              type: boolean
              description: >-
                Whether WhatsApp treats this media payload as a push-to-talk
                voice message; set this only for audio attachments.
          description: Structured video values for this graph graph send message request.
        document:
          type: object
          properties:
            id:
              type: string
              description: Identifier for this resource.
            link:
              type: string
              description: Link associated with this resource.
            caption:
              type: string
              description: Caption shown with the attached media.
            filename:
              type: string
              description: Filename presented for the media attachment.
            voice:
              type: boolean
              description: >-
                Whether WhatsApp treats this media payload as a push-to-talk
                voice message; set this only for audio attachments.
          description: >-
            Structured document values for this graph graph send message
            request.
        audio:
          type: object
          properties:
            id:
              type: string
              description: Identifier for this resource.
            link:
              type: string
              description: Link associated with this resource.
            caption:
              type: string
              description: Caption shown with the attached media.
            filename:
              type: string
              description: Filename presented for the media attachment.
            voice:
              type: boolean
              description: >-
                Whether WhatsApp treats this media payload as a push-to-talk
                voice message; set this only for audio attachments.
          description: Structured audio values for this graph graph send message request.
        sticker:
          type: object
          properties:
            id:
              type: string
              description: Identifier for this resource.
            link:
              type: string
              description: Link associated with this resource.
            caption:
              type: string
              description: Caption shown with the attached media.
            filename:
              type: string
              description: Filename presented for the media attachment.
            voice:
              type: boolean
              description: >-
                Whether WhatsApp treats this media payload as a push-to-talk
                voice message; set this only for audio attachments.
          description: Structured sticker values for this graph graph send message request.
        location:
          type: object
          properties:
            latitude:
              type: number
              description: Latitude in decimal degrees.
            longitude:
              type: number
              description: Longitude in decimal degrees.
            name:
              type: string
              description: Human-readable name for this resource.
            address:
              type: string
              description: Specifies address for this location.
          description: >-
            Structured location values for this graph graph send message
            request.
        contacts:
          type: array
          items:
            nullable: true
          description: |-
            Contact cards to send in this message.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Item alternative | Accepted input |
            | --- | --- |
            | Item alternative 1 | Any JSON value matching this alternative |
            | Item alternative 2 | `null` |
        reaction:
          type: object
          properties:
            message_id:
              type: string
              description: Identifier for the message.
            emoji:
              type: string
              description: Specifies emoji for this reaction.
          description: Reaction applied to the referenced message.
        interactive:
          nullable: true
          description: |-
            Specifies interactive for this graph graph send message request.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Any JSON value matching this alternative |
            | Alternative 2 | `null` |
        template:
          nullable: true
          description: |-
            Specifies template for this graph graph send message request.

            <!-- polymorfa-input-table -->
            **Accepted alternatives**
            | Alternative | Accepted input |
            | --- | --- |
            | Alternative 1 | Any JSON value matching this alternative |
            | Alternative 2 | `null` |
        context:
          type: object
          properties:
            message_id:
              type: string
              description: Identifier for the message.
          required:
            - message_id
          description: Structured context values for this graph graph send message request.
        status:
          type: string
          example: read
          description: Message delivery status to report to WhatsApp.
        message_id:
          type: string
          description: Identifier for the message.
        typing_indicator:
          nullable: true
          description: >-
            Specifies typing indicator for this graph graph send message
            request.


            <!-- polymorfa-input-table -->

            **Accepted alternatives**

            | Alternative | Accepted input |

            | --- | --- |

            | Alternative 1 | Any JSON value matching this alternative |

            | Alternative 2 | `null` |
      required:
        - messaging_product
    graph__GraphSendMessageResponse:
      type: object
      properties:
        messaging_product:
          type: string
          example: whatsapp
          description: Messaging product associated with this Graph API object.
        contacts:
          type: array
          items:
            type: object
            properties:
              input:
                type: string
                description: Specifies input for this contact.
              wa_id:
                type: string
                description: Identifier for the wa.
            required:
              - input
              - wa_id
          description: Contacts returned or affected by this operation.
        messages:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Identifier for this resource.
            required:
              - id
          description: Messages associated with this graph graph send message response.
      required:
        - messaging_product
        - contacts
        - messages
    graph__GraphSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the request succeeded.
      required:
        - success
    graph__GraphError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable message associated with this result.
            type:
              type: string
              description: Type discriminator for this object.
            code:
              type: number
              description: Stable machine-readable code for this result.
            error_subcode:
              type: number
              description: Machine-readable error subcode for this error.
            error_data:
              nullable: true
              description: |-
                Specifies error data for this error.

                <!-- polymorfa-input-table -->
                **Accepted alternatives**
                | Alternative | Accepted input |
                | --- | --- |
                | Alternative 1 | Any JSON value matching this alternative |
                | Alternative 2 | `null` |
            fbtrace_id:
              type: string
              description: Identifier for the fbtrace.
          required:
            - message
            - type
            - code
            - fbtrace_id
          description: Error details returned when the operation fails.
      required:
        - error
  securitySchemes:
    graph__BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Polymorfa organization key (pmfa_ prefix) or project token (pmfa_pt_
        prefix). Client tokens are not accepted by Graph operations.

````