Glnc API Reference

version: 14

Expectation monitoring for automated work.

Define Check → Report Run → Respond with context. Glnc evaluates whether
recurring automated work happened on time and produced the expected result. A
Kanban work queue can carry the failure evidence and next action through the
response loop; it is not Glnc’s primary identity.

For an answer-first agent workflow, read
AI workflow monitoring.

Vocabulary: the Glance web UI calls these actors Agents. This API and its
X-Entity header keep the term entity — they are the same concept (“Agent”
in the UI is entity on the wire).


Discovery and Bootstrap

GET /api/v1             → unauthenticated start-here JSON
GET /.well-known/agent.json → same discovery document, well-known path
GET /api/v1/openapi     → unauthenticated OpenAPI 3.1 document
GET /llms.txt           → LLM-oriented pointer to discovery, OpenAPI, and docs
GET /docs/api.md        → this document (agent-readable markdown)
GET /api/v1/setup       → bearer + X-Entity bootstrap for a known entity's queue/stage topology

Remote MCP (no install)

For Claude Cowork and other clients that support custom remote MCP servers, paste
https://glnc.io/mcp as the server URL. Do not install a package, run a local
process, or create an API key. The client discovers Glance OAuth, opens a browser,
and asks you to approve full-account access for that named client.

After authorization, first call glance_get_identity to confirm the expected Glance user
and account, then call glance_get_monitoring_status for the account’s current health.
Monitoring tools are account-level and need no Entity. Work-queue tools require an
entity_slug argument because an Entity is acting. Delete operations remain
available for API parity and advertise destructive safety metadata; review and
approve the client’s confirmation before executing one.

Disconnecting in the client does not revoke server access. Review or revoke a
grant in Settings → MCP Connections. Revocation immediately invalidates its access
and refresh tokens without affecting API keys or other clients. If a client does
not support remote MCP and OAuth, use the REST API-key flow below as the fallback.

An agent that only knows the base URL should start with GET /api/v1 or
GET /.well-known/agent.json. Discovery distinguishes account-level monitoring
from entity-scoped queue work. For a scoped key, select permitted entities in
Settings → API Keys; a full-access key may use any existing account entity. Then
call GET /api/v1/setup with that known slug to learn its permitted queue and
stage topology. Setup validates a slug; it does not discover an unknown one.


Authentication

Glnc has two explicit API authentication modes.

Account-level

Monitoring endpoints require a full-access key and one header:

Authorization: Bearer <api_key>

Do not send X-Entity to account-level endpoints. A scoped key receives 403.

Entity-scoped

Setup and work-queue endpoints require two headers:

Authorization: Bearer <api_key>
X-Entity: <entity_slug>

Generate the key in Settings → API Keys; scoped keys also select their permitted
entities there. entity_slug identifies which agent identity is acting. Full-access
keys may act as any existing entity in the account; entity-scoped keys may use
only an entity selected for that key. GET /api/v1/setup requires this value and
returns the permitted topology for it—it cannot supply a slug the caller does
not already know.

The entity may also be supplied as an entity query/body param if the header is inconvenient — the header takes precedence.

Read-only posture

Read-only is a separate capability axis from full-access versus entity-scoped
access, not a third access value. A read-only key may be either full-access or
entity-scoped. Read endpoints work normally, including status, monitoring checks,
history, and timelines.

Mutating operations return 403 with the exact error message This API key is read-only and may not mutate resources.
This includes reporting monitoring runs,
creating or updating monitoring check configuration, deletes, and claiming work
items. The claim operation is mutating even though its route uses GET.


Response Envelope

Most responses share the same JSON envelope:

{ "ok": true,  "command": "...", "result": { ... }, "next_actions": [] }
{ "ok": false, "error": "...",   "command": null,   "result": null, "next_actions": [] }

JSON exceptions to the envelope:

  • GET /api/v1 and GET /.well-known/agent.json return flat discovery JSON.
  • GET /api/v1/openapi returns a bare OpenAPI 3.1 document.
  • GET /api/v1/version returns a flat object (see that endpoint below).
  • 401 Unauthorized returns only { "ok": false, "error": "Unauthorized" }.

GET /docs/api, GET /docs/api.md, and GET /llms.txt are public prose
documents, not API-envelope JSON endpoints.

MCP tool responses may add a top-level untrusted_fields array naming fields
authored by a monitoring runner or operator. This MCP-only field is additive and
omitted when no such field is present. REST clients never receive it from any
/api/v1/* response.

HTTP status codes:

Code Meaning
200 Success
401 Missing or invalid API key
403 Caller is not allowed (e.g. not the claim holder)
404 Resource not found
409 Conflict with existing state (e.g. creating a check whose name is taken, or an unforced write to operator-owned configuration)
422 Validation error or missing required header/param
429 Concurrency cap exceeded

Tag Policy

Work item tags and monitoring check affected_systems values share one
account-level vocabulary governed by the account’s tag policy. Read
result.tag_policy from GET /api/v1/setup before assigning tags — never
guess or cache the list long-term:

"tag_policy": { "mode": "strict", "preferred_tags": ["...", "..."] }

Two modes:

  • preferred (default) — the preferred list is guidance; no tag is ever rejected.
  • strict — tags newly added by a request that are outside preferred_tags
    are rejected with 422. A strict policy with an empty preferred_tags list
    rejects nothing.

Enforcement is delta-based (grandfathering): only tags newly added by a
request are checked. Values already stored on the record pass untouched, so a
strict policy never blocks updating a record that carries legacy tags — only
introducing new out-of-list values.

A rejected request returns the standard error envelope:

{ "ok": false, "error": "Tags not permitted by this account's strict tag policy: <tags>. Allowed tags: <list>. Read GET /api/v1/setup for the current list." }

The tag curation endpoints POST /api/v1/monitoring/tags/rename and
POST /api/v1/monitoring/tags/merge honor the same policy: under strict mode,
renaming or merging into a tag outside the preferred list returns 422 unless
every affected check already carries the target tag (the same delta semantics).
POST /api/v1/monitoring/tags/delete is unaffected — removing a tag never adds
vocabulary.


Endpoints

GET /api/v1 and GET /.well-known/agent.json

Unauthenticated start-here discovery document. Both paths return the same flat
JSON shape. Use it when an agent only knows the glnc base URL and needs to learn
how to authenticate, where the OpenAPI document lives, and which core endpoints
start the workflow.

Response (whole body):

{
  "product": "Glnc",
  "category": "Expectation monitoring for automated work.",
  "workflow": "Define Check → Report Run → Respond with context.",
  "response_loop": "A Kanban work queue carries remediation context; it is not the product's primary identity.",
  "version": "14",
  "authentication": {
    "key_management_url": "https://glnc.io/settings/api_keys",
    "modes": {
      "account_level": {
        "headers": { "Authorization": "Bearer <api_key>" }
      },
      "entity_scoped": {
        "headers": {
          "Authorization": "Bearer <api_key>",
          "X-Entity": "<known entity_slug; scoped keys select it in Settings → API Keys>"
        }
      }
    }
  },
  "start_here": [
    { "method": "GET", "path": "/api/v1/setup", "auth_mode": "entity_scoped", "summary": "..." }
  ],
  "docs": {
    "full_reference": "https://glnc.io/docs/api.md",
    "openapi": "https://glnc.io/api/v1/openapi",
    "llms_txt": "https://glnc.io/llms.txt",
    "monitoring_rules_url": "https://glnc.io/api/v1/monitoring/rules"
  }
}

docs.monitoring_rules_url is GET /api/v1/monitoring/rules: read it before creating, editing
or reporting to a monitor.


GET /api/v1/openapi

Unauthenticated OpenAPI 3.1 document generated from Api::EndpointCatalog. The
body is a bare OpenAPI document, not wrapped in the glnc response envelope.


GET /llms.txt

Unauthenticated plain-text LLM pointer document. It is hand-authored and links to
discovery, OpenAPI, this API reference, the monitoring rules, and the monitoring loop. It is not
generated from Api::EndpointCatalog, so treat it as a prose surface during API
doc audits.


GET /docs/api and GET /docs/api.md

Unauthenticated public API reference. GET /docs/api renders HTML for browsers;
GET /docs/api.md returns this markdown source for agents.


GET /api/v1/version

Unauthenticated. Returns the public product identity and API documentation
version as a flat object — this endpoint does not use the standard envelope
and intentionally omits runtime and deploy internals.

Response (whole body):

{
  "app": "glnc",
  "version": "14"
}

GET /api/v1/identity

Full-account and Entity-free. Confirms the authenticated user, account, capability,
and credential type. OAuth calls also include only the current MCP connection ID
and client name. It never returns secrets, billing, configuration, or an Entity list.

Response result:

{
  "user": { "id": "...", "name": "Example User", "email": "member@example.test" },
  "account": { "id": "...", "name": "Example Company" },
  "capability": { "level": "full_account", "credential_type": "oauth" },
  "connection": { "id": "...", "client_name": "Claude" }
}

GET /api/v1/setup

Entity-scoped bootstrap. Send a bearer token plus a known X-Entity slug. Scoped
keys select their permitted entities in Settings → API Keys; full-access keys may
use any existing account entity. Returns that entity’s profile and permitted work
queues and stages. Also returns docs_url pointing to this document and
openapi_url pointing to the machine-readable contract. This endpoint does not
list entities or discover a missing slug.

Response result:

{
  "entity": {
    "slug": "my-agent",
    "entity_type": "agent",
    "emoji": "🤖",
    "max_concurrent_tasks": 1
  },
  "tag_policy": {
    "mode": "preferred",
    "preferred_tags": ["infra", "weekly"]
  },
  "work_queues": [
    {
      "slug": "GLA",
      "name": "Main Queue",
      "stages": [
        { "slug": "backlog",     "name": "Backlog",     "stage_type": "start"    },
        { "slug": "in-progress", "name": "In Progress", "stage_type": "middle"   },
        { "slug": "done",        "name": "Done",        "stage_type": "terminal" }
      ]
    }
  ],
  "hold_count": 0,
  "max_concurrent_tasks": 1,
  "docs_url": "https://glnc.io/docs/api.md",
  "openapi_url": "https://glnc.io/api/v1/openapi",
  "version": "14"
}

docs_url points to this document. openapi_url points to the OpenAPI document.
Cache them and re-fetch when version changes.

tag_policy is the account’s tag vocabulary contract — read it before assigning
work item tags or monitoring affected_systems values. Operators can change the
policy at any time without a version bump, so also re-fetch it after any
tag-policy 422. See Tag Policy for the enforcement rules.


GET /api/v1/next_work_item

Claims and returns the next available unclaimed work item for this entity. Returns null result when no item is available.

Query params:

Param Description
work_queue Slug — restrict to a single queue (optional)

Response result: full work item (see Work Item Shape) or null.


GET /api/v1/work_items

Returns work items accessible to this entity.

Query params:

Param Description
work_queue Slug — filter by queue
stage Slug — filter by stage (combine with work_queue)
mine true — only items claimed by this entity
entity Slug — items claimed by a specific entity
tag Tag label — only items carrying this tag
view all — include terminal-stage items (default: active only)

Response result: array of slim work items (no history/attachments).


GET /api/v1/work_items/:ref

Returns the full work item including history and attachments.

Response result: full work item (see Work Item Shape).


POST /api/v1/work_items

Creates a new work item.

Body (JSON or form params):

Param Required Description
work_queue Yes Queue slug
title Yes Work item title
description No Markdown description
stage No Stage slug to place item in (default: first start stage)
tags No Array of tag strings. Free-form under the preferred tag policy mode; under strict mode, newly added tags outside the account’s preferred list are rejected with 422 (see Tag Policy)
blocked_by No Array of work item refs (e.g. ["GLA-7", "GLA-12"]) that block this item. Refs must belong to the same account; unknown or cross-account refs return a 422 error and the item is not created.

Response result: full work item, including blocked (boolean) and blockers (array). See “Blocked status” below.


PATCH /api/v1/work_items/:ref

Updates a work item’s fields, or sends a heartbeat.

Update fields (JSON or form params):

Param Description
title New title
description New description (markdown)
pr_url GitHub PR URL to link
tags Array of tag strings. Free-form under the preferred tag policy mode; under strict mode, newly added tags outside the account’s preferred list are rejected with 422 (see Tag Policy)

Heartbeat (send instead of update fields):

{ "heartbeat": true }

Refreshes the claim’s last_heartbeat_at. Only the claiming entity may heartbeat. Returns { "state": "...", "last_heartbeat_at": "..." }.

When the claim is paused, the heartbeat is silently acknowledged and last_heartbeat_at is not refreshed (the reaper exempts paused claims, so there is no risk of being killed). The response still includes the current state and last_heartbeat_at so the agent can detect that it is paused. When the claim is awaiting_review, the heartbeat refreshes normally.

Response result: full work item (or heartbeat object).


POST /api/v1/work_items/:ref/transition

Moves a work item to a different stage.

Body:

Param Required Description
to Yes "next", "prev", or a stage slug
claim No "keep" (default), "release", or "checkpoint"
note No Optional markdown note to attach

Claim modes:

Value Effect
keep Stage advances; claim survives unchanged
release Stage advances; claim is destroyed; :released event recorded
checkpoint Stage advances; claim survives but is flipped to awaiting_review and frees the entity’s concurrency slot (so the agent may immediately claim other work). Means “I’ve shipped what I can — your move.” Records a :checkpointed event with from/to stages

Auto-release of awaiting_review claims. When the source claim is already awaiting_review, the next transition (by anyone permitted) destroys the claim regardless of the claim: param. Both :released and :auto_released events are recorded so reviewers can distinguish state-driven from explicit release.

Response result: full work item.

Artifact gate. If the source stage’s current_stage.artifact_spec.required is true, the engine refuses to advance unless an :artifact event of the matching kind has been recorded for the current visit (see POST /artifacts). Returns 422 with a message naming the required kind. Backward transitions and transitions into stages whose accepts_without_source_artifact is true bypass the gate.


POST /api/v1/work_items/:ref/artifacts

Records a typed artifact event for the work item’s current stage. Only the entity holding the claim may post artifacts. Multiple artifacts per visit are appended additively.

Body:

Param Required Description
kind Yes One of note, link, pr, file, json
name No Optional artifact name (e.g. plan, pull_request)
body No Free-form JSON object; defaults to {}

Response result: full work item, including the new artifact in prior_artifacts.

Errors:

  • 403 — caller is not the claim holder
  • 422 — missing or invalid kind

POST /api/v1/work_items/:ref/escalate

Escalates a work item to another entity (e.g. a human or supervisor agent).

Body:

Param Required Description
to Yes Target entity slug
message No Escalation message
decision_request No Versioned decision contract (see below) so the target gets a structured decision to answer

Response result: full work item.


POST /api/v1/work_items/:ref/decision

Records a human’s decision on an item escalated to their entity. Only the entity
the item is escalated to (or a full-access key) may decide. A terminal
disposition (approve, reject, change) records an immutable decision event,
runs the source write-back adapter, appends an immutable receipt, and moves the
item to a terminal stage; defer records the deferral and leaves the item open.
Repeating a terminal decision is a no-op.

Body:

Param Required Description
disposition Yes One of approve, reject, change, defer
option_id No The chosen option id from the decision contract
reason No Free-text reason for the decision

Response result: full work item, including its decision block and updated history.


GET /api/v1/needs

Cross-queue “needs decision” inbox: active items escalated to a human entity
across every queue on the account. Defaults to your own entity; pass
?entity=<slug> to read another. Not gated by stage permissions.

Query params:

Param Required Description
entity No Entity slug whose inbox to read (defaults to the calling entity)

Response result: array of slim work items (each with a needs_decision flag).


POST /api/v1/work_items/:ref/notes

Appends a markdown note to a work item’s history.

Body:

Param Required Description
markdown Yes Note content (markdown)

Response result: full work item.


POST /api/v1/work_items/:ref/pause

Pauses the active claim. Use this when you are blocked on something out-of-band (waiting on a deploy, a secret rotation, a design decision) and want to free your concurrency-cap slot without losing the claim. Only the claim-holding entity may pause.

A paused claim:

  • Does not count against max_concurrent_tasks — you can claim other work while paused.
  • Is not killed by the stale-claim reaper — paused claims survive indefinitely.
  • Does not refresh last_heartbeat_at on heartbeat (silent OK).

Body:

Param Required Description
reason Yes Free-text reason for pausing (max 500 chars)

Response result: full work item; claim.state will be "paused" and claim.pause_reason will echo the reason.

Errors:

  • 404 — the work item is not claimed
  • 403 — caller is not the claim holder
  • 422 — reason is blank or exceeds 500 chars, or the claim is already paused

POST /api/v1/work_items/:ref/resume

Resumes a paused claim. Refreshes last_heartbeat_at so the reaper does not immediately reap. Only the claim-holding entity may resume.

Body: none.

Response result: full work item; claim.state will be "active" and claim.pause_reason is cleared.

Errors:

  • 404 — the work item is not claimed
  • 403 — caller is not the claim holder
  • 422 — the claim is not currently paused

POST /api/v1/work_items/:ref/attachments

Uploads a file attachment. Use multipart/form-data.

Allowed content types: image/png, image/jpeg, image/gif, image/webp, application/pdf, application/zip, any text/*. Max size: 10 MB.

Body (multipart):

Field Required Description
file Yes The file to upload

Response result:

{
  "id": 42,
  "filename": "report.pdf",
  "url": "https://...",
  "content_type": "application/pdf",
  "byte_size": 12345
}

DELETE /api/v1/work_items/:ref/attachments/:attachment_id

Removes an attachment from a work item.

Response result: null.


POST /api/v1/monitoring/checks

Creates a monitoring check. Create-only: if a check with that name already
exists on the account, the request returns 409 and never touches the existing
row. Send Authorization: Bearer <api_key> and no X-Entity header (account-level).

Send the check name in the body (a stable, slug-like machine identifier),
alongside the same configuration fields the PUT body accepts below. To change
an existing check, use PUT /api/v1/monitoring/checks/:name instead.

Body (JSON or form params): name (required) plus every field in the PUT
body table below.

Every check belongs to one space of the account. Send the optional space field (a
space slug) to create the check in that space; omit it and the check joins the account’s
default space (default). An unknown slug returns 422 with
Unknown space '<slug>'. and creates nothing. Check names stay unique across the whole
account, not per space.

Response result: the created check config (same shape as PUT and GET), including
its space slug.

Errors: every 422 from POST or PUT adds rules_url, the section of
GET /api/v1/monitoring/rules that explains the refused field:
#create for POST, #edit for PUT, and #range when a range is malformed, such as
"rules_url": "https://glnc.io/api/v1/monitoring/rules#create".


PUT /api/v1/monitoring/checks/:name

Updates an existing monitoring check by name. Update-only: if no check
with that name exists, the request returns 404 (it never creates — use
POST /api/v1/monitoring/checks to create). This endpoint is account-level:
send Authorization: Bearer <api_key> and no X-Entity header.

PUT has replace semantics. Send the full desired config each time; configurable
fields omitted from the body reset to their defaults. The one exception is space:
omit it and the check keeps its current space. PATCH is the same endpoint with the
same semantics. Runtime fields such as
cached_status, last_run_at, and last_alerted_at are never
changed by this endpoint.

Operator-authored configuration is protected per field. Once an operator edits
a configurable field in the dashboard, an API call that sends an explicit value
for that field returns 409 naming every conflict and persists nothing. An omitting
PUT preserves operator-owned fields instead of resetting them. To transfer
explicitly sent fields back to API ownership, resend with
force_config_overwrite: true; force is surgical and never lifts protection for
omitted fields. force_remediation_overwrite: true remains available as a legacy
alias scoped only to remediation.

Read config_provenance from GET/PUT responses before reconciling. It maps each
tracked field to its last writer (operator or api) and timestamp.

Retired fields. primary_check, primary_check_id and relationship_role (related
monitors), muted_until (Mute), and start_warn_after_seconds, start_violated_after_seconds,
requires_terminal_receipt, expected_duration_seconds, max_duration_seconds, watch_only and watch_note
(start signals, receipts, duration limits and watch-only), and evaluation_version (the readiness version 2
engine) are retired. POST and PUT still accept them, ignore
their values, change nothing, and list each one sent in the result’s ignored_fields array. ignored_fields
is always present on POST and PUT results and is [] when no retired field was sent.

Body (JSON or form params):

Param Required Description
display_name Yes Human label for the check. Name it as the expectation itself — see Naming a monitor below.
category No Dashboard grouping label
space No Slug of an existing space in the account. Omit it to keep the current space (on create: the account’s default space, default). An unknown slug returns 422 with Unknown space '<slug>'. and changes nothing. Moving a check between spaces does not change its config_revision.
description No Plain-English statement of exactly what this check verifies
runner No What runs/reports this check (an agent, cron, or service) — so a responder knows where to look
source No Check origin identity. String, maximum 255 characters; lowercase /-separated segments containing only [a-z0-9_-]. Normalized on write and defaults to unknown; because PUT replaces the full config, omitting it from a PUT resets it to unknown. See Naming a source below.
remediation No What to inspect and how to recover when the check fails. Markdown is supported and preferred; use short lists, inline code for commands, and runbook links for quick scanning.
affected_systems No Array of stored tags / blast-radius labels (what breaks if this fails), e.g. ["catalog", "weekly digest"]. Fetch GET /api/v1/monitoring/tags first to reuse existing vocabulary and avoid drift. The account tag policy applies to newly added values — under strict mode, new out-of-list values are rejected with 422; values already stored on the check are grandfathered (see Tag Policy). Returned as both affected_systems and tags for compatibility.
enabled No Boolean; defaults to true when omitted
severity No critical (default) or warning. The color of No report (stale_run) and of a failed run (error_completion): critical is Failing (red), warning is Warning (yellow), except that a failed run on a warning check is red when a critical output expectation actually triggers on that run; it stays error_completion and its reason ends with Rule result: <rule>. Output expectations keep their own severity. Status checks run in order No report, then a failed run, then output expectations, so a check past its deadline is stale_run even when its last run failed; a timed_out run is also stale_run
expected_interval_seconds No Expected time between runs. No report (stale_run, in the check’s severity color) once the last report, or created_at before the first one, is older than this interval plus a fixed grace (10% of the interval, 300 to 3600 seconds)
warn_threshold_seconds No It does not decide No report; on a scheduled check the smaller of the two thresholds lets a report that lands just before its slot count for that slot
error_threshold_seconds No It does not decide No report; see warn_threshold_seconds
schedule_cron No Cron expression for schedule-based checks; mutually exclusive with expected_interval_seconds. No report (stale_run, in the check’s severity color) once the latest slot passes by its grace (10% of the gap to the slot before it, 300 to 3600 seconds) with no report for that slot
schedule_timezone No IANA timezone required when schedule_cron is set
output_expectations No Array of { field, operator, value, severity } rules; add aggregate + window_hours for windowed trend rules (see below)
ranges No Array of value ranges { value, min, max, severity }. value names a number in the report’s values ([a-z][a-z0-9_]{0,63}); min and max are inclusive numbers and at least one is required; severity is critical or warning and defaults to the monitor’s severity. A value may have several ranges. A value that is outside a range, missing, or not a JSON number (a numeric string included) fails it; the worst failed severity sets the color (output_expectation), ties go to the first range, and the reason names that range: {name}: {value} was {got}. Expected {min} to {max}. (Expected at least {min}. / Expected at most {max}.), {name}: {value} was missing., or {name}: {value} was not a number. A malformed range returns 422 naming ranges[<index>] (zero-based). Omitting ranges clears them; output_expectations never lists them. Saving judges the latest report again at once
remediation_escalation_threshold No Failed-cycle count before escalation; default 3, use 0 to disable
remediation_work_queue No Work queue slug for remediation
remediation_stage No Stage slug within the remediation work queue

Naming a monitor: name the expectation. A monitor is an expectation, so its display_name
should be the expectation — a declarative, testable sentence about the healthy state. Follow this
pattern:

[Scope] · [Subject] [present-tense assertion] [threshold/window]
  • Scope — the service or domain, as a consistent prefix so related monitors group and sort together (GetMusic, Billing, Ingest).
  • Subject — the specific thing observed (failed posts, queue depth, daily export).
  • Assertion — a present-tense verb stating the healthy condition: clears, completes, arrives, stays below, recovers, drains.
  • Threshold/window — include it when it defines the check. “Clears” isn’t testable; “clears within 15m” is.

The litmus test: prefix the name with “We expect that…”. If it reads as a grammatical,
unambiguous sentence, the name is good. When the check fires, display_name is what renders in the
alert email subject and the Slack message — so the name alone should tell an on-call human what is
wrong, without opening the monitor.

Supporting rules:

  • One expectation per monitor. If you can’t name it in one clause, it’s probably two monitors.
  • Always phrase the healthy state, never the failure — Queue depth stays below 10k, not Queue backed up. This keeps every name consistent with the “expectation violated” framing.
  • Use a consistent delimiter between scope and assertion (·, |, or —) so a list of monitors scans cleanly.
  • Concrete nouns over internal shorthand — names should survive team turnover.
  • Numbers only when they define the expectation — windows and thresholds yes, incidental config values no.
  • Keep it under ~60 characters. Alert email subjects truncate the name past that, which would cut off the very clause that makes it testable.

Good:

GetMusic · Failed posts clear from buffer within 15m
Billing · Invoices generate by 02:00 UTC daily
Ingest · Partner feed arrives every 6h
Search · p95 latency stays below 400ms

Avoid: GetMusic Buffer failed posts clear — parses ambiguously, buries the subject, and has no
window, so there is no testable expectation in it.

How this relates to the other fields. The scope prefix does not replace category — keep setting
category for dashboard grouping. The prefix earns its place because an alert arrives without the
dashboard around it, so the name must carry its own context. And display_name does not replace
description: the name is the short, scannable expectation; description is the fuller what-and-why.

Note the distinction between the two name fields: the :name in the URL is a stable machine
identifier
(a short slug, lowercase, immutable once created) — keep it short and slug-like. The
naming guidance above is about display_name, the human-facing label.

None of this is enforced. No name is validated, rejected, or flagged for not following the pattern —
it is a recommendation. Following it has a useful side effect: a well-named monitor list doubles as
documentation, because reading it top to bottom is a list of everything the system promises to do.

Naming a source: say where it ran. A check’s source is its stable origin identity: where and
what runs the job. Order /-separated segments from broadest to narrowest, typically
machine/harness or machine/harness/agent. Include as much detail as you have; omit segments you
do not know rather than inventing placeholders.

Use stable identifiers — hostnames, harness names, agent names — not PIDs, timestamps, container IDs,
or run IDs. The source should be identical across runs of the same job. Reuse an existing source value
if one already describes you; do not create near-duplicate variants. Agents can
GET /api/v1/monitoring/checks to see the values already in use.

Examples:

  • bert/hermes — machine + harness
  • mbp/claude-code — laptop + coding agent
  • gh-actions — ephemeral CI, platform only
  • fly/scraper-worker — hosted platform + app
  • bert/hermes/glance-digest — harness with a specific agent
  • unknown — what you get by sending nothing

Counter-examples:

  • Bert/Hermes — will be lowercased; send lowercase
  • bert/hermes/run-2026-08-21 — run-specific; sources must be stable across runs
  • my machine — spaces become -; prefer a real hostname

Normalization is applied before validation. An illegal character returns 422 and names the
offending normalized value; a normalized value over 255 characters returns 422 as too long.

A run report cannot set a check’s source identity. The source field on
POST /api/v1/monitoring/checks/:check_name/runs and its completion endpoints is the unrelated
run reporting-channel label; setting either source never changes the other. See the run-reporting
body tables below for that run-level field.

Triage context (description, runner, remediation, affected_systems). These are optional but
make a failure actionable: when a check becomes Failing, the Checks page’s attention card
shows its reason alongside what runs it, its tags/blast-radius labels, and the remediation note (rendered as Markdown).
Configure once: read the current check before creating or updating it, and use PUT only for an explicit
configuration change. Because PUT replaces, include desired fields on each configuration sync. Routine
run reporting is pure telemetry: it never performs configuration PUT or changes configuration.

Output expectation rules. Each rule names a bad-state condition and fires its severity when that
condition holds
— the check passes when it does not. Write the tripwire, not the healthy state. Two kinds:

  • Latest-run rule (default): { "field": "records_imported", "operator": "<", "value": 50, "severity": "critical" } — goes Critical when the most recent run’s preferred evidence reports fewer than 50 records imported. Legacy metadata remains accepted as a deprecated compatibility alias.
  • Windowed rule: add aggregate (avg/sum/min/max/count) and window_hours (1–2160) to trip on a trend across all runs in a trailing window. { "field": "sales_count", "operator": "<", "value": 7, "aggregate": "avg", "window_hours": 168, "severity": "critical" } catches “sales quietly down all week” even when every run succeeds. count counts runs in the window (field optional): { "operator": "<", "value": 1, "aggregate": "count", "window_hours": 24, "severity": "warning" } means “goes Warning when no run lands in a day”.

Severity warning turns the check yellow when the rule fires; critical turns it red.

Response result: monitoring check config, including the check’s space slug, source identity, status, status_label, action_required,
status_reason, tags, affected_systems, remediation_attempt_count, next_expected_run,
acknowledged, acknowledged_at, acknowledgment_note,
acknowledgment_expires_at, and acknowledgment_expires_on_next_run.

status_label is the word the dashboard and emails show, computed from status and
status_reason_code when the response renders: OK for green, Waiting for awaiting, and for
red or yellow No report (reason code stale_run), Out of range (an output rule or its
evidence) or Error (a failed run, error_completion); any other or missing red/yellow reason
code is Unknown. status keeps its codes; match on status
and status_reason_code, not on the label. GET /api/v1/monitoring/status carries the same field
on every check it lists.

action_required is derived from status, never stored — poll it instead of re-deriving the
status-to-urgency mapping yourself. It is true for yellow, red, and
unknown, and false for green, awaiting, and disabled. It ignores
acknowledgment: an acknowledged red check still reports true, because acknowledgment
suppresses notification rather than resolving the problem. GET /api/v1/monitoring/status carries
the same field on every check it lists.


GET /api/v1/monitoring/checks

Lists every monitoring check on the account, each in the same shape as
GET /api/v1/monitoring/checks/:name. Use this to reconcile declared-as-code
config against what’s live (find strays to delete, verify a deploy synced
everything), see check-level source identities already in use, or triage failures in one call.

Filtering by check source

Pass the optional source query parameter to filter by a check’s origin identity. Matching uses
segment boundaries: ?source=bert matches bert and bert/hermes, but not bertha.

GET /api/v1/monitoring/checks?source=bert
Authorization: Bearer <api_key>

Short example response (check configs abbreviated):

{
  "ok": true,
  "command": "checks",
  "result": {
    "count": 2,
    "checks": [
      { "name": "host-health", "source": "bert" },
      { "name": "catalog-digest", "source": "bert/hermes" }
    ]
  },
  "next_actions": []
}

Filtering by space

Pass the optional space query parameter (a space slug) to list only the checks in that
space. It combines with source, and without it the list covers every check on the account.
An unknown slug returns 422 with Unknown space '<slug>'.

GET /api/v1/monitoring/checks?space=ops
Authorization: Bearer <api_key>

Response result: { "count": N, "checks": [ ...check configs... ] }. Every check config
includes its check-level source identity and its space slug.


GET /api/v1/monitoring/checks/:name

Returns a monitoring check’s current configuration and status fields. Unknown and
cross-account check names return the same 422 not-found response.

Response result: same check config shape as PUT, including the check-level source identity
and space slug. Lookup is by name across the whole account, whatever the check’s space.

Every check config also carries uuid: the monitor’s permanent identity. It is set when the
monitor is created and never changes; no request can set or change it. Jobs send it as monitor
to POST /api/v1/monitoring/reports.


DELETE /api/v1/monitoring/checks/:name

Permanently deletes a monitoring check and its dependent runs, acknowledgments,
and status history. Use this to retire a check entirely. To keep history but
pause evaluation, update the check with enabled: false instead.

Unknown and cross-account check names return the same 422 not-found response.

Response result: { "name": "check_name" }


POST /api/v1/monitoring/checks/:name/acknowledge

Acknowledges the current Failing/Warning incident for a check (red/yellow
status token). Acknowledgment does not change the status token: the check still
appears in dashboards and daily digests, and immediate alert emails + webhooks
are suppressed. The acknowledgment clears when the check returns to Passing
(green status token) — or expires after ttl_hours of continued failure
(PagerDuty-style ack-timeout), at which point a still-failing check re-alerts.
Acks therefore cannot be set-and-forgotten.

Body:

Param Required Description
note No Optional operator note
ttl_hours No Re-alert window in hours, 1–168 (clamped), or "next_run" to clear on the next terminal run with a 48h safety net. Default 48.

Repeated calls are idempotent and refresh the note. Green, unknown, and
disabled checks return 422 because there is no red/yellow incident to acknowledge.

Response result: monitoring check config with acknowledged: true.


DELETE /api/v1/monitoring/checks/:name/acknowledge

Clears a monitoring acknowledgment. This is idempotent: clearing a check that is
not acknowledged returns 200.

Response result: monitoring check config with acknowledged: false.


GET /api/v1/monitoring/status

Start with GET /api/v1/monitoring/status; it is the canonical diagnosis and inbox read. It returns
primary severity in overall and severity_counts, workflow context in workflow_counts, additive
per-attention-class counts in attention_counts, and the four-bucket inbox: fix_now, maintenance,
watching, and configuration.

Acknowledgment is workflow context only; it never changes primary severity or overall. An acknowledged
Failing or Warning item stays in its severity bucket with its acknowledgment shown as secondary context.
severity_counts and workflow_counts are canonical. Legacy counts, attention, and acknowledged
remain available as deprecated compatibility fields.

tree lists every monitor by category, then subcategory. Each category and subcategory node has
name, status, counts: {red, yellow, green, waiting}, and children (subcategories) or monitors.
A node is red if any monitor in it is red, else yellow if any is yellow, else green if any is green,
else grey. Waiting, unknown and disabled monitors never color a node; they count in waiting.
Acknowledged monitors keep their color. A blank category, and a blank or unknown subcategory, is
(none). Nodes and monitors sort red, yellow, green, grey, then by name.

{
  "overall": "red",
  "severity_counts": {
    "failing": 1,
    "warning": 1,
    "passing": 4,
    "awaiting": 0,
    "disabled": 0,
    "unknown": 0
  },
  "workflow_counts": {
    "acknowledged": 1,
    "unacknowledged": 5
  },
  "attention_counts": {
    "immediate": 1,
    "review": 0,
    "maintenance": 0,
    "watch": 0,
    "configuration": 0
  },
  "inbox": {
    "fix_now": [
      {
        "key": "publication-recovery",
        "label": "Publication recovery",
        "severity": "red",
        "severity_label": "Failing",
        "acknowledged": false,
        "attention_class": "immediate",
        "members": [
          {
            "name": "publish-delivery",
            "display_name": "Publish delivery",
            "group": {
              "key": "publication-recovery",
              "label": "Publication recovery"
            },
            "severity": "red",
            "severity_label": "Failing",
            "acknowledged": false,
            "acknowledgment": null,
            "attention_class": "immediate",
            "headline": "Reported failed",
            "explanation": "Review the reported delivery evidence.",
            "affected_items": [
              {
                "key": "failed_publications",
                "label": "Failed publications",
                "value": "1"
              }
            ],
            "next_action": {
              "label": "Open the publication runbook",
              "kind": "link",
              "url": "https://runbooks.example.test/publication",
              "safe_to_automate": false
            },
            "remediation_group": {
              "slug": "publication-recovery",
              "label": "Publication recovery"
            },
            "responsible_owner": "Publishing",
            "age": "2026-08-28T07:55:00Z",
            "configuration_issue": null,
            "technical_reason": "The reporter returned a delivery failure.",
            "latest_run_path": "/monitoring/checks/publish-delivery/runs/123"
          },
          {
            "name": "publish-retry",
            "display_name": "Publish retry",
            "group": {
              "key": "publication-recovery",
              "label": "Publication recovery"
            },
            "severity": "yellow",
            "severity_label": "Warning",
            "acknowledged": true,
            "acknowledgment": {
              "source": "dashboard",
              "acknowledged_at": "2026-08-28T08:00:00Z"
            },
            "attention_class": "review",
            "headline": "Publish retry needs review",
            "explanation": "Review the reported delivery evidence.",
            "affected_items": [
              {
                "key": "failed_publications",
                "label": "Failed publications",
                "value": "1"
              }
            ],
            "next_action": {
              "label": "Open the publication runbook",
              "kind": "link",
              "url": "https://runbooks.example.test/publication",
              "safe_to_automate": false
            },
            "remediation_group": {
              "slug": "publication-recovery",
              "label": "Publication recovery"
            },
            "responsible_owner": "Publishing",
            "age": "2026-08-28T07:55:00Z",
            "configuration_issue": null,
            "technical_reason": "The reporter returned a delivery failure.",
            "latest_run_path": null
          }
        ]
      }
    ],
    "maintenance": [],
    "watching": [],
    "configuration": []
  },
  "counts": {
    "failing": 1,
    "warning": 0,
    "acked": 1,
    "unknown": 0,
    "passing": 4,
    "awaiting": 0,
    "disabled": 0,
    "total": 6
  },
  "attention": [
    {
      "name": "publish-delivery",
      "display_name": "Publish delivery",
      "category": "Publishing",
      "runner": "cron:publication",
      "source": "example/publisher",
      "remediation": "Inspect the publication delivery.",
      "responsible_owner": "Publishing",
      "tags": [
        "publication"
      ],
      "affected_systems": [
        "publication"
      ],
      "status": "red",
      "status_label": "Error",
      "action_required": true,
      "status_reason": "Latest run requires review.",
      "status_reason_code": "error_completion",
      "acknowledged": false,
      "acknowledged_at": null,
      "acknowledgment_note": null,
      "acknowledgment_expires_at": null,
      "components": []
    }
  ],
  "acknowledged": [
    {
      "name": "publish-retry",
      "display_name": "Publish retry",
      "category": "Publishing",
      "runner": "cron:publication",
      "source": "example/publisher",
      "remediation": "Inspect the publication delivery.",
      "responsible_owner": "Publishing",
      "tags": [
        "publication"
      ],
      "affected_systems": [
        "publication"
      ],
      "status": "yellow",
      "status_label": "Error",
      "action_required": true,
      "status_reason": "Latest run requires review.",
      "status_reason_code": "error_completion",
      "acknowledged": true,
      "acknowledged_at": "2026-08-28T08:00:00Z",
      "acknowledgment_note": "Known publication retry.",
      "acknowledgment_expires_at": "2026-08-30T08:00:00Z"
    }
  ],
  "tree": [
    {
      "name": "Publishing",
      "status": "red",
      "counts": {
        "red": 1,
        "yellow": 1,
        "green": 0,
        "waiting": 0
      },
      "children": [
        {
          "name": "(none)",
          "status": "red",
          "counts": {
            "red": 1,
            "yellow": 1,
            "green": 0,
            "waiting": 0
          },
          "monitors": [
            {
              "name": "publish-delivery",
              "display_name": "Publish delivery",
              "status": "red",
              "acknowledged": false
            },
            {
              "name": "publish-retry",
              "display_name": "Publish retry",
              "status": "yellow",
              "acknowledged": true
            }
          ]
        }
      ]
    },
    {
      "name": "Catalog",
      "status": "green",
      "counts": {
        "red": 0,
        "yellow": 0,
        "green": 4,
        "waiting": 0
      },
      "children": [
        {
          "name": "catalog/sync",
          "status": "green",
          "counts": {
            "red": 0,
            "yellow": 0,
            "green": 4,
            "waiting": 0
          },
          "monitors": [
            {
              "name": "catalog-sync-a",
              "display_name": "Catalog sync A",
              "status": "green",
              "acknowledged": false
            },
            {
              "name": "catalog-sync-b",
              "display_name": "Catalog sync B",
              "status": "green",
              "acknowledged": false
            },
            {
              "name": "catalog-sync-c",
              "display_name": "Catalog sync C",
              "status": "green",
              "acknowledged": false
            },
            {
              "name": "catalog-sync-d",
              "display_name": "Catalog sync D",
              "status": "green",
              "acknowledged": false
            }
          ]
        }
      ]
    }
  ]
}

When an inbox item lacks enough evidence, next_actions exposes at most one diagnostic action: it
prefers a concrete latest-run permalink, and uses a configured safe action only when no latest run is
available. Do not begin routine triage by fetching broad run or status-change history; those bounded
history endpoints remain available for an explicit review.


GET /api/v1/monitoring/tags

Lists all distinct tags in use across the account’s checks, sorted alphabetically with
per-tag check counts.

Call this before creating or updating checks to reuse existing vocabulary and avoid
near-duplicate drift (e.g. “GetMusic” vs “get-music” vs “GetMusic catalog”). Account-level
— full-access API key, no X-Entity header.

Response result: { "count": N, "tags": [{ "name": "...", "count": N }, ...] }


POST /api/v1/monitoring/tags/delete

Removes a tag from every check that carries it. A tag matching no checks is a clean
no-op (affected: 0). Account-level — full-access API key, no X-Entity header.

Body:

Param Required Description
name Yes Tag name to delete

Response result: { "affected": N } — count of checks that were updated.


POST /api/v1/monitoring/tags/rename

Renames a tag across all checks. If the target name already exists on some checks,
the source is merged cleanly — no duplicate entries. Account-level — full-access API key,
no X-Entity header.

Honors the account tag policy: under strict mode, renaming to a to tag outside
the preferred list returns 422 unless every affected check already carries it
(see Tag Policy).

Body:

Param Required Description
from Yes Current tag name
to Yes New tag name

Response result: { "affected": N } — count of checks that were updated.


POST /api/v1/monitoring/tags/merge

Collapses one or more source tags into a single target tag across all checks. Checks
that carry multiple source tags end up with a single target entry. Account-level —
full-access API key, no X-Entity header.

Honors the account tag policy: under strict mode, merging into an into tag outside
the preferred list returns 422 unless every affected check already carries it
(see Tag Policy). POST /api/v1/monitoring/tags/delete is unaffected.

Body:

Param Required Description
sources Yes Array of tag names to collapse
into Yes Target tag name

Response result: { "affected": N } — count of checks that were updated.


POST /api/v1/monitoring/reports

The simple report message: one small JSON body a job sends when it finishes, addressed to the
monitor’s uuid (from GET /api/v1/monitoring/checks/:name or the monitor page). Account-level:
a full-access API key, or a report-only key scoped to the monitor; no X-Entity header.

{
  "monitor": "2f9c4f7e-5d0b-4c39-9a51-0f8a2d6e7b13",
  "ok": false,
  "error": "Upstream timeout",
  "values": { "posts": 42 },
  "proof_url": "https://example.com/jobs/nightly/42",
  "report_id": "nightly-2026-11-07"
}
Field Required Description
monitor Yes The monitor’s uuid.
ok Yes true when the job worked, false when it failed. Must be a JSON boolean.
error No What went wrong, read only when ok is false. It becomes the run’s error message.
summary No One plain line that says what happened, for example Queue is empty. When the report leaves the monitor failing or warning, Glance shows its first 80 characters as the monitor’s summary. Without it, Glance writes the summary from error.
values No An object of at most 50 named values (keys of at most 64 characters). The monitor’s ranges judge them.
proof_url No An http or https page that shows the result. The run page and the monitor page link to it as “See proof”.
report_id No A stable id for this report. Sending the same report_id again for the same monitor returns the original run and repeats no side effects.
dry_run No true (in the body or as ?dry_run=true) judges the report and returns the result without saving anything.

Each report records one run, timed at the moment Glance receives it. ok: true records a
succeeded run; ok: false records a failed run.

Response result: run_id, report_id, run_status, the monitor’s uuid (as monitor) and
check name, and the monitor’s new status, status_label, reason and reason_code after this
report. replayed is true when the report_id was already recorded. With dry_run, dry_run is
true, run_id is null (nothing was saved), and status and reason are what the report would
produce.

Errors: a missing or malformed monitor, an ok that is not a boolean, values that is not an
object or holds more than 50 entries, or a proof_url that is not http or https returns 422
naming the field and writes nothing; its rules_url is
https://glnc.io/api/v1/monitoring/rules#report. An unknown uuid, another account’s monitor, or a monitor a
report-only key may not report to returns 404 Monitor not found. and writes nothing.


GET /api/v1/monitoring/rules

Every rule for creating, editing and reporting to monitors, in one read. Call it before writing a
monitor. Any valid API key may read it: full-access, read-only, entity-scoped or report-only. No
X-Entity header. Add ?format=md for the same content as Markdown (text/markdown).

Response result:

  • create — POST /api/v1/monitoring/checks: notes, then one entry per field create or update
    accepts, each with type, required, default, limits, example and description. Monitor
    fields come first, with model: true and the form’s label (source is the subcategory).
    applies_to says whether create, edit or both take a field; retired: true marks a field the API
    ignores.
  • edit — PUT /api/v1/monitoring/checks/:name: the fields update accepts (never name or uuid),
    each with when_omitted. An update replaces the configuration: an omitted field returns to its
    default except space, severity, notification_version and warning_delivery. Saving judges
    the latest report again at once.
  • report — POST /api/v1/monitoring/reports: the message fields, an example and the dry_run
    flag.
  • shared — the three questions in order (No report, Error, Out of range), the grace rule (percent
    10, minimum_seconds 300, maximum_seconds 3600), colors and severities, range rules 1–9 and the
    status sentence templates.
  • categories — the account’s existing categories, each with its subcategories, to reuse.

The content is built from the request schemas and constants the API validates with, so it changes
when they do.

Discovery (docs.monitoring_rules_url), /llms.txt, the OpenAPI document and the MCP tool
glance_get_monitoring_rules all point here. A monitoring 422 links one section with
rules_url: #create, #edit and #report are the sections of those names, and #range is
shared.ranges (in Markdown, the anchor before ### Range rules).

Errors: no key or an unknown key returns 401 with
{ "ok": false, "error": "Unauthorized", "key_management_url": "https://glnc.io/settings/api_keys" }.
A user whose admin has hidden Monitoring gets 403.


POST /api/v1/monitoring/checks/:check_name/runs

Reports one execution signal for a monitoring check. This endpoint is account-level:
send Authorization: Bearer <api_key> and no X-Entity header.

Preferred reports always use explicit result, stable report_id, observational evidence, optional
top-level findings, optional receipt assertion config_revision, and message. result never defaults
to success. Findings are bounded source observations only; do not supply Glance action, owner, urgency,
or status conclusions in findings or evidence. The reporter never changes configuration during reporting.

Optional field Description
source This Run’s caller-supplied reporting-channel label. Distinct from the Check’s source origin identity above and cannot change it.
host Optional self-reported host identifier; the reporting API key remains the authoritative origin.
{
  "result": "succeeded",
  "report_id": "catalog-import-2026-08-27",
  "message": "Catalog import completed.",
  "evidence": {
    "records_imported": 42
  },
  "findings": [
    {
      "key": "catalog_source",
      "label": "Catalog source",
      "error_code": "source_delayed",
      "message": "The upstream catalog arrived 12 minutes late.",
      "artifact": "catalog-feed",
      "occurrences": 1,
      "url": "https://status.example.test/catalog"
    }
  ],
  "config_revision": 7
}

status, metadata, summary, and error_message remain accepted deprecated compatibility aliases;
they are not the preferred contract. evidence and metadata cannot be combined. A stable report_id
makes keyed replays return the original immutable receipt and evaluation without repeating side effects.

Reserved evidence keys (status_summary, next_action, urgency, and the rest of the closed set)
produce a reserved_evidence_key warning in contract_warnings that names the key. This applies to
both shapes: preferred evidence and the legacy status plus metadata alias. A legacy report
carrying a reserved key is still accepted and its monitor’s status is identical to the same report
without the key; the warning is advisory. config_revision_mismatch stays preferred-only.

Send bounded diagnosis fields instead of a free-text status sentence: watched level, plus supporting
title (keep it to 48 characters or fewer) and detail. Declare all three in evidence_contract, then
watch level != "green" with headline: "{{title}}" and explanation_fields: ["detail"]. Carry the
“watch only, this can wait” intent in the rule’s attention_class (watch or maintenance) rather than
in prose or a reserved urgency key. A rule that references title or detail without those
declarations is rejected, so send the complete evidence_contract in the same configuration PUT.

Read the returned receipt, Outcome, evaluated_config_revision, contract_warnings, and triage. A
reporter’s config_revision is an assertion; the response’s evaluated_config_revision is authoritative.
For resolution, fix the source condition, submit a fresh verified preferred report, inspect its receipt and
Outcome, then re-read status. Never claim that a synthetic status-only report immediately resolves an incident.


GET /api/v1/monitoring/checks/:check_name/runs

Returns recent Runs for a check with preferred evidence and findings, plus deprecated compatibility
aliases such as metadata, summary, and error_message, verdict, Delivery
receipt, and evaluated Output expectations. Runs are newest-first by server-recorded arrival
(created_at), deliberately not by started_at: started_at is client-supplied
and may be backdated, so it cannot be allowed to steer which Run looks latest.
Account-level — full-access API key, no X-Entity header.

Query params:

Param Description
limit Maximum Runs to return; defaults to 20 and is capped at 100
since Optional ISO 8601 timestamp with a time component, such as 2026-07-28T00:00:00Z; filters to started_at >= since. A date-only value is rejected with 422.

Response:

{
  "ok": true,
  "command": "runs",
  "result": {
    "check": "nightly-scrape",
    "count": 1,
    "runs": [
      {
        "run_id": 123,
        "status": "succeeded",
        "started_at": "2026-07-28T04:00:00Z",
        "finished_at": "2026-07-28T04:00:42Z",
        "duration_seconds": 42,
        "summary": "Checked the nightly scrape.",
        "metadata": { "records_processed": 42 },
        "error_message": null,
        "verdict": { "status": "green", "reason_code": "healthy" },
        "receipt": { "id": "550e8400-e29b-41d4-a716-446655440000", "received_at": "2026-07-28T04:00:43Z", "state": "received" },
        "output_expectations": [
          {
            "field": "records_processed",
            "operator": "<",
            "value": 1,
            "severity": "critical",
            "aggregate": null,
            "window_hours": null,
            "actual": 42
          }
        ]
      }
    ]
  },
  "next_actions": []
}

GET /api/v1/monitoring/checks/:check_name/status_changes

Returns a check’s status-change timeline, newest-first by changed_at.
Account-level — full-access API key, no X-Entity header.

Query params:

Param Description
limit Maximum status changes to return; defaults to 20 and is capped at 100
since Optional ISO 8601 timestamp; filters to changed_at >= since

Response:

{
  "ok": true,
  "command": "status_changes",
  "result": {
    "check": "nightly-scrape",
    "count": 1,
    "status_changes": [
      {
        "from_status": "red",
        "to_status": "green",
        "reason": "Latest run passed",
        "reason_code": "healthy",
        "changed_at": "2026-07-28T04:00:43Z",
        "resolution_receipt": {
          "resolving_run_id": 123,
          "resolving_work_item_ref": "GLA-42",
          "resolution_note": "Restored the upstream connection."
        }
      }
    ]
  },
  "next_actions": []
}

resolution_receipt is null for an ordinary transition, a watchdog-only
recovery, and a Yellow→Green transition whose reason_code is watch. That
last case is a reclassification, not a recovery; do not interpret every green
transition as closing an incident.


POST /api/v1/monitoring/checks/:check_name/runs/complete

Completes a lifecycle run by its run_id or the same report_id used to start it.
It never guesses an open run and never creates a standalone terminal run when a start is missing.
Use the same preferred payload as reporting: explicit result, stable report_id, observational
evidence, optional findings and config_revision, plus a specific failure message when needed.
Legacy status, metadata, summary, and error_message remain deprecated compatibility aliases.


POST /api/v1/monitoring/checks/:check_name/runs/:id/complete

Completes a specific open lifecycle run. Already-terminal runs are returned unchanged,
so callers can safely retry after a network failure. Use the preferred report contract above;
legacy aliases remain accepted but deprecated. Account-level — full-access API key, no X-Entity header.


Work Item Shape

Full (returned by show, create, update, transition, escalate, note)

{
  "ref": "GLA-42",
  "title": "Fix login bug",
  "description": "Users cannot log in when ...",
  "tags": ["auth", "login"],
  "position": 3,
  "work_queue": { "slug": "GLA", "name": "Main Queue" },
  "current_stage": {
    "slug": "in-progress",
    "name": "In Progress",
    "stage_type": "middle",
    "instructions": "Implement the fix and open a PR.",
    "artifact_spec": { "required": true, "kind": "pr", "name": "pull_request" },
    "accepts_without_source_artifact": false
  },
  "claim": {
    "entity_slug": "my-agent",
    "emoji": "🤖",
    "claimed_at": "2025-01-01T10:00:00Z",
    "last_heartbeat_at": "2025-01-01T10:05:00Z",
    "state": "active",
    "pause_reason": null
  },
  "pr": {
    "number": 123,
    "url": "https://github.com/org/repo/pull/123",
    "status": "open",
    "merged_at": null
  },
  "attachments": [
    {
      "id": 1,
      "filename": "screenshot.png",
      "url": "https://...",
      "content_type": "image/png",
      "byte_size": 48320
    }
  ],
  "blocked": true,
  "blockers": [
    {
      "ref": "GLA-7",
      "title": "Add OAuth handler",
      "stage_slug": "review",
      "stage_type": "middle",
      "blocking": true
    }
  ],
  "prior_artifacts": [
    {
      "stage": "plan",
      "kind": "note",
      "name": "plan",
      "body": { "summary": "Approach: refactor the auth check first." },
      "produced_at": "2026-04-26T09:30:00Z",
      "produced_by": "my-agent"
    }
  ],
  "history": [
    { "type": "created",      "actor": "my-agent", "at": "2025-01-01T09:00:00Z" },
    { "type": "stage_change", "actor": "my-agent", "at": "2025-01-01T10:00:00Z", "from": "backlog", "to": "in-progress" },
    { "type": "artifact",     "actor": "my-agent", "at": "2026-04-26T09:30:00Z", "stage_slug": "plan", "kind": "note", "name": "plan", "body": {} }
  ]
}

History entries always have type, actor, and at. Any additional event-specific data is spread inline at the top level (not nested under data).

Event Types

type When emitted
created Work item created
stage_change Item moved to a different stage (data: from, to)
note Markdown note appended (data: markdown)
claimed Entity claimed the item
released Claim released
escalated Escalated to another entity (data: to, message)
pr_opened GitHub PR linked (data: pr_number, url)
pr_updated PR status changed (data: pr_number, url)
pr_merged PR merged (data: pr_number, url)
attachment_added File attached (data: filename, content_type)
attachment_removed File removed (data: filename, content_type)
artifact Stage artifact recorded (data: stage_slug, kind, name, body)
paused Claim was paused (data: reason)
resumed Claim was resumed
checkpointed Claim was flipped to awaiting_review via transition (data: from, to)
auto_released Claim was destroyed by a transition while in awaiting_review (data: from_state)

Slim (returned by index)

Same as full but without instructions, attachments, history, prior_artifacts, current_stage.artifact_spec, current_stage.accepts_without_source_artifact, and claim.emoji. Always includes blocked and blockers.

Blocked status

blocked is true when at least one entry in blockers has blocking: true (the blocker’s stage is non-terminal). When the last open blocker reaches a terminal stage, blocked flips to false and the item becomes claimable again.

GET /api/v1/next_work_item skips items where blocked: true — agents will not be handed actively-blocked work. The board UI displays a red ✕ on blocked cards with a hover tooltip listing each open blocker.

Each blocker row:

Field Description
ref Blocker’s friendly ref (e.g. GLA-7)
title Blocker’s title
stage_slug Blocker’s current stage slug
stage_type start, middle, or terminal
blocking true if stage_type != "terminal" (i.e. this entry is what’s holding the item back)

Stage Types

Type Meaning
start Items enter the queue here
middle Work in progress — any non-start, non-terminal stage
terminal Work is complete or closed

Typical Agent Loop

1. GET /api/v1/setup          — learn queue topology
2. GET /api/v1/next_work_item — claim a task
   → if null, sleep and retry
3. Read current_stage.instructions
4. Do the work
5. PATCH /:ref                — update description / pr_url as you go
   PATCH /:ref heartbeat:true — every ~60s to keep claim alive
6. POST /:ref/transition to:"next"  — advance when done
7. Go to step 2

If you get stuck, use POST /:ref/escalate to hand off to a human or supervisor agent.

Handling blocks mid-stage

When you are blocked on something out-of-band but expect to come back to the same work:

  • POST /:ref/pause { "reason": "..." } frees your cap slot but keeps the claim. Your heartbeat goes silent (no refresh) but the reaper will not kill the claim. Resume with POST /:ref/resume when unblocked.
  • POST /:ref/transition { "to": "...", "claim": "checkpoint" } advances the stage and flips your claim to awaiting_review. Use this when you have shipped what you can and need a human (or another entity) to take the next step. The parked claim does not count against your concurrency cap, so you may immediately call GET /api/v1/next_work_item to pick up the next item. The next transition by anyone destroys the parked claim automatically.

Monitoring Remediation Loop

When a check becomes Failing, glnc automatically opens a work item in the check’s configured
remediation_work_queue / remediation_stage. A Warning does not open one. A self-healing agent
follows these steps to claim the item, apply
the fix, and confirm the check is healthy again.

1. GET /api/v1/next_work_item              — claim the remediation work item
   → title: "Check failing: <display_name>"; description carries the check name,
     failure reason, last-run time, and a link to the monitoring dashboard
2. GET /api/v1/monitoring/checks/:name     — read the check's remediation field
   → result.remediation is the operator-authored fix note
     (full-access API key — no X-Entity header)
3. Apply the source fix
4. POST /api/v1/monitoring/checks/:check_name/runs with an explicit preferred
   `result`, stable `report_id`, observational `evidence`, and a fresh verified run
   → inspect the receipt and Outcome, then re-read `GET /api/v1/monitoring/status`
   before treating the incident as resolved
5. POST /api/v1/work_items/:ref/transition     { "to": "next", "claim": "release" }
   → the work item does NOT close when the check becomes Passing; advance it manually

Fix guidance vs. work item description

The check’s remediation field (step 2) is the operator-authored procedure: what to look at and
how to fix it. The work item description (auto-generated by glnc when the item is opened) carries
runtime context — failure reason, last-run time, dashboard link — not the fix procedure. Read
both: the work item description tells you what broke, the remediation field tells you how to
fix it.

Account-level endpoints in this loop

GET /api/v1/monitoring/checks/:name and POST /api/v1/monitoring/checks/:check_name/runs are
account-level: send a full-access Authorization: Bearer <api_key> and no
X-Entity header (same rule as all other monitoring endpoints).

Idempotency

While an open remediation item exists for a check, subsequent red states reuse it — glnc does not
create duplicates. A fresh item opens only after the previous one reaches a terminal stage or is
deleted. Disabled checks are skipped.

Glnc uses essential storage for the app. Optional analytics stay off unless you allow them.