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
| Method | Endpoint | Description |
|---|---|---|
GET | /api/projects | List the active org's projects, each with its unresolved-issue count. |
POST | /api/projects | Create a project and mint its ingest key. |
GET | /api/projects/:id | Fetch one project. |
PATCH | /api/projects/:id | Rename a project. |
DELETE | /api/projects/:id | Delete a project and all its issues/events (cascade). |
POST | /api/projects/:id/rotate-key | Mint 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
| Method | Endpoint | Description |
|---|---|---|
PATCH | /api/issues/:id | Change status (resolve / ignore / reopen). |
DELETE | /api/issues/:id | Permanently 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
| Status | Meaning |
|---|---|
401 | unauthorized — not signed in. |
400 | no_active_organization — select or create an organization first. |
404 | not_found — resource is missing or not in your organization. |
422 | invalid_input — request body failed validation. |
500 | internal_error. |