> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Sync Messages > List updated and deleted messages in a room. Use `lastUpdate` to retrieve changes made after a specific date. To limit the results to messages originally sent at or after a specific date, use `fromTs` together with `lastUpdate`. You can also paginate updated or deleted messages with the `next`, `previous`, and `type` parameters. This endpoint replaces the deprecated `loadMissedMessages` method, which is scheduled for removal in Rocket.Chat 9.0.0. ### Changelog | Version | Description | | ------------ | ------------| | 8.8.0 | Added the `fromTs` parameter. | | 1.0.0 | Added | ## OpenAPI ````json GET /api/v1/chat.syncMessages { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Messaging" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Chat" }, { "name": "Direct Messages" }, { "name": "Auto-Translate" } ], "paths": { "/api/v1/chat.syncMessages": { "get": { "tags": [ "Chat" ], "summary": "Sync Messages", "description": "List updated and deleted messages in a room. Use `lastUpdate` to retrieve changes made after a specific date. To limit the results to messages originally sent at or after a specific date, use `fromTs` together with `lastUpdate`.\n\nYou can also paginate updated or deleted messages with the `next`, `previous`, and `type` parameters. This endpoint replaces the deprecated `loadMissedMessages` method, which is scheduled for removal in Rocket.Chat 9.0.0.\n### Changelog\n| Version | Description | \n| ------------ | ------------|\n| 8.8.0 | Added the `fromTs` parameter. |\n| 1.0.0 | Added |", "operationId": "get-api-v1-chat.syncMessages", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" }, { "$ref": "#/components/parameters/RoomId" }, { "$ref": "#/components/parameters/count" }, { "name": "lastUpdate", "in": "query", "description": "The date and time after which message updates and deletions should be returned.", "schema": { "type": "string", "format": "date-time" }, "example": "2019-04-16T18:30:46.669Z" }, { "name": "fromTs", "in": "query", "description": "The inclusive date and time boundary for the original message timestamp. Only messages originally sent at or after this date are considered. You must use this parameter together with `lastUpdate`.", "schema": { "type": "string", "format": "date-time" }, "example": "2019-04-01T00:00:00Z" }, { "name": "next", "in": "query", "description": "The cursor returned in `result.cursor.next` to retrieve the next page. Use either `next` or `previous`.", "schema": { "type": "string" } }, { "name": "previous", "in": "query", "description": "The cursor returned in `result.cursor.previous` to retrieve the previous page. Use either `next` or `previous`.", "schema": { "type": "string" } }, { "name": "type", "in": "query", "description": "The message change type to retrieve when using cursor pagination. This parameter is required with `next` or `previous`.", "schema": { "type": "string", "enum": [ "UPDATED", "DELETED" ] } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "object", "properties": { "updated": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string" }, "rid": { "type": "string" }, "u": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" }, "name": { "type": "string" } } }, "msg": { "type": "string" }, "ts": { "type": "string" }, "_updatedAt": { "type": "string" }, "alias": { "type": "string" }, "token": { "type": "string" }, "unread": { "type": "boolean" }, "urls": { "type": "array", "items": { "type": "object" } }, "mentions": { "type": "array", "items": { "type": "object" } }, "channels": { "type": "array", "items": { "type": "object" } }, "md": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "value": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "value": { "type": "string" } } } } } } }, "t": { "type": "string" }, "groupable": { "type": "boolean" } } } }, "deleted": { "type": "array", "items": { "type": "object", "required": [ "_id", "_deletedAt" ], "properties": { "_id": { "type": "string" }, "_deletedAt": { "type": "string", "format": "date-time" } } } }, "cursor": { "type": "object", "properties": { "next": { "type": "string", "nullable": true }, "previous": { "type": "string", "nullable": true } } } } }, "success": { "type": "boolean" } } }, "examples": { "Example": { "value": { "result": { "updated": [ { "_id": "ak3WdaLbf4P7ZW3wQ", "rid": "5qW6ssMFyzWjJev69", "u": { "_id": "FWfHnJmcudrCagGDX", "username": "555192857993", "name": "555192857993" }, "msg": "teste", "ts": "2021-09-24T19:19:47.911Z", "_updatedAt": "2021-09-24T19:19:48.048Z", "alias": "mauricio pretto", "token": "do554ryecscmfrrxyxpvm", "unread": true, "urls": [], "mentions": [], "channels": [], "md": [ { "type": "PARAGRAPH", "value": [ { "type": "PLAIN_TEXT", "value": "teste" } ] } ] }, { "_id": "2ttrNPABcCKbsbEtB", "t": "livechat-started", "msg": "", "groupable": false, "ts": "2021-09-24T19:19:46.523Z", "u": { "_id": "FWfHnJmcudrCagGDX", "username": "555192857993", "name": "555192857993" }, "rid": "5qW6ssMFyzWjJev69", "unread": true, "_updatedAt": "2021-09-24T19:19:46.691Z", "urls": [], "mentions": [], "channels": [] } ], "deleted": [] }, "success": true } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" } } }, "examples": { "Example 1": { "value": { "success": false, "error": "The required \"roomId\" query param is missing [error-param-required]", "errorType": "error-param-required" } }, "Example 2": { "value": { "success": false, "error": "The \"type\" or \"lastUpdate\" parameters must be provided [error-param-required]", "errorType": "error-param-required" } }, "Example 3": { "value": { "success": false, "error": "The \"lastUpdate\" query parameter must be a valid date [error-lastUpdate-param-invalid]", "errorType": "error-lastUpdate-param-invalid" } }, "Example 4": { "value": { "success": false, "error": "The \"fromTs\" parameter can only be used together with \"lastUpdate\" [error-fromTs-requires-lastUpdate]", "errorType": "error-fromTs-requires-lastUpdate" } } } } } } } } } }, "components": { "parameters": { "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The `authToken` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" }, "UserId": { "name": "X-User-Id", "in": "header", "description": "The `userId` of the authenticated user.", "required": true, "schema": { "type": "string" }, "example": "rbAXPnMktTFbNpwtJ" }, "RoomId": { "name": "roomId", "in": "query", "description": "The room ID.", "required": true, "schema": { "type": "string" }, "example": "6GFJ3tbmHiyHbahmC" }, "count": { "name": "count", "in": "query", "description": "The number of items to return. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more.", "required": false, "schema": { "type": "integer" }, "example": 50 } }, "responses": { "authorizationError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } } }, "examples": { "Authorization Error": { "value": { "status": "error", "message": "You must be logged in to do this." } } } } } } } } } ````