API and MCP
Data health
How complete and how recent each subject's analysis runs are, the run history, and lookup of an id printed in a pipeline log
Resolve an id
GET /api/v1/project/{projectId}/v1/data-health/resolve
Credentials: API token or dashboard sign-in.
Looks up an identifier printed in a pipeline log, given in the ref query parameter: a run id, a step id, an upload id, an idempotency key, a subject tag or a CI run id, tried in that order. The answer says what it is (kind is run, step or subject), which kind of id it matched, the run_id or subject, and a deep_link to it. Requires project:portfolio:view.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) | The project's id. |
ref required | query | string | Run, step, upload or CI run ID, idempotency key, or subject tag |
Responses
| Status | Description | Body |
|---|---|---|
200 | What the id resolved to. | ResolveResponse |
400 | ref is missing or blank. | Error |
401 | The token is missing, expired, revoked or of the wrong kind. | Error |
403 | The token is valid but not allowed to do this. | Error |
404 | Nothing matched; the message lists what was searched. | Error |
500 | A fault on our side. | Error |
503 | The project's data is temporarily unreachable; code says why. | Error |
Example
curl -X GET "https://api.spicelabs.io/api/v1/project/<projectId>/v1/data-health/resolve?ref=<ref>" \
-H "Authorization: Bearer $SPICE_API_TOKEN" List analysis runs
GET /api/v1/project/{projectId}/v1/data-health/run
Credentials: API token or dashboard sign-in.
The project's survey runs, each with its outcome, the class of any failure, the CI run it came from when the upload said so, and its completeness record. Filter with the subject and status query parameters; showDeleted=true includes deleted surveys. Page with limit, sortDir (asc or desc, default desc) and the after or before cursor from the answer's pagination. Requires project:portfolio:view.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) | The project's id. |
subject | query | string | Only runs of this subject |
status | query | string | Only runs in this status: PENDING, RUNNING, COMPLETED, FAILED or SKIPPED (any case) |
showDeleted | query | boolean | Include deleted surveys (default false) |
limit | query | integer (int64) | Page size, 1 to 10000 (default 1000) |
sortDir | query | string | asc or desc (default desc) |
after | query | string | Run ID cursor: rows after it. Not together with before |
before | query | string | Run ID cursor: rows before it. Not together with after |
Responses
| Status | Description | Body |
|---|---|---|
200 | A page of runs under runs, with pagination cursors. | RunsResponse |
400 | A filter, limit, sortDir or cursor is invalid. | Error |
401 | The token is missing, expired, revoked or of the wrong kind. | Error |
403 | The token is valid but not allowed to do this. | Error |
404 | Portfolios are not set up for this project yet. | Error |
500 | A fault on our side. | Error |
503 | The project's data is temporarily unreachable; code says why. | Error |
Example
curl -X GET "https://api.spicelabs.io/api/v1/project/<projectId>/v1/data-health/run" \
-H "Authorization: Bearer $SPICE_API_TOKEN" Get data health summary
GET /api/v1/project/{projectId}/v1/data-health/summary
Credentials: API token or dashboard sign-in.
One row per subject: how recently it was analysed, which kinds of evidence have run, the outcome of its latest run, and how complete that run was against the one before. Requires project:portfolio:view.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
projectId required | path | string (uuid) | The project's id. |
Responses
| Status | Description | Body |
|---|---|---|
200 | The per-subject rows under subjects, with generated_at. | SummaryResponse |
401 | The token is missing, expired, revoked or of the wrong kind. | Error |
403 | The token is valid but not allowed to do this. | Error |
404 | Portfolios are not set up for this project yet. | Error |
500 | A fault on our side. | Error |
503 | The project's data is temporarily unreachable; code says why. | Error |
Example
curl -X GET "https://api.spicelabs.io/api/v1/project/<projectId>/v1/data-health/summary" \
-H "Authorization: Bearer $SPICE_API_TOKEN"