---
title: "Get the attributes of a Bazel build."
method: GET
path: "/api/builds/{id}/bazel-attributes"
tags: ["Builds", "GradleEnterprise", "Develocity"]
---

# Get the attributes of a Bazel build.

`GET /api/builds/{id}/bazel-attributes`

## Request

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

This model is Bazel specific and cannot be requested for another build tool.

## Response `200`

The attributes of a Bazel build.

- BazelAttributes: The attributes of a Bazel build.
  - `id` string, required: The Build Scan ID.
  - `invocationId` string, nullable: The Bazel-provided build invocation ID. Null when not known.
  - `buildStartTime` integer, required: The time when the build starts, as milliseconds since Epoch.
  - `buildDuration` integer, required: The duration of the build, as milliseconds.
  - `bazelVersion` string, required: The Bazel version used.
  - `command` string, required: The Bazel command used (e.g. build, test, run).
  - `targetPatterns` string[]: The list of requested target patterns.
  - `exitCode` integer, nullable: The exit code of the Bazel process.
  - `user` string, nullable: The BUILD_USER workspace value, if set.
  - `host` string, nullable: The BUILD_HOST workspace value, if set.
  - `tags` string[], required: The list of Build Scan tags.
  - `values` BuildAttributesValue[], required: The list of Build Scan values.
    - `name` string, required: The name of the Build Scan value.
    - `value` string: The value of the Build Scan value. `null` if the Build Scan value is not set.
  - `links` BuildAttributesLink[], required: The list of Build Scan links.
    - `label` string, required: The label of the Build Scan link.
    - `url` string, required: The url of the Build Scan link.
  - `moduleName` string, nullable: The name of the module, or workspace. `null` in case of very early build failure.
  - `hasFailed` boolean, required: True when the build fails, false otherwise.

## 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)
