# Read a build, waiting for it to finish

> Read build progress, active time and the finished tool, with optional long polling.

Source: https://docs.fous.com/api-reference/getBuild

`GET /v1/builds/{build_id}`

The build with its events and, once ready, its tool’s method and a verified example input. wait holds the answer up to that many seconds (170 at most) for the build to finish, so one call at a time follows it. Needs tools:read.

Authentication: `Authorization: Bearer $FOUS_API_KEY`.

## Path parameters

- `build_id` (string, required)

## Query parameters

- `wait` (integer): Seconds to wait for the build to finish before answering. Default 0.

## Response 200

Success

- `success` (true, required)
- `data` (Build, required): A build: from queued through exploring, compiling, verifying and publishing to ready, failed or cancelled. Once ready, api names the tool and method its operation; prepared_request carries an input the builder verified it with.

## Errors

Every error uses the Error schema: branch on `error.code`. Codes are listed at https://docs.fous.com/guides/errors.

- 400
- 401 (headers: WWW-Authenticate)
- 402
- 403
- 404
- 408
- 409
- 410
- 413
- 422
- 429 (headers: Retry-After)
- 500
- 502
- 503 (headers: Retry-After)
- 504

## Example request

```bash
curl 'https://api.fous.com/v1/builds/{build_id}?wait=170' \
  -H "Authorization: Bearer $FOUS_API_KEY"
```
