Moab logoMoab
Get started
Moab Docs

Agent Runs

One batch of work by a campaign agent — a run is the unit drafts group by.

Base path /api/v1/campaign-agent-runs on https://moabcrm.com. Authenticate with Authorization: Bearer $DASH_API_KEY and name the project with the Project-ID header. Writes are validated in declared mode; an operation this resource does not declare answers 405 operation_not_supported.

List agent runs

GET /api/v1/campaign-agent-runs

curl "https://moabcrm.com/api/v1/campaign-agent-runs" \
  -H "Authorization: Bearer $DASH_API_KEY" \
  -H "Project-ID: pr_zest"
Show me the agent runs filtered by agent id
data_query {
  "collection": "agent_runs"
}

Returns a paginated list of campaign-agent-run objects, newest first.

{
  "object": "list",
  "data": [
    {
      "object": "campaign-agent-run",
      "id": "obj_123",
      "status": "status",
      "run_type": "run type",
      "summary": "summary",
      "details": "details",
      "created_at": "2026-07-25T12:00:00.000Z",
      "updated_at": "2026-07-25T12:00:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Parameters

ParameterTypeKindDescription
agent_idstringfilterThe campaign agent that performed this run.
statusstringfilterWhere the run ended up. Free text on purpose — the values in the corpus are the run's own vocabulary (ready_for_review, …) rather than a platform ladder, and an enum here would invent one.
run_typestringfilterWhat kind of pass this was — the skill the run executed.
product_idstringfilterThe product the run was working, copied from the agent.
goal_idstringfilterThe goal the run was moving, copied from the agent.
qstringsearchFree-text search across summary.
sortstringsortOne of created_at, started_at, completed_at, cost_usd; prefix with - to reverse.
limitnumberpageRows to return, 1–100. Defaults to 20.
cursorstringpagenext_cursor from the previous page.

Retrieve a campaign-agent-run

GET /api/v1/campaign-agent-runs/draft-001

curl "https://moabcrm.com/api/v1/campaign-agent-runs/draft-001" \
  -H "Authorization: Bearer $DASH_API_KEY" \
  -H "Project-ID: pr_zest"
Open the campaign-agent-run {id}
data_get {
  "collection": "agent_runs",
  "object_id": "draft-001"
}

Returns the campaign-agent-run object.

{
  "object": "campaign-agent-run",
  "id": "obj_123",
  "status": "status",
  "run_type": "run type",
  "summary": "summary",
  "details": "details",
  "created_at": "2026-07-25T12:00:00.000Z",
  "updated_at": "2026-07-25T12:00:00.000Z"
}

Parameters

ParameterTypeKindDescription
idstringpathThe campaign-agent-run's id or slug.

Create a campaign-agent-run

POST /api/v1/campaign-agent-runs

curl -X POST "https://moabcrm.com/api/v1/campaign-agent-runs" \
  -H "Authorization: Bearer $DASH_API_KEY" \
  -H "Project-ID: pr_zest" \
  -H "Content-Type: application/json" \
  -d '{"status":"status","run_type":"run type","summary":"summary"}'
Create a new campaign-agent-run
data_set {
  "collection": "agent_runs",
  "object_id": "draft-001",
  "data": {
    "status": "status",
    "run_type": "run type",
    "summary": "summary"
  }
}

Returns the campaign-agent-run object.

{
  "object": "campaign-agent-run",
  "id": "obj_123",
  "status": "status",
  "run_type": "run type",
  "summary": "summary",
  "details": "details",
  "created_at": "2026-07-25T12:00:00.000Z",
  "updated_at": "2026-07-25T12:00:00.000Z"
}

Parameters

FieldTypeRequiredDescription
statusstringnoWhere the run ended up. Free text on purpose — the values in the corpus are the run's own vocabulary (ready_for_review, …) rather than a platform ladder, and an enum here would invent one.
run_typestringnoWhat kind of pass this was — the skill the run executed.
summarystringnoOne human sentence describing what the run did, e.g. 'Built list "Series A DevTools" — 47 leads.' Written by the run itself; the UI falls back to a count-derived sentence when absent.
detailsstringnoOptional second digest line, e.g. 'Drafted 12 cold emails via Instantly.' Also where the run names its lead sources (attempted, used, per-source counts, and the reason any returned zero).
goal_deltanumbernoHow far this run moved the linked goal. Accumulated onto the agent as goal_delta_total, which is the denominator of its cost_per_goal.
duration_msnumbernoWall-clock length of the run, in milliseconds.
started_atdatenoWhen the run began.
completed_atdatenoWhen the run reached a terminal state.

Update a campaign-agent-run

PATCH /api/v1/campaign-agent-runs/draft-001

curl -X PATCH "https://moabcrm.com/api/v1/campaign-agent-runs/draft-001" \
  -H "Authorization: Bearer $DASH_API_KEY" \
  -H "Project-ID: pr_zest" \
  -H "Content-Type: application/json" \
  -d '{"status":"status","run_type":"run type","summary":"summary"}'
Update the campaign-agent-run {id}
data_set {
  "collection": "agent_runs",
  "object_id": "draft-001",
  "data": {
    "status": "status",
    "run_type": "run type",
    "summary": "summary"
  }
}

Returns the campaign-agent-run object.

{
  "object": "campaign-agent-run",
  "id": "obj_123",
  "status": "status",
  "run_type": "run type",
  "summary": "summary",
  "details": "details",
  "created_at": "2026-07-25T12:00:00.000Z",
  "updated_at": "2026-07-25T12:00:00.000Z"
}

Parameters

FieldTypeRequiredDescription
statusstringnoWhere the run ended up. Free text on purpose — the values in the corpus are the run's own vocabulary (ready_for_review, …) rather than a platform ladder, and an enum here would invent one.
run_typestringnoWhat kind of pass this was — the skill the run executed.
summarystringnoOne human sentence describing what the run did, e.g. 'Built list "Series A DevTools" — 47 leads.' Written by the run itself; the UI falls back to a count-derived sentence when absent.
detailsstringnoOptional second digest line, e.g. 'Drafted 12 cold emails via Instantly.' Also where the run names its lead sources (attempted, used, per-source counts, and the reason any returned zero).
goal_deltanumbernoHow far this run moved the linked goal. Accumulated onto the agent as goal_delta_total, which is the denominator of its cost_per_goal.
duration_msnumbernoWall-clock length of the run, in milliseconds.
started_atdatenoWhen the run began.
completed_atdatenoWhen the run reached a terminal state.

What comes back (read-only)

Every campaign-agent-run carries the envelope below. The fields under it are computed or stamped by the platform — they are returned, never sent.

FieldTypeDescription
objectstringAlways campaign-agent-run.
idstringStable object id. Also accepted in place of slug on any path.
slugstringURL-safe name, unique within the collection.
created_atstringISO-8601 timestamp of the first write.
updated_atstringISO-8601 timestamp of the most recent write. The cursor sorts on this.
agent_idstringThe campaign agent that performed this run.
product_idstringThe product the run was working, copied from the agent.
goal_idstringThe goal the run was moving, copied from the agent.
list_idstringThe list the run drew people from.
content_idstringThe content piece the run drafted from.
draft_batch_idstringThe batch id the run's drafts group under — drafts are reviewed and approved a batch at a time.
companies_foundnumberCompanies this run created, counted by the write door and stamped at the run terminal (yield-and-cost plan §S3). Never model-written.
leads_foundnumberPeople this run created, counted by the write door and stamped at the run terminal (§S3). The agent-level leads_found still counts people-row provenance directly. Never model-written.
drafts_creatednumberDrafts this run minted, counted by the outbox write door and stamped at the run terminal (§S3). Never model-written.
cost_usdnumberFinalized compute $ for this run, stamped server-side at the run terminal from the usage ledger. A skill can never know its own cost.
provider_cost_usdnumberThe provider $ share of cost_usd — what the email source / resolve doors metered this run (Prospeo, Enrow, verifiers, …), stamped flat by the same terminal hook so the agent view splits AI vs providers with one SUM. Absent when the run measured no provider spend.
cost_per_draftnumbercost_usd ÷ this run's drafts_created, stamped by the same terminal hook. Absent when the run drafted nothing — a zero-denominator ratio is not a measurement. THE per-run economics line (verified drafts per dollar).
lead_sourcesstringOne line naming where this run's leads came from — copied VERBATIM from email_source's measured sources_attempted record (every rung, ran-with-counts or skipped-with-why) and stamped at the run terminal (§S3). Read back into the next run's context as sourcing history — a measurement now, never a model transcription.
mleobjectThe run's MLE plan + measured mix (F2, MLE v1.2): { version, strategy, sources[], resolve_rungs[], limit, query_axes[], resolve_mix{rung: count} }. Stamped at the run terminal from the lead_source door's set-once plan record — model writes are refused (agent_run_stats_server_stamped). mle-bench report groups runs by strategy × version off this field.
verified_emailsstringOne line on email verification economics this run (resolved/attempts, measured cost from the tools' own cost objects), stamped at the run terminal (§S3). Never model-written.
sendsnumberProvider-confirmed sends this run — COUNT of the run's outbox rows in the sent band, stamped at the run terminal (zero included; W8b). Never model-written (agent_run_stats_server_stamped).
send_refusalsobjectWhy drafted rows did not send — a ROLLUP of this run's held outbox rows by their status_reason (reason -> count; §2 mirror of the rows, never a second truth). Stamped at the run terminal; absent when nothing was held. Never model-written.
sources_exhaustedbooleanPOSITIVE mined-out evidence from this run's measured ledger (sourcing ran, ladder ran out, zero new candidates; a work-budget stop never qualifies). Stamped at the run terminal; the list_mined_out blocker counts consecutive runs off this field. Never model-written.
supply_unsendablebooleanThe OTHER measured exhaustion (sendability-loop plan W4): sourcing found people but resolution was attempted and NONE resolved to a sendable address. Counts toward the list_mined_out streak like sources_exhausted. Stamped at the run terminal; never model-written.

Errors

Failures use { error: { type, code, message, param } }. The full code table is generated at Error Codes.