Chúng tôi có thể giúp gì?

Cho chúng tôi biết ngắn gọn về vấn đề – chúng tôi sẽ liên hệ lại qua email.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Về trang chủ

Server API (REST v1) and MCP

The reactive.chat REST interface for your backend – API keys and scopes, rate limiting, response and error format, pagination, all endpoints for projects, conversations, messages, visitors, events, rules and hooks – and the MCP server for AI tools.

The server API is meant for your backend, not for the browser: it does not allow CORS, and an API key never belongs in a web page or app.

Basics

API keys

In your account under API keys (/app/api-keys, owners and admins only). You assign a name and a scope; the key (rc_live_ + 48 characters) is shown exactly once, and we only store a hash.

Scopes:

A key belongs to exactly one workspace; no path and no parameter selects another. It becomes invalid when you revoke it or when the person who created it is no longer an owner or admin of the workspace. There is no expiry date – rotate yourself (create a new one, switch over, revoke the old one).

Sending:

curl https://reactive.chat/v1/me -H "Authorization: Bearer rc_live_..."

The header X-Api-Key: rc_live_... is equivalent (it is only read if there is no Authorization: Bearer).

Rate limiting

Response format

{ "data": { ... } }

Lists:

{ "data": [ ... ], "has_more": true, "next": { "before_id": "812" } }

Pagination: limit (default 25, at most 100) and a cursor – before_id for “newest first” lists, after_id for “oldest first” lists. next is only present if has_more is true. There is no total count.

Bodies of POST/PUT: only Content-Type: application/json (otherwise 415), at most 65,536 bytes (otherwise 413), a JSON object with at most 32 levels.

Error format

{ "error": { "code": "insufficient_scope", "message": "...", "required_scope": "write" } }

message is a fixed English sentence for developers. Depending on the error, param, required_scope, max, allowed, reason are added. The codes are exhaustive:

Endpoints

Account

Projects (read)

Conversations (read)

Messages

curl -X POST https://reactive.chat/v1/conversations/815/messages \
  -H "Authorization: Bearer rc_live_..." \
  -H "Content-Type: application/json" \
  -d '{"body":"Your return has arrived.","author_type":"agent","client_ulid":"01JAB3C4D5E6F7G8H9JKMNPQRS"}'

Visitors (read)

Events

{ "project_id": "123", "type": "bestellung.storniert",
  "session_id": "s_...", "conversation_id": "01JAB...",
  "payload": { "nummer": "2026-0815" }, "ts": 1792503600000 }

type matching ^[a-z][a-z0-9_.:-]{0,47}$, payload at most 8192 bytes, ts in milliseconds (at most 7 days old, at most 5 minutes ahead). source is always integration. Response 201.

Rules (read)

Hooks – see Webhooks: GET /v1/hooks, POST /v1/hooks, DELETE /v1/hooks/{id}.

Customer data – see Customer data: PUT and DELETE /v1/kundendaten/{user_id}.

Example: collecting open conversations

<?php
$key = getenv('RC_API_KEY');
$url = 'https://reactive.chat/v1/conversations?status=waiting&limit=100';
do {
    $ch = curl_init($url);
    curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $key]]);
    $antwort = json_decode((string) curl_exec($ch), true);
    $status  = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
    if ($status === 429) { sleep(60); continue; }
    foreach ($antwort['data'] as $g) { echo $g['id'], ' ', $g['created_at'], "\n"; }
    $url = !empty($antwort['has_more'])
        ? 'https://reactive.chat/v1/conversations?status=waiting&limit=100&before_id=' . $antwort['next']['before_id']
        : null;
} while ($url);

MCP server

For AI tools that speak the Model Context Protocol, there is an MCP server under the same base:

Tools (tools/list shows only those your key is allowed to use):

Without besucherdaten:lesen, visitors' name, email and phone are shortened and personal data in texts is masked. Tool errors come as isError: true with identifiers such as project_not_found, conversation_not_found, conversation_closed, disabled, bad_argument, too_long, search_rate_limited.

Sample entry for an MCP client:

{
  "mcpServers": {
    "reactive-chat": {
      "url": "https://reactive.chat/v1/mcp",
      "headers": { "Authorization": "Bearer rc_live_..." }
    }
  }
}

MCP and the visitor list are new features; they may be switched off per project (the affected project then reports disabled).

What does not exist

Next: Webhooks · Integrations and channels

Cập nhật lần cuối: