Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/platform/grafana-assistant/reference/http-apis/conversations.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/platform/grafana-assistant/reference/http-apis/conversations/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Conversations API
Use conversations to start, continue, inspect, and stream Assistant interactions.
Examples use the base URL and service account token described in Grafana Assistant HTTP API reference.
Start or continue a conversation
Create a new conversation with the Assistant or continue an existing one.
Endpoint
POST /assistant/chats
Permissions
The service account must have these Assistant RBAC permissions:
grafana-assistant-app.chats:access
The service account also needs any Grafana RBAC permissions required by the prompt, such as data source query or dashboard read permissions.
Request
Send a JSON request body.
| Field | Required | Description |
|---|---|---|
prompt | Yes | The task or question for Assistant. |
chatId | No | The ID of an existing conversation to continue. |
{
"prompt": "How many datasources do I have?",
"chatId": "optional-existing-chat-id"
}Response
The response includes the conversation ID to use when fetching messages or streaming events.
{
"status": "success",
"data": {
"chatId": "18289896-b393-4136-9014-c2630a62f67f"
}
}Examples
curl -X POST "${ASSISTANT_API_URL}/assistant/chats" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}" \
-d '{
"prompt": "How many datasources do I have?"
}'Use the returned chatId to fetch messages or stream chat events.
Only one Assistant task can be active for an existing chat. If you submit another request while a task is running, the API returns HTTP 409 Conflict. Wait for the active task to finish before retrying.
Caution
Automation runs can’t be continued with this endpoint: the reply doesn’t use the run’s earlier messages, and it doesn’t appear when you read the conversation. Continue them in Assistant Workspace.
Fetch conversation messages
Retrieve the current chat metadata and messages.
Endpoint
GET /chats/{chatId}
Permissions
The service account must have these Assistant RBAC permissions:
grafana-assistant-app.chats:access
Request
| Parameter | Required | Description |
|---|---|---|
chatId | Yes | The conversation ID returned when you start or continue a conversation. |
Response
The response includes conversation metadata and messages. For a conversation that an automation run created, the response also includes automationId, but only when the caller can see that automation.
{
"status": "success",
"data": {
"id": "18289896-b393-4136-9014-c2630a62f67f",
"name": "Assistant Conversation",
"created": "2025-10-20T10:30:00Z",
"modified": "2025-10-20T10:35:00Z",
"userId": "sa-5594@serviceaccount.grafana",
"category": "assistant",
"messages": [
{
"id": "msg-1",
"role": "user",
"content": [
{
"type": "text",
"text": "How many datasources do I have?"
}
]
},
{
"id": "msg-2",
"role": "assistant",
"content": [
{
"type": "text",
"text": "You have 5 datasources configured..."
}
]
}
]
}
}Examples
CHAT_ID="18289896-b393-4136-9014-c2630a62f67f"
curl -X GET "${ASSISTANT_API_URL}/chats/${CHAT_ID}" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"Fetch the full transcript
Retrieve every message in a conversation, including automation runs and investigations started through the API.
Endpoint
GET /chats/{chatId}/all-messages
Permissions
The service account must have these Assistant RBAC permissions:
grafana-assistant-app.chats:access
Request
| Parameter | Required | Description |
|---|---|---|
chatId | Yes | The conversation ID. |
Response
The response lists the messages in order in data.messages. Each message includes its role, content, sequence, and an audience. Messages whose audience isn’t user, and messages with hidden set to true, hold Assistant’s internal work; skip them to show the conversation people see. In some conversations, a tool call and its result are in the same assistant message, and several entries can share an id, so don’t use id as a unique key.
{
"status": "success",
"data": {
"messages": [
{
"id": "msg-1",
"role": "user",
"audience": "user",
"sequence": 1,
"content": [
{
"type": "text",
"text": "How many datasources do I have?"
}
]
},
{
"id": "msg-2",
"role": "assistant",
"audience": "user",
"sequence": 2,
"content": [
{
"type": "text",
"text": "You have 5 datasources configured..."
}
]
}
]
}
}Examples
CHAT_ID="18289896-b393-4136-9014-c2630a62f67f"
curl -X GET "${ASSISTANT_API_URL}/chats/${CHAT_ID}/all-messages" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"Stream chat events
Subscribe to real-time conversation updates using SSE.
Endpoint
GET /api/events/chats/{chatId}
This endpoint uses a different base path than standard api/v1 endpoints:
https://your-stack.grafana.net/api/plugins/grafana-assistant-app/resources/api/events/chats/{chatId}The example uses ASSISTANT_EVENTS_URL as shorthand for the events base URL:
ASSISTANT_EVENTS_URL="https://your-stack.grafana.net/api/plugins/grafana-assistant-app/resources/api/events"Permissions
The service account must have these Assistant RBAC permissions:
grafana-assistant-app.chats:access
Request
| Parameter | Required | Description |
|---|---|---|
chatId | Yes | The conversation ID returned when you start or continue a conversation. |
Response
The response is an SSE stream. Listen for the event types your integration needs, and ignore event types you don’t recognize.
Conversations you start with POST /assistant/chats send these events:
| Event type | Description |
|---|---|
message.created | A new message is added to the conversation. |
message.stream.start | A message starts streaming. |
message.content.delta | An incremental update to message content. |
message.stream.complete | A message finishes streaming. |
AGENT_STARTED | Assistant begins working on the task. |
AGENT_COMPLETED | Assistant finishes successfully. |
AGENT_FAILED | Assistant encounters an error. |
REMOTE_TOOL_REQUEST | Assistant requests frontend tool execution. |
Automation runs don’t send message content or AGENT_* events, so an integration that waits for AGENT_COMPLETED doesn’t finish. To follow an automation run, refetch the full transcript when you receive an event, and poll it as a fallback.
Examples
CHAT_ID="18289896-b393-4136-9014-c2630a62f67f"
curl -N "${ASSISTANT_EVENTS_URL}/chats/${CHAT_ID}" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}" \
-H "Accept: text/event-stream"For integration examples:
- Navigate to AI > Assistant in the main menu.
- Click Integration hub.
- Review the SDK and integration examples. Direct HTTP API testing may not be available from the Integration hub.
Was this page helpful?
Related resources from Grafana Labs


