Mark WhatsApp message as read
curl --request PATCH \
--url https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read \
--header 'X-API-Key: <api-key>'import requests
url = "https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read"
headers = {"X-API-Key": "<api-key>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {'X-API-Key': '<api-key>'}};
fetch('https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "msg-123abc",
"phone_number": "+1234567890",
"message_type": "text",
"content": "Hello",
"direction": "inbound",
"status": "read",
"whatsapp_message_id": "wamid.HBgLMTIzNDU2Nzg5MAUCAw==",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:31:00Z"
}
}{
"error": "Can only mark inbound messages as read"
}{
"error": "Resource not found",
"status": 404,
"message": "The requested resource could not be found"
}{
"error": "WhatsApp message not found"
}WhatsApp Messages
Mark WhatsApp message as read
Marks an inbound WhatsApp message as read and syncs the status with WhatsApp API.
Key Features:
- Only inbound messages can be marked as read
- Optimistically updates local status for immediate feedback
- Asynchronously syncs with WhatsApp API via background job
- Skips messages already marked as read
- Supports optional typing indicator control
Sandbox Mode: Messages from sandbox conversations (no WhatsApp config) are handled appropriately with sandbox-specific processing.
PATCH
/
whatsapp_messages
/
{id}
/
mark_as_read
Mark WhatsApp message as read
curl --request PATCH \
--url https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read \
--header 'X-API-Key: <api-key>'import requests
url = "https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read"
headers = {"X-API-Key": "<api-key>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {'X-API-Key': '<api-key>'}};
fetch('https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.kapso.ai/api/v1/whatsapp_messages/{id}/mark_as_read")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "msg-123abc",
"phone_number": "+1234567890",
"message_type": "text",
"content": "Hello",
"direction": "inbound",
"status": "read",
"whatsapp_message_id": "wamid.HBgLMTIzNDU2Nzg5MAUCAw==",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:31:00Z"
}
}{
"error": "Can only mark inbound messages as read"
}{
"error": "Resource not found",
"status": 404,
"message": "The requested resource could not be found"
}{
"error": "WhatsApp message not found"
}Authorizations
API key required for all endpoints
Path Parameters
The ID of the WhatsApp message to mark as read
Query Parameters
Whether to show typing indicator in WhatsApp (defaults to true)
Response
Message successfully marked as read
Show child attributes
Show child attributes

