---
title: "Create a WhatsAppMessage activity"
method: POST
path: "/activity/whatsapp_message/"
tags: ["activities.whatsapp_messages"]
---

# Create a WhatsAppMessage activity

`POST /activity/whatsapp_message/`

`external_whatsapp_message_id` must be the ID of the message inside WhatsApp. You can filter by this field to find messages in Close to update or delete based on updates or deletions in WhatsApp.

`message_markdown` must be the body of the message in the WhatsApp Markdown format. The `message_html` read-only field will return the HTML representation of this message.

To include an attachment, you must first upload the file to Close using the [Files API](https://developer.close.com/api/resources/files). Then, add an object to the `attachments` array with the following fields: `url`, `filename`, and `content_type`. The `url` should be the URL provided in the `download.url` field of the response from the [Files API](https://developer.close.com/api/resources/files). It must begin with `https://app.close.com/go/file/`.

`integration_link` (optional) is a URL string that can be provided by the integration partner creating the WhatsApp message. This can be used to link back to the message in the external system.

`response_to_id` (optional) is the Close activity ID of another WhatsApp message activity (not the WhatsApp native message ID) that this message is replying to. This field creates a thread relationship between messages, allowing you to track conversation flow and message replies within WhatsApp threads. The ID must be a valid WhatsApp message activity ID in Close (e.g., `acti_...`).

Only WhatsApp Markdown messages and file attachments are supported. No support is provided for Polls, Events, Locations, etc.

**Important**: The total size of all attachments for a single WhatsApp message activity cannot exceed 25MB.

When creating a new WhatsApp message with the direction set to `incoming`, you can pass the query parameter `send_to_inbox` with the value of `true` to create a corresponding Inbox Notification for the message.

## Query parameters

- `send_to_inbox` boolean

## Request body

- CreateWhatsAppMessage
  - `activity_at` string, date-time, required
  - `attachments` WhatsAppAttachmentData[]
    - `content_type` string, required
    - `filename` string, required
    - `url` string, required
  - `contact_id` string, required
  - `direction` 'incoming' | 'outgoing', required — Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite.
  - `external_whatsapp_message_id` string, required
  - `integration_link` string, uri, nullable
  - `lead_id` string, required
  - `local_phone` string, required
  - `message_markdown` string, required
  - `remote_phone` string, required
  - `response_to_id` string, nullable
  - `user_id` string, nullable

## Response `200`

Successful response

- WhatsAppMessageActivity
  - `_type` string, required
  - `activity_at` string, date-time, nullable, required
  - `attachments` Attachment[]
    - `content_type` string, nullable, required
    - `filename` string, nullable, required
    - `size` integer, nullable, required
    - `thumbnail_url` string, nullable
    - `url` string, required
  - `contact_id` string, nullable, required
  - `created_by` string, nullable, required
  - `created_by_name` string, nullable
  - `date_created` string, date-time, required
  - `date_updated` string, date-time, required
  - `direction` 'incoming' | 'outgoing', required — Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite.
  - `external_whatsapp_message_id` string, required
  - `id` string, required
  - `integration_link` string, nullable, required
  - `integration_name` string, nullable, required
  - `lead_id` string, nullable, required
  - `local_phone` string, required
  - `local_phone_formatted` string, required
  - `message_html` string, required
  - `message_markdown` string, required
  - `organization_id` string, required
  - `remote_phone` string, required
  - `remote_phone_formatted` string, required
  - `response_to_id` string, nullable, required
  - `sequence_id` string, nullable
  - `sequence_name` string, nullable
  - `sequence_subscription_id` string, nullable
  - `source` 'ui' | 'api' | 'import' | 'clipper' | 'email' | 'suggestion' | 'segment-integration' | 'customerio-integration' | 'calendly-integration' | 'ai' | 'whatsapp' | 'webform', required
  - `text` string, required
  - `updated_by` string, nullable, required
  - `updated_by_name` string, nullable
  - `user_id` string, nullable, required
  - `user_name` string, nullable
  - `users` string[], required

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found

---

[API](https://skmtc.net/close/apis/close-api.md) · [All operations](https://skmtc.net/close/apis/close-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/close/close-api/revisions/0dcf3303e9d7/schema)
