# 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` Build ID ### Query Parameters - `cursor: optional string` Pagination cursor from a previous response - `limit: optional number` Maximum number of diagnostics to return, defaults to 100 (maximum: 100) - `severity: optional "fatal" or "error" or "warning" or "note"` Includes the given severity and above (fatal > error > warning > note). - `"fatal"` - `"error"` - `"warning"` - `"note"` - `targets: optional string` Optional comma-delimited list of language targets to filter diagnostics by ### Returns - `data: array of BuildDiagnostic` - `code: string` The kind of diagnostic. - `ignored: boolean` Whether the diagnostic is ignored in the Stainless config. - `level: "fatal" or "error" or "warning" or "note"` The severity of the diagnostic. - `"fatal"` - `"error"` - `"warning"` - `"note"` - `message: string` A description of the diagnostic. - `more: BuildDiagnosticMore` - `Markdown = object { markdown, type }` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw = object { raw, type }` - `raw: string` - `type: "raw"` - `"raw"` - `config_ref: optional string` A JSON pointer to a relevant field in the Stainless config. - `oas_ref: optional string` A JSON pointer to a relevant field in the OpenAPI spec. - `has_more: boolean` - `next_cursor: optional string` ### Example ```http curl https://api.stainless.com/v0/builds/$BUILD_ID/diagnostics \ -H "Authorization: Bearer $STAINLESS_API_KEY" ``` #### Response ```json { "data": [ { "code": "code", "ignored": true, "level": "fatal", "message": "message", "more": { "markdown": "markdown", "type": "markdown" }, "config_ref": "config_ref", "oas_ref": "oas_ref" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Domain Types ### Build Diagnostic - `BuildDiagnostic = object { code, ignored, level, 4 more }` - `code: string` The kind of diagnostic. - `ignored: boolean` Whether the diagnostic is ignored in the Stainless config. - `level: "fatal" or "error" or "warning" or "note"` The severity of the diagnostic. - `"fatal"` - `"error"` - `"warning"` - `"note"` - `message: string` A description of the diagnostic. - `more: BuildDiagnosticMore` - `Markdown = object { markdown, type }` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw = object { raw, type }` - `raw: string` - `type: "raw"` - `"raw"` - `config_ref: optional string` A JSON pointer to a relevant field in the Stainless config. - `oas_ref: optional string` A JSON pointer to a relevant field in the OpenAPI spec. ### Build Diagnostic More - `BuildDiagnosticMore = object { markdown, type } or object { raw, type }` - `Markdown = object { markdown, type }` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw = object { raw, type }` - `raw: string` - `type: "raw"` - `"raw"`