Get API key

    Reference/Chat

    POST/v1/agents/:id/threads/:threadId/messages/stream

    Send a chat message (stream)

    Streams a UIMessage turn (same protocol as the app). Simple send: put your text in "message". After a tool asks for approval, POST again with the full "messages" array including an approval-responded part.

    Full URL

    POST https://api.tryleadreach.com/v1/agents/:id/threads/:threadId/messages/stream

    Headers

    • X-Api-Key (required): your API key from the app Keys tab.
    • Content-Type: application/json (required)

    Path params (in the URL)

    NameTypeRequiredMeaning
    iduuidYesThe agent's id (from Create agent or List agents).
    threadIduuidYesThe chat thread id (from Create thread or List threads).

    Query params (after ?)

    None

    Request body (JSON)

    FieldTypeRequiredMeaning
    messagestringNoUser text for a normal send.
    messagesarrayNoFull UIMessage list (needed for tool approval continue).
    triggerstringNoOptional: "submit-message" or "regenerate-message".
    messageIduuidNoUsed for edit / regenerate.
    leadIdsuuid[]NoOptional leads attached to this turn (max 25).

    Example request (JSON)

    What you send: headers, and path / query / body when used.

    {
      "headers": {
        "X-Api-Key": "lr_your_key_here",
        "Content-Type": "application/json"
      },
      "path": {
        "id": "a1111111-1111-1111-1111-111111111111",
        "threadId": "t1111111-1111-1111-1111-111111111111"
      },
      "body": {
        "message": "Find 5 people leads"
      }
    }

    Example response (JSON)

    Typical successful response shape.

    {
      "_note": "Streaming UIMessage / SSE bytes (not one JSON object). Read the stream until it ends."
    }

    Response

    Streaming UIMessage / SSE body (not a single JSON object).

    Credits

    chat turn