Management API

These endpoints power the dashboard. They authenticate with your Clerk session and are scoped to your active organization — every response only ever contains data from that one tenant.

From a browser the session cookie is sent automatically. For programmatic access, pass a Clerk session token as Authorization: Bearer <token>.

Projects

MethodEndpointDescription
GET/api/projectsList the active org's projects, each with its unresolved-issue count.
POST/api/projectsCreate a project and mint its ingest key.
GET/api/projects/:idFetch one project.
PATCH/api/projects/:idRename a project.
DELETE/api/projects/:idDelete a project and all its issues/events (cascade).
POST/api/projects/:id/rotate-keyMint a fresh ingest key; the old one stops working immediately.

Create a project:

curl -X POST https://your-metricly.app/api/projects \
  -H "Content-Type: application/json" \
  -d '{ "name": "checkout-api", "platform": "node" }'

platform is one of node, javascript, python, go, ruby, php, java, dotnet, other (default other). Rotating a key returns { "ingestKey": "mtr_..." }.

Issues

MethodEndpointDescription
PATCH/api/issues/:idChange status (resolve / ignore / reopen).
DELETE/api/issues/:idPermanently delete an issue and its events.
curl -X PATCH https://your-metricly.app/api/issues/clz9x1a2b... \
  -H "Content-Type: application/json" \
  -d '{ "status": "RESOLVED" }'

The status field must be one of UNRESOLVED, RESOLVED, or IGNORED.

Error codes

StatusMeaning
401unauthorized — not signed in.
400no_active_organization — select or create an organization first.
404not_found — resource is missing or not in your organization.
422invalid_input — request body failed validation.
500internal_error.