> For the complete documentation index, see [llms.txt](https://docs.release.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.release.com/reference-documentation/release-api/platform-api/builds.md).

# Builds

Trigger and monitor Docker image builds for your Release applications.

Base URL: `https://api.release.com`

***

## List Builds

Retrieve a paginated list of builds for a given app.

#### Endpoint

<mark style="color:green;">`GET`</mark> `/apps/{appId}/builds`

#### Authentication

Authenticate using headers from your `~/.release.yaml` file. To set this up, [install the Release CLI](/cli/installation.md) and run `release auth login`.

| Header       | Description                                       |
| ------------ | ------------------------------------------------- |
| X-User-Email | User email from `~/.release.yaml` (`login` field) |
| X-User-Token | User token from `~/.release.yaml` (`token` field) |

#### Headers

| Header | Value              | Required |
| ------ | ------------------ | -------- |
| Accept | `application/json` | Yes      |

#### Path Parameters

| Parameter | Type              | Required | Description                      |
| --------- | ----------------- | -------- | -------------------------------- |
| appId     | `string (hashid)` | Yes      | The unique identifier of the app |

#### Pagination

| Parameter | Type      | Default | Description      |
| --------- | --------- | ------- | ---------------- |
| page      | `integer` | 1       | Page number      |
| per\_page | `integer` | 25      | Results per page |

#### Status Codes

| Status | Description                                              |
| ------ | -------------------------------------------------------- |
| 200    | Successfully retrieved builds                            |
| 401    | Unauthorized — invalid or missing authentication headers |
| 404    | App not found                                            |

#### Example Responses

**200 OK**

```json
{
  "total_count": 48,
  "items": [
    {
      "id": "xk9m2v",
      "aasm_state": "done",
      "branch": "main",
      "commit_short": "a1b2c3d",
      "total_duration": 182.5,
      "started_at": "2025-06-01T12:00:00Z"
    },
    {
      "id": "pl3n8w",
      "aasm_state": "running",
      "branch": "feature/auth",
      "commit_short": "e4f5g6h",
      "total_duration": null,
      "started_at": "2025-06-01T12:30:00Z"
    }
  ]
}
```

***

## Trigger Build

Trigger a new build for a specific app.

#### Endpoint

<mark style="color:green;">`POST`</mark> `/apps/{appId}/builds`

#### Authentication

Authenticate using headers from your `~/.release.yaml` file. To set this up, [install the Release CLI](/cli/installation.md) and run `release auth login`.

| Header       | Description                                       |
| ------------ | ------------------------------------------------- |
| X-User-Email | User email from `~/.release.yaml` (`login` field) |
| X-User-Token | User token from `~/.release.yaml` (`token` field) |

#### Headers

| Header       | Value              | Required |
| ------------ | ------------------ | -------- |
| Content-Type | `application/json` | Yes      |
| Accept       | `application/json` | Yes      |

#### Path Parameters

| Parameter | Type              | Required | Description                      |
| --------- | ----------------- | -------- | -------------------------------- |
| appId     | `string (hashid)` | Yes      | The unique identifier of the app |

#### Status Codes

| Status | Description                                              |
| ------ | -------------------------------------------------------- |
| 201    | Build successfully triggered                             |
| 401    | Unauthorized — invalid or missing authentication headers |
| 404    | App not found                                            |

#### Example Responses

**201 Created**

```json
{
  "id": "rm4k7q",
  "aasm_state": "queued",
  "branch": "main",
  "commit_short": "b2c3d4e",
  "total_duration": null,
  "started_at": null
}
```

***

## Get Build

Retrieve details for a specific build.

#### Endpoint

<mark style="color:green;">`GET`</mark> `/apps/{appId}/builds/{buildId}`

#### Authentication

Authenticate using headers from your `~/.release.yaml` file. To set this up, [install the Release CLI](/cli/installation.md) and run `release auth login`.

| Header       | Description                                       |
| ------------ | ------------------------------------------------- |
| X-User-Email | User email from `~/.release.yaml` (`login` field) |
| X-User-Token | User token from `~/.release.yaml` (`token` field) |

#### Headers

| Header | Value              | Required |
| ------ | ------------------ | -------- |
| Accept | `application/json` | Yes      |

#### Path Parameters

| Parameter | Type              | Required | Description                        |
| --------- | ----------------- | -------- | ---------------------------------- |
| appId     | `string (hashid)` | Yes      | The unique identifier of the app   |
| buildId   | `string (hashid)` | Yes      | The unique identifier of the build |

#### Status Codes

| Status | Description                                              |
| ------ | -------------------------------------------------------- |
| 200    | Successfully retrieved build                             |
| 401    | Unauthorized — invalid or missing authentication headers |
| 404    | Build not found                                          |

#### Response Body

| Field           | Type                        | Description                                    |
| --------------- | --------------------------- | ---------------------------------------------- |
| id              | `string (hashid)`           | Build identifier                               |
| aasm\_state     | `string`                    | One of: `queued`, `running`, `done`, `errored` |
| branch          | `string`                    | Branch name for the build                      |
| commit\_short   | `string`                    | Abbreviated commit SHA                         |
| total\_duration | `number or null`            | Duration in seconds                            |
| started\_at     | `string (ISO 8601) or null` | When the build started                         |

#### Example Responses

**200 OK**

```json
{
  "id": "xk9m2v",
  "aasm_state": "done",
  "branch": "main",
  "commit_short": "a1b2c3d",
  "total_duration": 182.5,
  "started_at": "2025-06-01T12:00:00Z"
}
```

***

## State Lifecycle

`queued` → `running` → `done` | `errored`

| State     | Description                          |
| --------- | ------------------------------------ |
| `queued`  | Build is queued and waiting to start |
| `running` | Build is currently executing         |
| `done`    | Build completed successfully         |
| `errored` | Build failed with errors             |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.release.com/reference-documentation/release-api/platform-api/builds.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
