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

Toggles the current user’s appreciation on a specific message. If the user has not yet appreciated the message, this adds an appreciation. If the user has already appreciated it, this removes it.

Endpoint

POST /api/messages/:spaceId/:messageId/appreciate
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 appreciate or un-appreciate.

Response

appreciated
boolean
true if the message is now appreciated by the current user, false if the appreciation was removed.

Example

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

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

  const data = await res.json();

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

  return data; // { appreciated: boolean }
};

Build docs developers (and LLMs) love