API REFERENCE
Delete Trailing Chat Messages
On this page
/api/chats/{id}/messages/trailingDelete all messages in a chat from a given message onward (inclusive), identified by from_message_id.
Authentication
See the authentication guide for API key and account access requirements.
Request
curl --request DELETE \
--url 'https://api.recoupable.dev/api/chats/YOUR_ID/messages/trailing?from_message_id=YOUR_FROM_MESSAGE_ID' \
--header 'x-api-key: YOUR_API_KEY'Replace the YOUR_ placeholders with your values. Required query parameters are included; optional parameters are listed below.
Parameters
Path parameters
idstringrequiredThe unique identifier (UUID) of the chat room.
Query parameters
from_message_idstringrequiredThe message UUID from which trailing messages should be deleted (inclusive).
Responses
200Trailing messages deleted successfully+
application/json
statusstring · enumrequiredStatus of the request
Values: "success"
chat_idstringrequiredThe chat UUID where deletion was applied.
format: uuid
from_message_idstringrequiredThe message UUID used as the trailing deletion boundary.
format: uuid
400Bad request - invalid or missing query/path parameters or message does not belong to chat+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredError message describing what went wrong.
missing_fieldsarray<string>List of missing or invalid parameter fields (when validation fails).
Item properties for missing_fields
string
401Unauthorized - invalid or missing credentials+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredError message describing what went wrong.
missing_fieldsarray<string>List of missing or invalid parameter fields (when validation fails).
Item properties for missing_fields
string
403Forbidden - access denied to this chat+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredError message describing what went wrong.
missing_fieldsarray<string>List of missing or invalid parameter fields (when validation fails).
Item properties for missing_fields
string
404Not found - chat or message does not exist+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredError message describing what went wrong.
missing_fieldsarray<string>List of missing or invalid parameter fields (when validation fails).
Item properties for missing_fields
string
500Server error - failed to delete trailing messages+
application/json
statusstring · enumrequiredStatus of the request
Values: "error"
errorstringrequiredError message describing what went wrong.
missing_fieldsarray<string>List of missing or invalid parameter fields (when validation fails).
Item properties for missing_fields
string
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download research.jsonView operation source
{
"description": "Delete all messages in a chat from a given message onward (inclusive), identified by `from_message_id`.",
"parameters": [
{
"name": "id",
"in": "path",
"description": "The unique identifier (UUID) of the chat room.",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
},
{
"name": "from_message_id",
"in": "query",
"description": "The message UUID from which trailing messages should be deleted (inclusive).",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Trailing messages deleted successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTrailingChatMessagesResponse"
}
}
}
},
"400": {
"description": "Bad request - invalid or missing query/path parameters or message does not belong to chat",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTrailingChatMessagesErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized - invalid or missing credentials",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTrailingChatMessagesErrorResponse"
}
}
}
},
"403": {
"description": "Forbidden - access denied to this chat",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTrailingChatMessagesErrorResponse"
}
}
}
},
"404": {
"description": "Not found - chat or message does not exist",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTrailingChatMessagesErrorResponse"
}
}
}
},
"500": {
"description": "Server error - failed to delete trailing messages",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteTrailingChatMessagesErrorResponse"
}
}
}
}
}
}