---
title: "Get diagnostics for a build"
method: GET
path: "/v0/builds/{buildId}/diagnostics"
---

# Get diagnostics for a build

`GET /v0/builds/{buildId}/diagnostics`

Get the list of diagnostics for a given build.

If no language targets are specified, diagnostics for all languages are returned.

## Path parameters

- `buildId` string, required — Build ID

## Query parameters

- `targets` string — Optional comma-delimited list of language targets to filter diagnostics by
- `severity` 'fatal' | 'error' | 'warning' | 'note' — Includes the given severity and above (fatal > error > warning > note).
- `cursor` string — Pagination cursor from a previous response
- `limit` number — Maximum number of diagnostics to return, defaults to 100 (maximum: 100)

## Response `200`

success

- object
  - `data` BuildDiagnostic[], required
    - `code` string, required — The kind of diagnostic.
    - `level` 'fatal' | 'error' | 'warning' | 'note', required — The severity of the diagnostic.
    - `ignored` boolean, required — Whether the diagnostic is ignored in the Stainless config.
    - `message` string, required — A description of the diagnostic.
    - `more` union, required
      - object
        - `type` 'markdown', required
        - `markdown` string, required
      - object
        - `type` 'raw', required
        - `raw` string, required
    - `oas_ref` string — A JSON pointer to a relevant field in the OpenAPI spec.
    - `config_ref` string — A JSON pointer to a relevant field in the Stainless config.
  - `has_more` boolean, required
  - `next_cursor` string

## Changes

- **2025-12-09** `36086d31791d` — 1 info
  - for the `query` request parameter `targets`, the type/format was generalized from `array`/`` to `string`/``
- **2025-09-20** `5c1008fd27f6` — 1 info
  - added the required property `data/items/more` to the response with the `200` status
- **2025-07-07** `f8b160dfac6c` — 2 breaking, 6 info
  - for the `query` request parameter `limit`, default value was changed from `10` to `100`
  - the `data/items/` response's property type/format changed from ``/`` to `object`/`` for status `200`
  - added the optional property `data/items/config_ref` to the response with the `200` status
  - added the optional property `data/items/oas_ref` to the response with the `200` status
  - …4 more

[Change history](https://skmtc.dev/stainless-api/apis/my-api/changes/v0/builds/:buildId/diagnostics/get.md)

---

[API](https://skmtc.dev/stainless-api/apis/my-api.md) · [All operations](https://skmtc.dev/stainless-api/apis/my-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/stainless-api/my-api/revisions/1d73a351f557/schema)
