Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sam-shervin/space7/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Permanently deletes a message from a space. Users can only delete their own messages.

Endpoint

DELETE /api/messages/:spaceId/:messageId
Requires authentication

Request

Path parameters

spaceId
string
required
The unique identifier of the space the message belongs to.
messageId
string
required
The unique identifier of the message to delete.
Users can only delete their own messages. Attempting to delete another user’s message will return an error.

Response

message
string
A confirmation string indicating the message was successfully deleted.

Example

TypeScript
import { fetchWithAuth } from "./fetchWithAuth";

const deleteMessage = async (
  spaceId: string,
  messageId: string,
): Promise<{ message: string }> => {
  const res = await fetchWithAuth(
    `/api/messages/${spaceId}/${messageId}`,
    {
      method: "DELETE",
      headers: {
        "Content-Type": "application/json",
      },
    },
  );

  const data = await res.json();

  if (!res.ok) {
    throw new Error(data.error || "Failed to delete message");
  }

  return data; // { message: string }
};

Build docs developers (and LLMs) love