UserHero Docs
Automations

Automations API & MCP

Manage and run automations programmatically via the REST API and MCP server

Automations API & MCP

You can list automations, inspect their details, view run history, and execute macros programmatically — using either the REST API or the UserHero MCP server.

REST API

Base URL: https://userhero.co/api/v1

All endpoints require a Bearer token. Create an API key from Account > API Keys in the dashboard. Read operations require the automations:read scope; creating, updating, deleting, or running automations requires automations:write.


List automations

GET /api/v1/automations?projectId={id}

Returns all automations for a project, ordered by priority.

Query parameters

ParameterTypeRequiredDescription
projectIdstringYesThe project ID
scopestringNoFilter by scope: feedback.created, feedback.updated, time.scheduled, or manual
enabledbooleanNoFilter by enabled state (true or false). Omit to return both
includeSystembooleanNoInclude SLA-generated automations (default: false)
limitnumberNoResults per page — max 100, default 50
cursorstringNoPagination cursor — the last automation ID from the previous response

Response

{
  "automations": [
    {
      "id": "abc123",
      "name": "Auto-assign billing",
      "scope": "feedback.created",
      "enabled": true,
      "priority": 0,
      "conditions": { "combinator": "and", "rules": [] },
      "actions": [{ "type": "assign_agent", "params": { "userId": "..." } }],
      "runStats": { "matched7d": 42, "errored7d": 0 },
      "lastRunAt": "2026-05-30T10:00:00Z"
    }
  ],
  "nextCursor": "def456"
}

When nextCursor is present, pass it as cursor to fetch the next page.


Get a single automation

GET /api/v1/automations/{id}

Returns full automation details including conditions, actions, and statistics.


Run a macro

POST /api/v1/automations/{id}/run

Execute a macro (scope: "manual") against a specific feedback item.

Request body

{ "feedbackId": "feedback_abc123" }

Response

{
  "runId": "run_xyz789",
  "outcome": "matched",
  "actionsExecuted": [
    { "type": "set_status", "success": true },
    { "type": "add_tag", "success": true }
  ]
}

outcome is matched, no-match, or error.


List run history

GET /api/v1/automations/{id}/runs

Returns the last 50 execution runs for an automation, ordered by most recent first.

Response

{
  "runs": [
    {
      "id": "run_xyz789",
      "outcome": "matched",
      "runAt": "2026-05-30T10:00:00Z",
      "feedbackId": "feedback_abc123",
      "actionsExecuted": [{ "type": "set_status", "success": true }]
    }
  ]
}

MCP Tools

If you use the UserHero MCP server, four automation tools are available.

list_automations

List automations for a project with optional filtering.

Parameters

ParameterTypeRequiredDescription
project_idstringYesThe project ID
scopestringNoFilter by scope
enabledbooleanNoFilter by enabled state
include_systembooleanNoInclude SLA-generated automations (default: false)
limitnumberNoMax results — default 50, max 100
cursorstringNoPagination cursor from previous response

Example prompts:

"List all enabled automations in my project" "Show me all macros in project abc123" "Which automations are currently disabled?"


get_automation

Get full details of a single automation.

Parameters

ParameterTypeRequiredDescription
automation_idstringYesThe automation ID

Returns: Full automation including conditions, actions, statistics, and metadata.

Example prompt:

"Show me the details of automation jg9bTVq5gSvjVm0L55cS"


list_automation_runs

List recent execution runs for an automation.

Parameters

ParameterTypeRequiredDescription
automation_idstringYesThe automation ID
limitnumberNoMax runs — default 20, max 50

Returns: Array of runs with outcome, timestamp, number of actions executed, and the feedback ID.

Example prompt:

"Show me the last 10 runs of the auto-assign macro" "Did any runs fail for automation abc123?"


run_macro

Execute a macro against a feedback item.

Parameters

ParameterTypeRequiredDescription
automation_idstringYesThe macro automation ID (must have scope: "manual")
feedback_idstringYesThe feedback item to run the macro on

Example prompt:

"Run the 'Close and thank' macro on feedback #1370"

See MCP Tools Reference for the full list of available tools.

On this page