RecoupGet a free auditFree audit

API REFERENCE

Delete Trailing Chat Messages

On this page
DELETE/api/chats/{id}/messages/trailing

Delete 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
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.

Try it

Fill in the fields, send the request from your browser, and read the live response. The curl below updates as you type.

Kept in this browser tab only and cleared when it closes.

cURL for this request
curl --request DELETE \
  --url 'https://recoup-api.vercel.app/api/chats/{id}/messages/trailing'

Parameters

Path parameters

idstringrequired

The unique identifier (UUID) of the chat room.

Query parameters

from_message_idstringrequired

The message UUID from which trailing messages should be deleted (inclusive).

Responses

200Trailing messages deleted successfully

application/json

statusstring · enumrequired

Status of the request

Values: "success"

chat_idstringrequired

The chat UUID where deletion was applied.

format: uuid

from_message_idstringrequired

The 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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Error 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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Error 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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Error 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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Error 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 · enumrequired

Status of the request

Values: "error"

errorstringrequired

Error 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.json
View operation source
json
{
  "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"
          }
        }
      }
    }
  }
}