AppMage

ChatRpc

This endpoint group provides chat transcript retrieval, message search, and emoji reaction updates for chat messages. The exposed methods operate through the JSON-RPC transport at POST /api/rpc.

Endpoints

POST /api/rpc (Method: ChatRpc.getThreadMessages)

  • Description: Retrieves the clean UI message transcript for a specific thread, with cursor-based pagination.
  • Request Body:
    {
      "method": "ChatRpc.getThreadMessages",
      "params": {
        "threadId": "string",
        "before": "2024-01-01T00:00:00.000Z",
        "limit": 50
      }
    }
  • Parameters:
    Name Type Required Description
    threadId String Yes Thread identifier used to select the transcript.
    before String | null No Optional cursor value. The source comment indicates this is an ISO date string.
    limit Number No Maximum number of messages to return. Defaults to 50 when omitted. The schema constrains values to integers from 1 to 200.
  • Response:
    {
      "success": true,
      "data": "implementation-defined"
    }
    The returned data shape is determined by the underlying chat service and is not exposed in this file.
  • Example (cURL):
    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "ChatRpc.getThreadMessages",
        "params": {
          "threadId": "thread_123",
          "limit": 50
        }
      }'

POST /api/rpc (Method: ChatRpc.searchMessages)

  • Description: Searches messages across threads or within a specific thread.
  • Request Body:
    {
      "method": "ChatRpc.searchMessages",
      "params": {
        "query": "hello",
        "threadId": "thread_123",
        "page": 1,
        "pageSize": 20
      }
    }
  • Parameters:
    Name Type Required Description
    query String Yes Search term. The schema requires at least one character.
    threadId String | null No Optional thread filter.
    page Number No Page number for pagination. Defaults to 1 when omitted. The schema constrains values to integers greater than or equal to 1.
    pageSize Number No Number of results per page. Defaults to 20 when omitted. The schema constrains values to integers from 1 to 100.
  • Response:
    {
      "success": true,
      "data": "implementation-defined"
    }
    The returned data shape is determined by the underlying chat service and is not exposed in this file.
  • Example (cURL):
    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "ChatRpc.searchMessages",
        "params": {
          "query": "hello"
        }
      }'

POST /api/rpc (Method: ChatRpc.addReaction)

  • Description: Adds an emoji reaction to a message.
  • Request Body:
    {
      "method": "ChatRpc.addReaction",
      "params": {
        "messageId": "message_123",
        "emoji": "👍"
      }
    }
  • Parameters:
    Name Type Required Description
    messageId String Yes Identifier of the message to update.
    emoji String Yes Emoji to add. The schema requires at least one character.
  • Response:
    {
      "success": true,
      "data": {
        "reactions": "implementation-defined"
      }
    }
    This method returns the updated reactions value from the chat service.
  • Example (cURL):
    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "ChatRpc.addReaction",
        "params": {
          "messageId": "message_123",
          "emoji": "👍"
        }
      }'

POST /api/rpc (Method: ChatRpc.removeReaction)

  • Description: Removes an emoji reaction from a message.
  • Request Body:
    {
      "method": "ChatRpc.removeReaction",
      "params": {
        "messageId": "message_123",
        "emoji": "👍"
      }
    }
  • Parameters:
    Name Type Required Description
    messageId String Yes Identifier of the message to update.
    emoji String Yes Emoji to remove. The schema requires at least one character.
  • Response:
    {
      "success": true,
      "data": {
        "reactions": "implementation-defined"
      }
    }
    This method returns the updated reactions value from the chat service.
  • Example (cURL):
    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "ChatRpc.removeReaction",
        "params": {
          "messageId": "message_123",
          "emoji": "👍"
        }
      }'