Handle read status
Learn how to mark Instagram chats as read or unread with Unipile API.
Instagram supports marking messages as read, and chats as read or unread, through the messaging endpoints.
Mark a message as read
To mark a message as read, use Read a Message and provide the chat ID together with the message ID.
await messagingApi.readMessage({
path: {
account_id: "acc_123456789",
chat_id: "chat_id",
message_id: "message_id",
},
});messaging_api.read_message(
"chat_id",
"message_id",
"acc_123456789",
)curl --request POST \
--url https://api.unipile.com/v2/account_id/chats/chat_id/messages/message_id/read \
--header 'accept: application/json'Mark a chat as read
To mark a chat as read, use Update a Chat and set read_status to true.
await messagingApi.updateChat({
path: {
account_id: "acc_123456789",
chat_id: "chat_id",
},
body: {
read_status: true,
},
});messaging_api.update_chat(
"chat_id",
"acc_123456789",
{"read_status": True},
)curl --request PATCH \
--url https://api.unipile.com/v2/account_id/chats/chat_id \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"read_status":true}'Mark a chat as unread
To mark a chat as unread, use Update a Chat and set read_status to false.
await messagingApi.updateChat({
path: {
account_id: "acc_123456789",
chat_id: "chat_id",
},
body: {
read_status: false,
},
});messaging_api.update_chat(
"chat_id",
"acc_123456789",
{"read_status": False},
)curl --request PATCH \
--url https://api.unipile.com/v2/account_id/chats/chat_id \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"read_status":false}'Realtime event
To receive read receipts in real time, configure a webhook and listen to message.receipt.read.
Updated about 1 month ago