Skip to Content
AgentsCalling an agent

Calling an agent

An agent takes a chat turn on its chat endpoint. Send the new message and a thread id. The platform keeps the thread, so the next request with the same thread id continues the conversation.

The request

curl https://api.ollie.health/loop/$ORG_ID/$LOOP_ID/chat \ -H "Authorization: Bearer $LOOPS_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "threadId": "patient-18", "message": "I have had chest pain since this morning" }'
Method and pathPOST /loop/:organizationId/:loopId/chat
AuthorizationBearer, then a token with run access from Settings → API tokens.
threadIdYour id for the conversation. Any non-empty string.
messageThe new message, as text.

The loop has to be an agent. Sending a message to a workflow fails.

The response

{ "reply": "Chest pain since this morning needs a look today. I can send you a scan link." }

reply is the text of the agent’s answer. The request waits for the whole turn, tool calls included.

The next message

Send the same threadId with the new message. The agent’s messages holds everything said on that thread so far.

{ "threadId": "patient-18", "message": "Yes, send it" }

A new conversation is a new threadId.

From the UI

Open the loop and send a message in its chat.

Last updated on