Easymailing
A I agents

List the runs of an AI agent

GET /ai_agents/{uuid}/runs

GET/ai_agents/{uuid}/runs

Lists the runs of an agent started with run_ai_agent in the last 30 days, the last one first, with the same fields as get_ai_agent_run: state, answer, sources, tools used, cost and cause when it stopped. Each person sees only the runs they started; administrators of automations (automations.manage) see every run of the agent.

When to use: To find a run whose uuid was lost, or to see what an agent has been asked lately and what it cost.

When not to use: To follow one run you already started use get_ai_agent_run with its uuid. Executions of the agent inside automations are not runs: they are in list_workflow_executions. Tests made in Easymailing (the «Test» panel of the agent) are not listed.

Filters: All filters are optional and combine with AND.

  • state: only runs in that state. Sorting: fixed, last started first; there is no order parameter. Pagination: page and itemsPerPage (default 25, maximum 100); the total is in hydra:totalItems. Runs older than 30 days are not listed.

Permissions: Requires the automations.read capability. Only the runs the person started, unless they are an administrator of automations (automations.manage), who sees them all. What the agent read in the CRM is shown in tools_used only for records the reader can see.

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

uuid*string

UUID of the agent.

Formatuuid

Query Parameters

state?string

Only runs in this state.

Value in

  • "queued"
  • "running"
  • "waiting_approval"
  • "completed"
  • "stopped"
page?integer

Page number, starting at 1.

Range1 <= value
Default1
itemsPerPage?integer

Runs per page. Default 25, maximum 100.

Range1 <= value <= 100
Default25

Response Body

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://api.easymailing.com/ai_agents/6e2f0a97-4b1c-4d35-9a8e-2c7d5f1b3e40/runs?state=completed&page=1&itemsPerPage=25" \  -H "X-Auth-Token: YOUR_API_KEY"
[  {    "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",    "agent": "/entity/1",    "agent_version": 1,    "source": "published",    "state": "queued",    "stop_cause": "ai_credits_exhausted",    "limit_reached": "cost",    "task": "string",    "record": "/entity/1",    "response_format": "text",    "answer_text": "string",    "answer_fields": {},    "sources": [      {}    ],    "tools_used": [      {}    ],    "spent": {},    "duration_ms": 0,    "retry_after_ms": 0,    "created_by": {},    "created_at": "2019-08-24T14:15:22Z",    "started_at": "2019-08-24T14:15:22Z",    "finished_at": "2019-08-24T14:15:22Z",    "kept_until": "string"  }]