Automations API
Use automations to run Assistant prompts on a schedule or on demand. Automations let you set up recurring tasks, such as daily health checks or weekly report generation, and optionally send results to Slack.
Automations have two scopes:
- User automations are private to the identity that created them, with the administrator access described below. This is the default scope.
- Tenant automations are visible to all users in the organization.
Administrators with grafana-assistant-app.automations:read can view all automations in the stack, including private automations. Administrators with grafana-assistant-app.automations:write can update them. These permissions don’t grant access to another identity’s private run history or conversation details, or permission to run or delete its private automations.
Automation creation is subject to your stack’s limits. Scheduled automations must have a minimum interval of 15 minutes.
Examples use the base URL and service account token described in Grafana Assistant HTTP API reference.
Create an automation
Create a new automation.
Endpoint
POST /automations
Permissions
Request
Send a JSON request body.
Slack notifications
Configure Slack notifications to receive automation results in a channel or as a direct message. Slack notifications require a connected Slack integration in Grafana.
Include the notifications field when creating or updating an automation.
{
"name": "Daily SLO report",
"prompt": "Summarize SLO health for all production services and highlight any that are below target.",
"enabled": true,
"scope": "tenant",
"scheduleCron": "0 9 * * 1-5",
"scheduleTimezone": "America/New_York",
"notifications": {
"slack": {
"enabled": true,
"notifyOn": ["completed", "failed"],
"target": {
"type": "channel",
"channelId": "C0123456789"
}
}
}
}Response
{
"status": "success",
"data": {
"id": "e7f5a6b8-9012-3456-abcd-278901234567",
"name": "Daily SLO report",
"prompt": "Summarize SLO health for all production services and highlight any that are below target.",
"scope": "tenant",
"enabled": true,
"createdBy": "sa-5594@serviceaccount.grafana",
"createdAt": "2025-11-15T12:00:00Z",
"updatedAt": "2025-11-15T12:00:00Z",
"schedule": {
"cron": "0 9 * * 1-5",
"timezone": "America/New_York",
"nextRunAt": "2025-11-18T14:00:00Z"
},
"notifications": {
"slack": {
"enabled": true,
"notifyOn": ["completed", "failed"],
"target": {
"type": "channel",
"channelId": "C0123456789"
}
}
}
}
}Examples
curl -X POST "${ASSISTANT_API_URL}/automations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}" \
-d '{
"name": "Daily SLO report",
"prompt": "Summarize SLO health for all production services and highlight any that are below target.",
"enabled": true,
"scope": "tenant",
"scheduleCron": "0 9 * * 1-5",
"scheduleTimezone": "America/New_York",
"notifications": {
"slack": {
"enabled": true,
"notifyOn": ["completed", "failed"],
"target": {
"type": "channel",
"channelId": "C0123456789"
}
}
}
}'List automations
Retrieve automations visible to the current identity.
Endpoint
GET /automations
Permissions
Alternatively, grafana-assistant-app.automations:read grants access to all automations in the stack.
Request
Response
{
"status": "success",
"data": {
"automations": [
{
"id": "e7f5a6b8-9012-3456-abcd-278901234567",
"name": "Daily SLO report",
"prompt": "Summarize SLO health for all production services and highlight any that are below target.",
"scope": "tenant",
"enabled": true,
"createdBy": "sa-5594@serviceaccount.grafana",
"createdAt": "2025-11-15T12:00:00Z",
"updatedAt": "2025-11-15T12:00:00Z",
"schedule": {
"cron": "0 9 * * 1-5",
"timezone": "America/New_York",
"nextRunAt": "2025-11-18T14:00:00Z"
},
"notifications": {
"slack": {
"enabled": true,
"notifyOn": ["completed", "failed"],
"target": {
"type": "channel",
"channelId": "C0123456789"
}
}
}
}
],
"nextCursor": ""
}
}To paginate, pass the nextCursor value from the response as the cursor parameter in the next request. An empty nextCursor means there are no more results.
Examples
curl -X GET "${ASSISTANT_API_URL}/automations?page_size=10" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"Get an automation
Retrieve a single automation by ID.
Endpoint
GET /automations/{id}
Permissions
Alternatively, grafana-assistant-app.automations:read grants access to all automations in the stack.
Request
Response
{
"status": "success",
"data": {
"id": "e7f5a6b8-9012-3456-abcd-278901234567",
"name": "Daily SLO report",
"prompt": "Summarize SLO health for all production services and highlight any that are below target.",
"scope": "tenant",
"enabled": true,
"createdBy": "sa-5594@serviceaccount.grafana",
"createdAt": "2025-11-15T12:00:00Z",
"updatedAt": "2025-11-15T12:00:00Z",
"schedule": {
"cron": "0 9 * * 1-5",
"timezone": "America/New_York",
"nextRunAt": "2025-11-18T14:00:00Z"
},
"lastRun": {
"status": "completed",
"chatId": "18289896-b393-4136-9014-c2630a62f67f",
"method": "schedule",
"stepsUsed": 12,
"startedAt": "2025-11-15T14:00:00Z"
},
"notifications": {
"slack": {
"enabled": true,
"notifyOn": ["completed", "failed"],
"target": {
"type": "channel",
"channelId": "C0123456789"
}
}
}
}
}Latest run (data.lastRun)
The data.lastRun object describes the automation’s most recent run. It may be absent before the first run. Scheduled runs and runs started by other callers can change which run appears here.
Use data.lastRun.chatId as {chatId} in GET /chats/{chatId}. For the required permissions, refer to the Conversations API.
Examples
AUTOMATION_ID="e7f5a6b8-9012-3456-abcd-278901234567"
curl -X GET "${ASSISTANT_API_URL}/automations/${AUTOMATION_ID}" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"Update an automation
Update an existing automation. Only the fields you include in the request body are changed.
Endpoint
PUT /automations/{id}
Permissions
Changing scope requires write permission for both the current and desired scopes. Updating a private automation also requires ownership. Alternatively, grafana-assistant-app.automations:write permits updates across both scopes, including another identity’s private automation.
Request
Send a JSON request body with the fields to update.
When you include notifications.slack, send the complete Slack configuration. It replaces the existing Slack configuration; omitted Slack fields aren’t preserved.
To remove Slack notifications, set the provider to null in an update:
{
"notifications": {
"slack": null
}
}Response
The response contains the full updated automation.
Examples
Disable an automation:
AUTOMATION_ID="e7f5a6b8-9012-3456-abcd-278901234567"
curl -X PUT "${ASSISTANT_API_URL}/automations/${AUTOMATION_ID}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}" \
-d '{
"enabled": false
}'Delete an automation
Permanently delete an automation and its schedule.
Endpoint
DELETE /automations/{id}
Permissions
Request
Response
A successful deletion returns HTTP 200 with an empty data object.
Examples
AUTOMATION_ID="e7f5a6b8-9012-3456-abcd-278901234567"
curl -X DELETE "${ASSISTANT_API_URL}/automations/${AUTOMATION_ID}" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"Run an automation
Trigger a manual run of an automation. The run executes asynchronously, so a successful request does not mean the run has finished.
Endpoint
POST /automations/{id}/run
Permissions
Both the automation creator and the identity requesting the manual run must have the create permission for the automation’s scope. Only the owner can run a private automation.
Request
No request body is required.
Response
A successful request returns HTTP 200. The response does not include a conversation ID immediately.
Call GET /automations/{id} to check the automation’s latest run. In the response, data.lastRun describes that run. When data.lastRun.chatId is present, pass its value to GET /chats/{chatId} to retrieve the conversation. Reading the automation and its conversation requires the permissions documented in Get an automation and the Conversations API.
lastRun describes the most recent run. Scheduled runs and runs started by other callers can change which run appears there.
Examples
AUTOMATION_ID="e7f5a6b8-9012-3456-abcd-278901234567"
curl -X POST "${ASSISTANT_API_URL}/automations/${AUTOMATION_ID}/run" \
-H "Authorization: Bearer ${SERVICE_ACCOUNT_TOKEN}"

