Skip to main content
These routes are the creator’s view of every agent that has an agent template installed: push a version to installed agents and poll the run, read the installs ledger and the health rollup, retry a failed install, read outcome counters, and manage the eval set and its runs. Creating, publishing, installing, and deploying are on Agent templates. The CLI twin is lua marketplace template. Verified against lua-cli 3.33.0.

Base URL and authentication

Every route is creator-organization only: reads check marketplace:read and writes check automations:write, both resolved against the template’s creator organization. The host, the bearer header, and the error envelope are on the REST API overview.

Endpoints

POST /marketplace/templates/:templateId/apply

Pushes a version to an explicit list of installed agents asynchronously. Scope automations:write, creator organization. Equivalent: lua marketplace template apply. Unknown body fields are stripped; migrateRuns answers 403 NOT_VERSION_OWNER on this route and belongs on install from the installing organization.
number
Template version to apply.
string[]
required
Agent IDs to apply to. At most 500.
Response 201 with { runId }.

GET /marketplace/templates/:templateId/apply-runs/:runId

Returns an apply run. Scope marketplace:read, creator organization. lua marketplace template apply polls it unless --no-wait is given. A publish that fans out to consenting installs also creates a run; its ID is autoApplyRunId on the publish response. Response 200 with { id, templateId, templateVersion, initiatedBy, targets: [{ agentId, status: "pending" | "applied" | "already_current" | "failed", localAgentVersion?, error? }], status, startedAt, finishedAt?, trigger?: "manual" | "auto-publish" | "auto-publish-chunk", leadRunId?, approvedBy? }.

GET /marketplace/templates/:templateId/installs

The installs ledger: one row per agent the template is installed on. Scope marketplace:read, creator organization. Equivalent: lua marketplace template status.
number
Page number.
number
Page size.
Response 200 with an array of install results.

GET /marketplace/templates/:templateId/installs/health

The health rollup per install and per installed workflow. Scope marketplace:read, creator organization. Equivalent: lua marketplace template health.
number
Reporting window in days.
string
nextCursor from the previous page.
number
Page size. At most 100.
Response 200 with { templateId, windowDays, installs: [{ templateInstallId, agentId, orgId, installedVersion, workflows: [{ key, displayName, workflowId, active, capabilityInert, scheduleStatus: "active" | "paused" | "failed" | "none", runs: { inFlight, gated, suspended, terminals: { completed, failed, timedOut, cancelled, abandoned }, last?, lastFailure? }, autoDisabledAt? }] }], nextCursor? }.

POST /templates/:templateId/installs/:agentId/retry

Re-runs an apply_failed install without forging installer consent. Scope automations:write, creator organization. Response 201 with the install result.

GET /marketplace/templates/:templateId/outcomes

Outcome counters per unit. Scope marketplace:read, creator organization. The counters are separate populations, never summed; only verified is badge-grade.
string
Start of the window.
string
End of the window.
Response 200 with { templateId, from?, to?, units: [{ key, title, unitLabel?, recorded, settled, verified, reversed, inertCapabilities? }] }.

PUT /marketplace/templates/:templateId/eval-set

Replaces the whole eval set and bumps revision. Scope automations:write, creator organization.
string
required
The eval set as JSONL.
Response 200 with the eval set, in the shape the read route returns.

GET /marketplace/templates/:templateId/eval-set

Returns the eval set. Scope marketplace:read, creator organization. Response 200 with { templateId, revision, minPassRate, caseCount, monitorCount, cases, monitors, updatedAt }.

POST /marketplace/templates/:templateId/eval-runs

Starts an eval run. Scope automations:write, creator organization.
string
Agent to run the set against. Defaults to the source agent; must belong to the creator organization.
Response 201 with { runId }.

GET /marketplace/templates/:templateId/eval-runs

Lists eval runs. Scope marketplace:read, creator organization.
number
Page number.
number
Page size.
Response 200 with eval runs, each { id, templateId, agentId, evalSetRevision, sourceAgentVersion?, status, cases, passRate?, passed?, initiatedBy, startedAt, finishedAt? }.

GET /marketplace/templates/:templateId/eval-runs/:runId

Returns one eval run, in the same shape as a list entry. Scope marketplace:read, creator organization.

Errors

Apply and the creator retry share the install error envelope and codes on Agent templates. Specific to these routes:

See also