> For a complete page index, fetch https://developer.close.com/llms.txt # Update a WhatsAppMessage activity PUT https://api.close.com/api/v1/activity/whatsapp_message/{id}/ Content-Type: application/json Reference: https://developer.close.com/api/resources/activities/whatsapp/update ## Authentication - `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty. - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `id` (string, required) ### Body (application/json) This endpoint expects an UpdateWhatsAppMessage. - `activity_at` (datetime, optional) - `attachments` (list of WhatsAppAttachmentData, optional) - `contact_id` (string, optional) - `direction` (enum, optional) — Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite. - Allowed values: `incoming`, `outgoing` - `integration_link` (string, optional, nullable) - `local_phone` (string, optional) - `message_markdown` (string, optional) - `remote_phone` (string, optional) - `response_to_id` (string, optional, nullable) - `user_id` (string, optional) ## Response ### 200 Successful response - `_type` (string, required) - `activity_at` (datetime, required, nullable) - `contact_id` (string, required, nullable) - `created_by` (string, required, nullable) - `date_created` (datetime, required) - `date_updated` (datetime, required) - `direction` (enum, required) — Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite. - Allowed values: `incoming`, `outgoing` - `external_whatsapp_message_id` (string, required) - `id` (string, required) - `integration_link` (string, required, nullable) - `integration_name` (string, required, nullable) - `lead_id` (string, required, nullable) - `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, required, nullable) - `source` (enum, required) - Allowed values: `ui`, `api`, `import`, `clipper`, `email`, `suggestion`, `segment-integration`, `customerio-integration`, `calendly-integration`, `ai`, `whatsapp`, `webform` - `text` (string, required) - `updated_by` (string, required, nullable) - `user_id` (string, required, nullable) - `users` (list of string, required) - `attachments` (list of Attachment, optional) - `created_by_name` (string, optional, nullable) - `sequence_id` (string, optional, nullable) - `sequence_name` (string, optional, nullable) - `sequence_subscription_id` (string, optional, nullable) - `updated_by_name` (string, optional, nullable) - `user_name` (string, optional, nullable) ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Types ### WhatsAppAttachmentData - `content_type` (string, required) - `filename` (string, required) - `url` (string, required) ### Attachment - `content_type` (string, required, nullable) - `filename` (string, required, nullable) - `size` (integer, required, nullable) - `url` (string, required) - `thumbnail_url` (string, optional, nullable) ## Examples **Request** ```json { "message_markdown": "Updated content." } ``` **Response** ```json { "_type": "WhatsAppMessage", "activity_at": "2013-02-20T06:39:57.266000+00:00", "contact_id": "cont_q4xYmlGhA3060dEl0NDJuHRxPMuVjqLn30AFSzh1fRk", "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "date_created": "2013-02-20T06:39:57.266000+00:00", "date_updated": "2013-02-20T06:41:59.846000+00:00", "direction": "outgoing", "external_whatsapp_message_id": "1234567890", "id": "acti_kwWA3rOfy4BnaZ8QQk3RIIAz51dU9ayiluy1s961Oiw", "integration_link": null, "integration_name": "API", "lead_id": "lead_s6vHFTK1TSRoH6otXOexWDO9jM4xyb1kELHDoU7Fdsp", "local_phone": "+16503334444", "local_phone_formatted": "+1 650-333-444", "message_html": "

Updated content.

", "message_markdown": "Updated content.", "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "remote_phone": "+18183004000", "remote_phone_formatted": "+1 818-300-4000", "response_to_id": null, "source": "api", "text": "test", "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "users": [], "attachments": [], "created_by_name": "Bruce Wayne", "updated_by_name": "Bruce Wayne", "user_name": "Bruce Wayne" } ``` **SDK Code** ```python activities.whatsapp_messages_update_example import requests url = "https://api.close.com/api/v1/activity/whatsapp_message/id/" payload = { "message_markdown": "Updated content." } headers = { "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers, auth=("", "")) print(response.json()) ``` ```javascript activities.whatsapp_messages_update_example const url = 'https://api.close.com/api/v1/activity/whatsapp_message/id/'; const credentials = btoa(":"); const options = { method: 'PUT', headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'}, body: '{"message_markdown":"Updated content."}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go activities.whatsapp_messages_update_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/activity/whatsapp_message/id/" payload := strings.NewReader("{\n \"message_markdown\": \"Updated content.\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.SetBasicAuth("", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby activities.whatsapp_messages_update_example require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/activity/whatsapp_message/id/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request.basic_auth("", "") request["Content-Type"] = 'application/json' request.body = "{\n \"message_markdown\": \"Updated content.\"\n}" response = http.request(request) puts response.read_body ``` ```java activities.whatsapp_messages_update_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.close.com/api/v1/activity/whatsapp_message/id/") .basicAuth("", "") .header("Content-Type", "application/json") .body("{\n \"message_markdown\": \"Updated content.\"\n}") .asString(); ``` ```php activities.whatsapp_messages_update_example request('PUT', 'https://api.close.com/api/v1/activity/whatsapp_message/id/', [ 'body' => '{ "message_markdown": "Updated content." }', 'headers' => [ 'Content-Type' => 'application/json', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp activities.whatsapp_messages_update_example using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/activity/whatsapp_message/id/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"message_markdown\": \"Updated content.\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ```