Harmont docs

Builds

A build is one run of a pipeline. Each build has a number unique within its pipeline (the URL key) and a stable id UUID. Its aggregate state — scheduled, running, passed, failed, canceled, skipped — rolls up from the states of its jobs.

These endpoints trigger a build, read it, cancel a running one, list its artifacts, and mint the short-lived token the browser uses to stream live logs. The jobs that make up a build live under Jobs.

Create a build by repo + source slug

POST
/api/v0/organizations/{org}/builds
AuthorizationBearer <token>

A Harmont session bearer token.

In: header

Path Parameters

org*string

The organization slug.

Request Body

application/json

Build attributes

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.harmont.dev/api/v0/organizations/string/builds" \  -H "Content-Type: application/json" \  -d '{    "branch": "string",    "commit": "string",    "repo_name": "string",    "source_slug": "string"  }'
{
  "branch": "string",
  "commit": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "error_code": "string",
  "error_message": "string",
  "finished_at": "2019-08-24T14:15:22Z",
  "message": "string",
  "number": 0,
  "pipeline_slug": "string",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "source": "string",
  "started_at": "2019-08-24T14:15:22Z",
  "state": "scheduled"
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}

List a pipeline's builds

GET
/api/v0/organizations/{org}/pipelines/{pipeline}/builds
AuthorizationBearer <token>

A Harmont session bearer token.

In: header

Path Parameters

org*string

The organization slug.

pipeline*string

The pipeline slug.

Query Parameters

limit?integer

Page size (1–100, default 50).

cursor?string

Opaque cursor from a previous page's next_cursor.

Response Body

application/json

application/json

curl -X GET "https://api.harmont.dev/api/v0/organizations/string/pipelines/string/builds"
{
  "data": [
    {
      "branch": "string",
      "commit": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "error_code": "string",
      "error_message": "string",
      "finished_at": "2019-08-24T14:15:22Z",
      "message": "string",
      "number": 0,
      "pipeline_slug": "string",
      "scheduled_at": "2019-08-24T14:15:22Z",
      "source": "string",
      "started_at": "2019-08-24T14:15:22Z",
      "state": "scheduled"
    }
  ],
  "next_cursor": "string"
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}

Create a build

POST
/api/v0/organizations/{org}/pipelines/{pipeline}/builds
AuthorizationBearer <token>

A Harmont session bearer token.

In: header

Path Parameters

org*string

The organization slug.

pipeline*string

The pipeline slug.

Request Body

application/json

Build attributes

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.harmont.dev/api/v0/organizations/string/pipelines/string/builds" \  -H "Content-Type: application/json" \  -d '{    "branch": "string",    "commit": "string"  }'
{
  "branch": "string",
  "commit": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "error_code": "string",
  "error_message": "string",
  "finished_at": "2019-08-24T14:15:22Z",
  "message": "string",
  "number": 0,
  "pipeline_slug": "string",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "source": "string",
  "started_at": "2019-08-24T14:15:22Z",
  "state": "scheduled"
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}

Get a build

GET
/api/v0/organizations/{org}/pipelines/{pipeline}/builds/{number}
AuthorizationBearer <token>

A Harmont session bearer token.

In: header

Path Parameters

org*string

The organization slug.

pipeline*string

The pipeline slug.

number*integer

The build number.

Response Body

application/json

application/json

curl -X GET "https://api.harmont.dev/api/v0/organizations/string/pipelines/string/builds/0"
{
  "branch": "string",
  "commit": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "error_code": "string",
  "error_message": "string",
  "finished_at": "2019-08-24T14:15:22Z",
  "message": "string",
  "number": 0,
  "pipeline_slug": "string",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "source": "string",
  "started_at": "2019-08-24T14:15:22Z",
  "state": "scheduled"
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}

Cancel a build

PUT
/api/v0/organizations/{org}/pipelines/{pipeline}/builds/{number}/cancel
AuthorizationBearer <token>

A Harmont session bearer token.

In: header

Path Parameters

org*string

The organization slug.

pipeline*string

The pipeline slug.

number*integer

The build number.

Response Body

application/json

application/json

curl -X PUT "https://api.harmont.dev/api/v0/organizations/string/pipelines/string/builds/0/cancel"
{
  "branch": "string",
  "commit": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "error_code": "string",
  "error_message": "string",
  "finished_at": "2019-08-24T14:15:22Z",
  "message": "string",
  "number": 0,
  "pipeline_slug": "string",
  "scheduled_at": "2019-08-24T14:15:22Z",
  "source": "string",
  "started_at": "2019-08-24T14:15:22Z",
  "state": "scheduled"
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}

Mint a build-scoped log token

GET
/api/v0/organizations/{org}/pipelines/{pipeline}/builds/{number}/log-token
AuthorizationBearer <token>

A Harmont session bearer token.

In: header

Path Parameters

org*string

The organization slug.

pipeline*string

The pipeline slug.

number*integer

The build number.

Response Body

application/json

application/json

curl -X GET "https://api.harmont.dev/api/v0/organizations/string/pipelines/string/builds/0/log-token"
{
  "expires_at": "2019-08-24T14:15:22Z",
  "token": "string"
}
{
  "error": {
    "code": "string",
    "doc_url": "string",
    "message": "string",
    "request_id": "string",
    "type": "string"
  }
}