cURL
curl -X DELETE "https://reygrid.com/api/v1/agents/{AgentId}/conversations/user_42/messages/msg_mgGdMG8f9PUjc?cascade=true" \
-H "Authorization: Bearer $REYGRID_API_KEY"from reygrid import ReyGrid
client = ReyGrid(api_key="YOUR_API_KEY")
# cascade=True also deletes the messages after this one
client.delete_message("{AgentId}", "user_42", "msg_mgGdMG8f9PUjc", cascade=True)import { ReyGrid } from "reygrid";
const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });
// cascade = true also deletes the messages after this one
await client.deleteMessage("{AgentId}", "user_42", "msg_mgGdMG8f9PUjc", true);{
"success": true,
"deletedMessages": {
"count": 2
}
}{
"error": "Unauthorized",
"code": "AUTH_REQUIRED"
}{
"success": false,
"error": {
"code": "MESSAGE_NOT_FOUND",
"message": "This message does not exist"
}
}Messages
Delete a message
Deletes a specific message.
cascade=true also deletes the message immediately following the selected message.
conversationRef can be either a conversationId or a persistent userId.
DELETE
/
agents
/
{agentId}
/
conversations
/
{conversationRef}
/
messages
/
{messageId}
cURL
curl -X DELETE "https://reygrid.com/api/v1/agents/{AgentId}/conversations/user_42/messages/msg_mgGdMG8f9PUjc?cascade=true" \
-H "Authorization: Bearer $REYGRID_API_KEY"from reygrid import ReyGrid
client = ReyGrid(api_key="YOUR_API_KEY")
# cascade=True also deletes the messages after this one
client.delete_message("{AgentId}", "user_42", "msg_mgGdMG8f9PUjc", cascade=True)import { ReyGrid } from "reygrid";
const client = new ReyGrid({ apiKey: "YOUR_API_KEY" });
// cascade = true also deletes the messages after this one
await client.deleteMessage("{AgentId}", "user_42", "msg_mgGdMG8f9PUjc", true);{
"success": true,
"deletedMessages": {
"count": 2
}
}{
"error": "Unauthorized",
"code": "AUTH_REQUIRED"
}{
"success": false,
"error": {
"code": "MESSAGE_NOT_FOUND",
"message": "This message does not exist"
}
}Authorizations
ReyGrid API key sent as a Bearer token.
Path Parameters
The ID of the agent.
A conversation ID or persistent user ID.
The ID of the message to delete.
Query Parameters
When true, also deletes the message immediately following the selected message.