---
title: "Get the failures of a build."
method: GET
path: "/api/failures/builds/{id}"
tags: ["Failures", "Develocity"]
---

# Get the failures of a build.

`GET /api/failures/builds/{id}`

## Request

- Base URL: `https://develocity.example.com`
- URL: `https://develocity.example.com/api/failures/builds/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/develocity/apis/develocity-api/docs/api/failures/builds/:id/get.ts> (a function with typed inputs; its response is checked against the schema)

**<mark>Beta:</mark>** Returns the failures of a build, organized by build tool (Gradle, Maven, npm).
The response structure includes nested objects for each build tool containing their respective failures.

## Response `200`

The failures of a build.

- BuildFailures: The unified failures response for a build, containing build tool-specific failure information. Each build tool (gradle, maven, npm) has its own nested object with failures if applicable for that build.
  - `buildToolType` string, required: The build tool type of the build.
  - `gradle` GradleFailures, nullable: The build and test failures of a Gradle build. `null` if the build is not a Gradle build.
    - `buildFailures` GradleBuildFailure[]: A list of build failures.
      - `header` string, required: Failure header.
      - `message` string, required: Failure message.
      - `relevantLog` string, nullable: Relevant console log. `null` if no relevant console log has been found.
      - `location` string, nullable: Failure location, which can be a build script or source file. `null` when the failure is not location aware.
      - `taskPath` string, nullable: The task path associated with this failure. `null` if no task is associated with the failure.
      - `stacktrace` string, nullable: The stacktrace of this failure. `null` if there is no stacktrace available.
    - `testFailures` TestFailure[], nullable: A list of test failures. `null` if tests are not captured.
      - `id` TestId, required: Information required to uniquely identify a test.
        - `workUnitName` string, required: Work unit name that executed the test.
        - `suiteName` string, required: Suite name of the test, in most cases the class name.
        - `testName` string, nullable: Name of the test. `null` when the test is a suite.
      - `message` string, required: Failure message.
      - `stacktrace` string, nullable: The failure stacktrace. `null` if there is no stacktrace available.
  - `maven` MavenFailures, nullable: The build and test failures of a Maven build. `null` if the build is not a Maven build.
    - `buildFailures` MavenBuildFailure[]: A list of build failures.
      - `header` string, required: Failure header.
      - `message` string, required: Failure message.
      - `relevantLog` string, nullable: Relevant console log. `null` if no relevant console log has been found.
      - `goalExecutionId` string, nullable: The goal execution id associated with this failure. `null` if no goal execution is associated with the failure.
      - `stacktrace` string, nullable: The stacktrace of this failure. `null` if there is no stacktrace available.
    - `testFailures` TestFailure[], nullable: A list of test failures. `null` if tests are not captured.
      - `id` TestId, required: Information required to uniquely identify a test.
        - `workUnitName` string, required: Work unit name that executed the test.
        - `suiteName` string, required: Suite name of the test, in most cases the class name.
        - `testName` string, nullable: Name of the test. `null` when the test is a suite.
      - `message` string, required: Failure message.
      - `stacktrace` string, nullable: The failure stacktrace. `null` if there is no stacktrace available.
  - `npm` NpmFailures, nullable: The build and test failures of an npm build. `null` if the build is not an npm build.
    - `buildFailures` NpmBuildFailure[]: A list of build failures.
      - `header` string, required: Failure header.
      - `message` string, required: Failure message.
      - `relevantLog` string, nullable: Relevant console log. `null` if no relevant console log has been found.
      - `processName` string: The full process name (executable name and parameters) for which this failure was detected.
      - `stacktrace` string, nullable: The stacktrace of this failure. `null` if there is no stacktrace available.
    - `testFailures` TestFailure[], nullable: A list of test failures. `null` if tests are not captured.
      - `id` TestId, required: Information required to uniquely identify a test.
        - `workUnitName` string, required: Work unit name that executed the test.
        - `suiteName` string, required: Suite name of the test, in most cases the class name.
        - `testName` string, nullable: Name of the test. `null` when the test is a suite.
      - `message` string, required: Failure message.
      - `stacktrace` string, nullable: The failure stacktrace. `null` if there is no stacktrace available.

## Other responses

- `400`: The request cannot be fulfilled due to a problem.
- `404`: The referenced resource either does not exist or the permissions to know about it are missing.
- `500`: The server encountered an unexpected error.
- `503`: The server is not ready to handle the request.

---

[API](https://skmtc.dev/develocity/apis/develocity-api.md) - [All operations](https://skmtc.dev/develocity/apis/develocity-api/llms.txt) - [OpenAPI document](https://skmtc.dev/develocity/apis/develocity-api/revisions/b49835fbf065?raw)
