---
title: "New build - the pipeline builds a branch's head as Pando has it"
description: "Any member. The branch's head comes from Pando's stored heads (no\nref read); its commit's title (one Artifacts read) is the build's\nmessage. Started as a push delivery starts one: a read token for the\nrepo and a status token for the commit, both fresh. The build is\nrecorded at once; its webhooks update it. `?connection=` picks the\npipeline when two connections share its slug.\n"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.gitpando.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Pando API › ci

`POST /v1/monorepos/{owner}/{monorepo}/ci/pipelines/{pipeline}/builds`

Any member. The branch's head comes from Pando's stored heads (no
ref read); its commit's title (one Artifacts read) is the build's
message. Started as a push delivery starts one: a read token for the
repo and a status token for the commit, both fresh. The build is
recorded at once; its webhooks update it. `?connection=` picks the
pipeline when two connections share its slug.

## Authentication

Requires one of the following:

- `credential`, http, header `Authorization`
- `session`, apiKey, in cookie

## Path parameters

- `startCiBuild.path.owner` (string, required) — The monorepo's owner, a namespace (a person's login or an organization). Matched without case.
  - pattern `^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,38}$`
- `startCiBuild.path.monorepo` (string, required) — The monorepo's name within its owner (or an old name). Matched without case.
  - pattern `^[a-z0-9](?:[a-z0-9._]|-(?!-)){0,38}$`
- `startCiBuild.path.pipeline` (string, required)

## Query parameters

- `startCiBuild.query.connection` (string, optional)

## Request body

_Optional._

- `startCiBuild.branch` (string, optional) — Default: the repo's default branch.

## Example request

```json
{
  "branch": "string"
}
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://app.gitpando.com/v1/monorepos/string/string/ci/pipelines/string/builds \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "branch": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://app.gitpando.com/v1/monorepos/string/string/ci/pipelines/string/builds';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({branch: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.gitpando.com/v1/monorepos/string/string/ci/pipelines/string/builds"

payload = { "branch": "string" }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Started

#### Example

```json
{
  "build": {
    "id": "string",
    "service": "string",
    "connection": "string",
    "pipeline": "string",
    "number": 0,
    "repo": "string",
    "repo_path": "string",
    "sha": "string",
    "branch": "string",
    "message": "string",
    "state": "queued",
    "service_state": "string",
    "web_url": "string",
    "pushed_by": "string",
    "created_at": "2019-08-24T14:15:22Z",
    "started_at": "2019-08-24T14:15:22Z",
    "finished_at": "2019-08-24T14:15:22Z",
    "duration_s": 0,
    "rebuilt_from": "string",
    "jobs": [
      {
        "id": "string",
        "build": "string",
        "name": "string",
        "step_key": "string",
        "type": "string",
        "state": "queued",
        "service_state": "string",
        "exit_status": 0,
        "soft_failed": true,
        "retried": true,
        "web_url": "string",
        "created_at": "2019-08-24T14:15:22Z",
        "started_at": "2019-08-24T14:15:22Z",
        "finished_at": "2019-08-24T14:15:22Z",
        "duration_s": 0,
        "check": "string"
      }
    ]
  }
}
```

- `startCiBuild.response.201.build` (one of, required) — The build as Pando now has it, with its jobs; null if the service's answer named none.
  - one of: `object`, `null`

### 400

An error

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "paths": [
      "string"
    ],
    "checks": {
      "sha": "string",
      "state": "success",
      "required": [
        "string"
      ],
      "checks_unknown": "string",
      "missing": [
        "string"
      ],
      "statuses": [
        {
          "sha": "string",
          "context": "string",
          "state": "pending",
          "target_url": "string",
          "description": "string",
          "creator": "string",
          "app": "string",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  }
}
```

- `startCiBuild.response.400.error` (object, required)
  - `startCiBuild.response.400.error.code` (string, required)
  - `startCiBuild.response.400.error.message` (string, required)
  - `startCiBuild.response.400.error.paths` (array<string>, optional)
  - `startCiBuild.response.400.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `startCiBuild.response.400.error.checks.sha` (string | null, required)
    - `startCiBuild.response.400.error.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
      - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
    - `startCiBuild.response.400.error.checks.required` (array | null, required) — Null while unknown.
    - `startCiBuild.response.400.error.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
    - `startCiBuild.response.400.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `startCiBuild.response.400.error.checks.statuses.sha` (string, required)
      - `startCiBuild.response.400.error.checks.statuses.context` (string, required)
      - `startCiBuild.response.400.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `startCiBuild.response.400.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `startCiBuild.response.400.error.checks.statuses.target_url` (string | null, optional)
      - `startCiBuild.response.400.error.checks.statuses.description` (string | null, optional)
      - `startCiBuild.response.400.error.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
      - `startCiBuild.response.400.error.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
    - `startCiBuild.response.400.error.checks.missing` (array<string>, optional)

### 404

No such pipeline, or no such branch (or it has no recorded head yet).

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "paths": [
      "string"
    ],
    "checks": {
      "sha": "string",
      "state": "success",
      "required": [
        "string"
      ],
      "checks_unknown": "string",
      "missing": [
        "string"
      ],
      "statuses": [
        {
          "sha": "string",
          "context": "string",
          "state": "pending",
          "target_url": "string",
          "description": "string",
          "creator": "string",
          "app": "string",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  }
}
```

- `startCiBuild.response.404.error` (object, required)
  - `startCiBuild.response.404.error.code` (string, required)
  - `startCiBuild.response.404.error.message` (string, required)
  - `startCiBuild.response.404.error.paths` (array<string>, optional)
  - `startCiBuild.response.404.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `startCiBuild.response.404.error.checks.sha` (string | null, required)
    - `startCiBuild.response.404.error.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
      - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
    - `startCiBuild.response.404.error.checks.required` (array | null, required) — Null while unknown.
    - `startCiBuild.response.404.error.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
    - `startCiBuild.response.404.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `startCiBuild.response.404.error.checks.statuses.sha` (string, required)
      - `startCiBuild.response.404.error.checks.statuses.context` (string, required)
      - `startCiBuild.response.404.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `startCiBuild.response.404.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `startCiBuild.response.404.error.checks.statuses.target_url` (string | null, optional)
      - `startCiBuild.response.404.error.checks.statuses.description` (string | null, optional)
      - `startCiBuild.response.404.error.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
      - `startCiBuild.response.404.error.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
    - `startCiBuild.response.404.error.checks.missing` (array<string>, optional)

### 409

`no_repo`: the pipeline builds no repo of this monorepo (register it with a buildkite hook).

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "paths": [
      "string"
    ],
    "checks": {
      "sha": "string",
      "state": "success",
      "required": [
        "string"
      ],
      "checks_unknown": "string",
      "missing": [
        "string"
      ],
      "statuses": [
        {
          "sha": "string",
          "context": "string",
          "state": "pending",
          "target_url": "string",
          "description": "string",
          "creator": "string",
          "app": "string",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  }
}
```

- `startCiBuild.response.409.error` (object, required)
  - `startCiBuild.response.409.error.code` (string, required)
  - `startCiBuild.response.409.error.message` (string, required)
  - `startCiBuild.response.409.error.paths` (array<string>, optional)
  - `startCiBuild.response.409.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `startCiBuild.response.409.error.checks.sha` (string | null, required)
    - `startCiBuild.response.409.error.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
      - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
    - `startCiBuild.response.409.error.checks.required` (array | null, required) — Null while unknown.
    - `startCiBuild.response.409.error.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
    - `startCiBuild.response.409.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `startCiBuild.response.409.error.checks.statuses.sha` (string, required)
      - `startCiBuild.response.409.error.checks.statuses.context` (string, required)
      - `startCiBuild.response.409.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `startCiBuild.response.409.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `startCiBuild.response.409.error.checks.statuses.target_url` (string | null, optional)
      - `startCiBuild.response.409.error.checks.statuses.description` (string | null, optional)
      - `startCiBuild.response.409.error.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
      - `startCiBuild.response.409.error.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
    - `startCiBuild.response.409.error.checks.missing` (array<string>, optional)

### 503

An error

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "paths": [
      "string"
    ],
    "checks": {
      "sha": "string",
      "state": "success",
      "required": [
        "string"
      ],
      "checks_unknown": "string",
      "missing": [
        "string"
      ],
      "statuses": [
        {
          "sha": "string",
          "context": "string",
          "state": "pending",
          "target_url": "string",
          "description": "string",
          "creator": "string",
          "app": "string",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  }
}
```

- `startCiBuild.response.503.error` (object, required)
  - `startCiBuild.response.503.error.code` (string, required)
  - `startCiBuild.response.503.error.message` (string, required)
  - `startCiBuild.response.503.error.paths` (array<string>, optional)
  - `startCiBuild.response.503.error.checks` (object, optional) — GitHub's combined status, plus the required contexts and which are missing.
    - `startCiBuild.response.503.error.checks.sha` (string | null, required)
    - `startCiBuild.response.503.error.checks.state` (string, required) — `success` when the merge gate passes; `missing` when a required context has not reported; `unknown` while the required checks are (an unforced merge is refused).
      - one of `"success"`, `"pending"`, `"failure"`, `"error"`, `"missing"`, `"unknown"`
    - `startCiBuild.response.503.error.checks.required` (array | null, required) — Null while unknown.
    - `startCiBuild.response.503.error.checks.checks_unknown` (string | null, required) — Why the required checks are unknown, in plain words: "Pando couldn't read this monorepo's required checks; try again", or "pando.toml line 3: expected comma or end of structure; fix it on main, or merge with force". Null otherwise.
    - `startCiBuild.response.503.error.checks.statuses` (array<object>, required) — The latest status per context.
      - `startCiBuild.response.503.error.checks.statuses.sha` (string, required)
      - `startCiBuild.response.503.error.checks.statuses.context` (string, required)
      - `startCiBuild.response.503.error.checks.statuses.state` (string, required)
        - one of `"pending"`, `"success"`, `"failure"`, `"error"`
      - `startCiBuild.response.503.error.checks.statuses.created_at` (string, required)
        - format `date-time`
      - `startCiBuild.response.503.error.checks.statuses.target_url` (string | null, optional)
      - `startCiBuild.response.503.error.checks.statuses.description` (string | null, optional)
      - `startCiBuild.response.503.error.checks.statuses.creator` (string, optional) — The member who posted it (a login); `app:<slug>` for a status posted with a status token or by a CI integration; `hook:<hook id>` for a status token from a web hook with no app.
      - `startCiBuild.response.503.error.checks.statuses.app` (string | null, optional) — The CI service that reported it (`buildkite`, `github-actions`, ...), stamped by Pando from a status token or a CI integration, never from the body or `target_url`. Null when a member posted it with their own credential. The web shows the service's mark for a slug it knows.
    - `startCiBuild.response.503.error.checks.missing` (array<string>, optional)


Source: https://docs.gitpando.com/api/ci/startCiBuild/index.md
