Skip to content

Commit 360cf19

Browse files
authored
Support mark as read by token API (#115)
## Support for "Mark as Read" by Token API We have released a new **Mark as Read API** that allows developers to mark a user’s messages as read. Previously, this functionality was available only to partners, but it is now publicly available. When your server receives a user message via Webhook, the `MessageEvent` will include a new field: `markAsReadToken`. By calling the Mark as Read API with this token, all messages in the chat room **up to and including** that message will be marked as read. > **Note:** This feature assumes that your service uses the chat feature through Official Account Manager. > If chat is not enabled, messages from users are automatically marked as read, making this API unnecessary. For more details, please refer to the release note: https://developers.line.biz/en/news/2025/11/05/mark-as-read/
1 parent 9488f69 commit 360cf19

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

messaging-api.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,6 +2109,32 @@ paths:
21092109
schema:
21102110
"$ref": "#/components/schemas/ErrorResponse"
21112111

2112+
"/v2/bot/chat/markAsRead":
2113+
post:
2114+
externalDocs:
2115+
url: https://developers.line.biz/en/reference/messaging-api/#mark-as-read
2116+
tags:
2117+
- messaging-api
2118+
operationId: markMessagesAsReadByToken
2119+
description: "Mark messages from users as read by token"
2120+
requestBody:
2121+
content:
2122+
application/json:
2123+
schema:
2124+
"$ref": "#/components/schemas/MarkMessagesAsReadByTokenRequest"
2125+
example:
2126+
markAsReadToken: nz0x74mZT2mRn...
2127+
required: true
2128+
responses:
2129+
"200":
2130+
description: "OK"
2131+
"400":
2132+
description: "An invalid markAsReadToken is specified. Tokens must be used by the bot that received them via Webhook."
2133+
content:
2134+
"application/json":
2135+
schema:
2136+
"$ref": "#/components/schemas/ErrorResponse"
2137+
21122138
components:
21132139
securitySchemes:
21142140
Bearer:
@@ -5828,6 +5854,16 @@ components:
58285854
externalDocs:
58295855
url: https://developers.line.biz/en/reference/messaging-api/#display-a-loading-indicator-response
58305856
type: object
5857+
MarkMessagesAsReadByTokenRequest:
5858+
externalDocs:
5859+
url: https://developers.line.biz/en/reference/messaging-api/#mark-as-read-request-body
5860+
required:
5861+
- markAsReadToken
5862+
type: object
5863+
properties:
5864+
markAsReadToken:
5865+
type: string
5866+
description: "Token used to mark messages as read."
58315867

58325868
# Error response
58335869
ErrorResponse:

webhook.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ components:
274274
quotedMessageId:
275275
type: string
276276
description: "Message ID of a quoted message. Only included when the received message quotes a past message."
277+
markAsReadToken:
278+
type: string
279+
description: |+
280+
Token used to mark the message as read.
277281
Emoji:
278282
required:
279283
- index
@@ -362,6 +366,10 @@ components:
362366
type: string
363367
description: |+
364368
Quote token to quote this message.
369+
markAsReadToken:
370+
type: string
371+
description: |+
372+
Token used to mark the message as read.
365373
ImageSet:
366374
type: object
367375
required:
@@ -396,6 +404,10 @@ components:
396404
type: string
397405
description: |+
398406
Quote token to quote this message.
407+
markAsReadToken:
408+
type: string
409+
description: |+
410+
Token used to mark the message as read.
399411
AudioMessageContent:
400412
allOf:
401413
- $ref: "#/components/schemas/MessageContent"
@@ -410,6 +422,10 @@ components:
410422
type: integer
411423
format: int64
412424
description: "Length of audio file (milliseconds)"
425+
markAsReadToken:
426+
type: string
427+
description: |+
428+
Token used to mark the message as read.
413429
FileMessageContent:
414430
allOf:
415431
- $ref: "#/components/schemas/MessageContent"
@@ -425,6 +441,10 @@ components:
425441
fileSize:
426442
type: integer
427443
description: "File size in bytes"
444+
markAsReadToken:
445+
type: string
446+
description: |+
447+
Token used to mark the message as read.
428448
LocationMessageContent:
429449
allOf:
430450
- $ref: "#/components/schemas/MessageContent"
@@ -448,6 +468,10 @@ components:
448468
type: number
449469
format: double
450470
description: "Longitude"
471+
markAsReadToken:
472+
type: string
473+
description: |+
474+
Token used to mark the message as read.
451475
StickerMessageContent:
452476
externalDocs:
453477
url: https://developers.line.biz/en/reference/messaging-api/#wh-sticker
@@ -504,6 +528,10 @@ components:
504528
type: string
505529
description: |+
506530
Message ID of a quoted message. Only included when the received message quotes a past message.
531+
markAsReadToken:
532+
type: string
533+
description: |+
534+
Token used to mark the message as read.
507535
508536
# https://developers.line.biz/en/reference/messaging-api/#unsend-event
509537
UnsendEvent:

0 commit comments

Comments
 (0)