ReplyBrain Docs LLMs

Check It Works

Send one synthetic message and follow it through. Use made-up customers only ([email protected], account acme), never a real one.

1. The message arrived

Channel What you should see
Email A new case in the ReplyBrain console inbox within a few seconds, with the mail as its first message.
Your app POST /v1/connections/{id}/events answered 202 with "state": "recorded". A second post of the same source_event_id answers "state": "duplicate".

For your app, read the connection's status with its API key:

curl -s https://replybrain.com/v1/connections/$CONNECTION_ID/status \
  -H "Authorization: Bearer $REPLYBRAIN_API_KEY"
{
  "object": "connection_status",
  "id": "9a8b7c6d-0000-4000-8000-000000000002",
  "kind": "product_api",
  "system": "host",
  "sync": "fresh",
  "grants": "valid",
  "credential_expires_at": null,
  "write": "drafts_only",
  "operations": {
    "publish": {
      "conditional_publish": false, "discloses": false, "enforces_valid_until": false,
      "revision_tokens": false, "visibility_control": false, "attachments": false, "idempotency_window": 0
    }
  },
  "links": { "self": "/v1/connections/9a8b7c6d-0000-4000-8000-000000000002/status" }
}

write: drafts_only is what a draft-only app shows. grants: expiring means the connection's credential expires within 14 days; revoked means nothing can be signed.

2. The case is on the right channel

Open the case in the console. Its conversation's channel must be the one you decided draft-only for (email, or the message.channel your events send, such as in_app).

WARNING

A case on channel api means your events carry no message.channel. Drafts there are refused until a disclosure decision exists for api. Fix the events (send channel), or decide draft-only for api too.

3. A draft was placed

  • Email: the draft waits on the case in the console.
  • Your app: your HelpDeskSource#publish ran with mode: "draft" and answered drafted(…); the draft sits in your own desk.

If no draft came, the case says why in the console. The usual causes:

Reason Fix
No disclosure decision for the channel Decide draft-only for that channel (none).
withdraw_unsupported Serve message.withdraw and have it registered. Until then your app is sent no assistant draft.
The message is internal Send message.visibility: "customer".
A holding reply instead of an answer Expected when the case needs a person, facts are missing, or research is still running. See [[concepts/holding-replies-and-follow-ups
Not support (a test, an automated notice) Expected: no draft for mail that is not a support request.

4. A person sends it

Send the draft from where it waits (the console, or your desk). For your app, post the outbound message as an event (direction: "outbound", author: "agent", author_name), so the case knows the customer was answered.

5. Facts were read (your app)

On a case bound to the customer's account, the console shows the facts read from your app. If none were read, check Facts and account scope: the case must be bound to an account before any of that customer's facts are used.