Skip to navigation

Create a WhatsAppMessage activity

View as Markdown

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. 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. 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.

Authentication

AuthorizationBasic
Use your API key as the username and leave the password empty.
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Query parameters

send_to_inboxbooleanOptional

Request

This endpoint expects an object.
activity_atdatetimeRequired
contact_idstringRequired
directionenumRequired

Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite.

Allowed values:
external_whatsapp_message_idstringRequired
lead_idstringRequired
local_phonestringRequired
message_markdownstringRequired
remote_phonestringRequired
attachmentslist of objectsOptional
response_to_idstring or nullOptional
user_idstring or nullOptional

Response

Successful response
_typestring

Type of the activity, e.g. Call, Email or Note.

activity_atdatetime or null

When the activity happened, e.g. when an Email or SMS was sent. Defaults to date_created.

contact_idstring or null

ID of the Contact the activity is with, or null if it isn’t with a particular Contact.

created_bystring or null

ID of the user who created the activity, or null if it wasn’t created by a user.

date_createddatetime
When the activity was created.
date_updateddatetime
When the activity was last updated.
directionenum

Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite.

Allowed values:
external_whatsapp_message_idstring
idstring

ID of the activity, e.g. acti_abc123.

integration_namestring or null
lead_idstring or null

ID of the Lead the activity is on. Can be null for Calls and SMS with phone numbers that don’t match any Contact.

local_phonestring
local_phone_formattedstring
message_htmlstring
message_markdownstring
organization_idstring
ID of the organization the activity belongs to.
remote_phonestring
remote_phone_formattedstring
response_to_idstring or null
sourceenum

How the object was created, e.g. ui in the Close app, api through the API, import by a bulk import, or by an integration.

textstring
updated_bystring or null

ID of the user who last updated the activity, or null if it wasn’t updated by a user.

user_idstring or null

ID of the user the activity belongs to, e.g. who made the Call or sent the Email. Can be null, e.g. for an incoming SMS to a group number.

userslist of strings
IDs of all users the activity is associated with, e.g. every Close user on an Email Thread or invited to a Meeting.
attachmentslist of objectsOptional
created_by_namestring or nullOptional

Name of the user in created_by.

sequence_idstring or nullOptional

ID of the Workflow that created the activity, or null.

sequence_namestring or nullOptional

Name of the Workflow in sequence_id.

sequence_subscription_idstring or nullOptional

ID of the Workflow subscription, i.e. the Contact’s enrollment in the Workflow, that created the activity, or null.

updated_by_namestring or nullOptional

Name of the user in updated_by.

user_namestring or nullOptional

Name of the user in user_id.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error