edit

Bitrise.io API v0.1 (Work In Progress)

The API is work-in-progress

The API is work-in-progress, we'll add docs for new endpoints here as we progress, as well as we might change things a bit if required.

API domain/host and versioning

The Bitrise API's host is: https://api.bitrise.io/

Every endpoint except the root one is versioned, and the version have to be included in the URL right after the host.

Example: https://api.bitrise.io/v0.1/me (requires authentication)

Right now we have only one version, v0.1.

There's no long term compatibility promise for v0.1, although we try to do our best to not to break anything unless we have to. Once we're happy with v0.1 we'll "freeze" it as v1.0, for which we'll provide long term support.

Authentication

The current API supports only one type of authentication, user generated Personal Access Tokens.

Right now every API endpoint requires authentication, there's no endpoint which you can call without including the authentication information, except the "root" URL (https://api.bitrise.io).

To acquire a Personal Access Token for your user, sign in with that user on bitrise.io, go to your Account Settings page, and select the Security tab on the left side.

Here you can manage your account's Two Factor Authentication settings, as well as your Personal Access Tokens.

To get started with the API simply click the Generate new token button, and save the generated Personal Access Token somewhere safe.

Important note: the generated token is shown only once, when it's generated! There's no way to see the token value again! You can of course generate as many Access Tokens as you like, and delete the ones you don't need anymore.

Once you have the token you can start interacting with the API.

To provide the required access token you have to add a HEADER to your requests, with the key Authorization and value token THE-ACCESS-TOKEN.

An example API call with auth, using curl:

curl -H 'Authorization: token THE-ACCESS-TOKEN' https://api.bitrise.io/v0.1/me

Response

Every endpoint responds with a JSON formatted response.

Pagination

When you call an endpoint which returns a list of items you always have to be prepared that you might not get the whole list in a single response, you'll have to iterate through the "pages" to retrieve all the items.

The response of the endpoint will include a paging object, with total_item_count and page_item_limit properties, and if there's a "next" page available it'll also include a next "anchor" item.

Example:

{
  "data": [ ... ],
  "paging": {
    "total_item_count": 3,
    "page_item_limit": 2,
    "next": "518e869d56f2adfd"
  }
}

Note: the next property of the paging object is only included if there's at least one more page available. If there's no next property inside paging that means that there's no more page to retrieve.

The page_item_limit property can be set with the query parameter named limit at the GET requests, so you can specify the size of the response pages. The default value for this parameter is 50.

Example:

  • Calling https://api.bitrise.io/v0.1/me/apps will retrieve you the first page of your apps with size of 50.
  • If you call https://api.bitrise.io/v0.1/me/apps?limit=10, the response is also the first page of your apps, but it will contain only 10 elements.

If you want to iterate through all the items this is what you have to do:

  1. First call the endpoint without any pagination parameters
  2. From the response process the paging object.
  3. If the paging object includes a next item, simply call the exact same endpoint with an additional next= query parameter, and pass the value you got in the response as the value of the next parameter.

That's all.

A quick example, iterating through all of your registered apps:

  1. First call https://api.bitrise.io/v0.1/me/apps
  2. Process the items (data property)
  3. Then check the paging (root) property.
  4. If there's a next property inside paging simply call the endpoint again, with the next query parameter
    • Example: https://api.bitrise.io/v0.1/me/apps?next=NEXTVALUE, where NEXTVALUE is the value of the next property you got in your previous response.
  5. Repeate this until the paging object does not include a next property, which means that the page you received was the last one.

Endpoints

Root URLs

Both / and /v0.1 are considered as root URLs, and return the same response at the moment (of course this will change in the future, once we have more than one version of the API).

These are the only endpoints which do not require authentication.

Example curl request:

curl https://api.bitrise.io/v0.1

GET /me

You can use this endpoint to get information about your account (identified by the Access Token).

Example curl request

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/me'

Example response

{
  "data": {
    "username": "api-demo"
  }
}

GET /me/apps

Retrieve the apps you have access to. This includes the apps created / owned by you, as well as apps where you're a Team member (either added directly, or through an Organization's Group). All the apps you have access to (similar to the Dashboard on bitrise.io.

Example curl request

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/me/apps?limit=2'

Example response

{
  "data": [
    {
      "is_disabled": false,
      "project_type": "xamarin",
      "provider": "github",
      "repo_owner": "bitrise-samples",
      "repo_slug": "sample-apps-xamarin-cross-platform",
      "repo_url": "https://github.com/bitrise-samples/sample-apps-xamarin-cross-platform.git",
      "slug": "f46e89061e967f27",
      "title": "sample-apps-xamarin-cross-platform"
    },
    {
      "is_disabled": false,
      "project_type": "macos",
      "provider": "github",
      "repo_owner": "bitrise-samples",
      "repo_slug": "sample-apps-osx-10-12",
      "repo_url": "https://github.com/bitrise-samples/sample-apps-osx-10-12.git",
      "slug": "13533d589b89fb4b",
      "title": "sample-apps-osx-10-12"
    }
  ],
  "paging": {
    "next": "669403bffbe35909",
    "page_item_limit": 2,
    "total_item_count": 4
  }
}

GET /apps/{APP-SLUG}

Get a specific app's data.

Example curl request

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG'

Example response

{
  "data": {
    "is_disabled": false,
    "project_type": "android",
    "provider": "github",
    "repo_owner": "bitrise-samples",
    "repo_slug": "sample-apps-android-sdk22",
    "repo_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22.git",
    "slug": "669403bffbe35909",
    "title": "sample-apps-android-sdk22"
  }
}

GET /apps/{APP-SLUG}/builds

Get the builds of a specific app.

Status codes (status) and related status texts (status_text):

  • status=0: Not finished yet.
    • If is_on_hold = true: the build did not start yet (status_text=on-hold)
    • If is_on_hold = false: the build is running (status_text=in-progress).
  • status=1: Build finished, with success (status_text=success).
  • status=2: Build finished, with error (status_text=error).
  • status=3: Build was aborted (status_text=aborted).

Build times:

  • the actual build time is the difference of finished_at and environment_prepare_finished_at
  • triggered_at is the time when the build was registered, it's always set, for every build. Other build times might be nil, if the build did not get to that point yet.
  • started_on_worker_at is the time of when a worker started to process the build. The difference between started_on_worker_at and triggered_at is usually for how long the build was "on hold" (rarely it can also include "waiting for worker" but that shouldn't happen under usual circumstances).
  • environment_prepare_finished_at is the time when the environment of the build was fully prepared; the build starts right after this, usually under a second.
  • finished_at is when the build finished (with success or error, or the time of the "abort" if it was aborted). finished_at is nil in case of a running build.

Example curl request

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds?limit=3'

Example response

{
  "data": [
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 19,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T09:13:11Z",
      "finished_at": "2017-08-17T09:14:37Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "workflow_id": "secondary"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "8ee5e483b79fdfd4",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T09:12:05Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T09:10:41.530768Z",
      "triggered_by": "curl",
      "triggered_workflow": "secondary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 18,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T09:10:31Z",
      "finished_at": "2017-08-17T09:12:04Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "601e080954bbd57b",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T09:09:24Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T09:09:23.662491Z",
      "triggered_by": "curl",
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "create_dev_file",
      "build_number": 17,
      "commit_hash": "b170936b1281a1cfd01fd7d19559793aae1b891a",
      "commit_message": "Create dev.txt\n\nAdd a file",
      "commit_view_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22/commit/b170936b1281a1cfd01fd7d19559793aae1b891a",
      "environment_prepare_finished_at": "2017-08-17T08:48:31Z",
      "finished_at": "2017-08-17T08:50:13Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "create_dev_file",
        "branch_dest": "master",
        "commit_hash": "b170936b1281a1cfd01fd7d19559793aae1b891a",
        "commit_message": "Create dev.txt\n\nAdd a file",
        "pull_request_head_branch": "pull/3/head",
        "pull_request_id": 3,
        "pull_request_merge_branch": "pull/3/merge",
        "pull_request_repository_url": "https://github.com/slapec93/sample-apps-android-sdk22.git"
      },
      "pull_request_id": 3,
      "pull_request_target_branch": "master",
      "pull_request_view_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22/pull/3",
      "slug": "62f841f1497f5f30",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T08:47:26Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T08:47:25.601465Z",
      "triggered_by": "webhook",
      "triggered_workflow": "primary"
    }
  ],
  "paging": {
    "next": "b5e4e86ff62ef8ec",
    "page_item_limit": 3,
    "total_item_count": 19
  }
}

Filtering parameters for build list

It's possible to filter the builds with URL query parameters.

Available parameters:
  • status (integer): In the response there will be only the builds with a certain status.
  • branch (string): Retrieves the builds from the given branch.
  • trigger_event_type (string): With this parameter the builds can be filtered based on the trigger event. Data type: string The available values are the following:
  • push: when the response contains only the builds which were triggered by a commit push
  • pull-request: when the response contains only the builds which were triggered by a pull request
  • pull_request_id (integer): This parameter specifies the pull request id of the actual build, works only if trigger_event_type parameter is specified with the value pull-request
  • after (integer): Giving this parameter, in the response there will be only those builds which were triggered after or at the given time. The value has to be passed as UNIX timestamp.
  • before (integer): Similar to the previous one this filters by the time when the build was triggered, but this retrieves the ones before or at the given time. The value has to be passed as UNIX timestamp.
  • workflow (string): The response will contain only the builds triggered with the specified workflow.
Example curl requests

Request with status filtering (aborted builds):

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds?status=3'

Response:

{
  "data": [
    {
      "abort_reason": "User api-demo requested to abort this build with reason: canceled through the API",
      "branch": "master",
      "build_number": 12,
      "commit_hash": null,
      "commit_message": "this build will be aborted through the API",
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-06-20T22:35:03Z",
      "finished_at": "2017-06-20T22:35:15Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "commit_message": "this build will be aborted through the API"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "ce86c8475d31d288",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-06-20T22:35:03Z",
      "status": 3,
      "status_text": "aborted",
      "tag": null,
      "triggered_at": "2017-06-20T22:35:02.40449Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": "User api-demo requested to abort this build with reason: This is an example abort build",
      "branch": "master",
      "build_number": 10,
      "commit_hash": null,
      "commit_message": "Abort example",
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-05-30T15:47:17Z",
      "finished_at": "2017-05-30T15:47:32Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "commit_message": "Abort example"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "3247e2920496e846",
      "stack_config_type": null,
      "stack_identifier": null,
      "started_on_worker_at": "2017-05-30T15:47:17Z",
      "status": 3,
      "status_text": "aborted",
      "tag": null,
      "triggered_at": "2017-05-30T15:47:17.135312Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    }
  ],
  "paging": {
    "page_item_limit": 50,
    "total_item_count": 19
  }
}

Request with branch filtering (builds on develop branch):

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds?branch=develop'

Response:

{
  "data": [
    {
      "abort_reason": null,
      "branch": "develop",
      "build_number": 15,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T07:46:00Z",
      "finished_at": "2017-08-17T07:47:25Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "develop"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "1e79f459d59ec74b",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T07:46:00Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T07:45:59.381653Z",
      "triggered_by": "curl",
      "triggered_workflow": "primary"
    }
  ],
  "paging": {
    "page_item_limit": 50,
    "total_item_count": 19
  }
}

Request with trigger_event_type filtering (builds triggered by pull request):

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds?trigger_event_type=pull-request'

Response:

{
  "data": [
    {
      "abort_reason": null,
      "branch": "create_dev_file",
      "build_number": 17,
      "commit_hash": "b170936b1281a1cfd01fd7d19559793aae1b891a",
      "commit_message": "Create dev.txt\n\nAdd a file",
      "commit_view_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22/commit/b170936b1281a1cfd01fd7d19559793aae1b891a",
      "environment_prepare_finished_at": "2017-08-17T08:48:31Z",
      "finished_at": "2017-08-17T08:50:13Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "create_dev_file",
        "branch_dest": "master",
        "commit_hash": "b170936b1281a1cfd01fd7d19559793aae1b891a",
        "commit_message": "Create dev.txt\n\nAdd a file",
        "pull_request_head_branch": "pull/3/head",
        "pull_request_id": 3,
        "pull_request_merge_branch": "pull/3/merge",
        "pull_request_repository_url": "https://github.com/slapec93/sample-apps-android-sdk22.git"
      },
      "pull_request_id": 3,
      "pull_request_target_branch": "master",
      "pull_request_view_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22/pull/3",
      "slug": "62f841f1497f5f30",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T08:47:26Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T08:47:25.601465Z",
      "triggered_by": "webhook",
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 16,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T08:31:31Z",
      "finished_at": "2017-08-17T08:33:05Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "pull_request_id": 3
      },
      "pull_request_id": 3,
      "pull_request_target_branch": "master",
      "pull_request_view_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22/pull/3",
      "slug": "b5e4e86ff62ef8ec",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T08:30:29Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T08:30:28.728743Z",
      "triggered_by": "curl",
      "triggered_workflow": "primary"
    }
  ],
  "paging": {
    "page_item_limit": 50,
    "total_item_count": 19
  }
}

Request with before filtering (builds triggered before 04.25.2017 1:34pm):

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds?before=1493127294'

Response:

{
  "data": [
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 6,
      "commit_hash": null,
      "commit_message": "unwatch test",
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-04-25T12:05:48Z",
      "finished_at": "2017-04-25T12:09:26Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "commit_message": "unwatch test"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "cabbf96b36031c45",
      "stack_config_type": null,
      "stack_identifier": null,
      "started_on_worker_at": "2017-04-25T12:04:38Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-04-25T12:04:37.61262Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 5,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-04-25T11:48:15Z",
      "finished_at": "2017-04-25T11:51:47Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "8b2a7f96da727174",
      "stack_config_type": null,
      "stack_identifier": null,
      "started_on_worker_at": "2017-04-25T11:46:44Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-04-25T11:34:59.209881Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 4,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-04-25T11:43:18Z",
      "finished_at": "2017-04-25T11:46:42Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "de020764ecdc8e57",
      "stack_config_type": null,
      "stack_identifier": null,
      "started_on_worker_at": "2017-04-25T11:43:18Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-04-25T11:34:57.058877Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 3,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-04-25T11:39:24Z",
      "finished_at": "2017-04-25T11:43:16Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "23c891eab2caad9c",
      "stack_config_type": null,
      "stack_identifier": null,
      "started_on_worker_at": "2017-04-25T11:38:11Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-04-25T11:34:54.231579Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 2,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-04-25T11:34:52Z",
      "finished_at": "2017-04-25T11:38:10Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "851f3cfcded7e20f",
      "stack_config_type": null,
      "stack_identifier": null,
      "started_on_worker_at": "2017-04-25T11:34:52Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-04-25T11:34:52.173944Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 1,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-04-25T11:06:55Z",
      "finished_at": "2017-04-25T11:10:47Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "51d5915205deede2",
      "stack_config_type": null,
      "stack_identifier": null,
      "started_on_worker_at": "2017-04-25T11:06:55Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-04-25T11:06:54.849366Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    }
  ],
  "paging": {
    "page_item_limit": 50,
    "total_item_count": 19
  }
}

Request with after filtering (builds triggered after 06.20.2017 10:35pm):

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds?after=1497998102'

Response:

{
  "data": [
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 19,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T09:13:11Z",
      "finished_at": "2017-08-17T09:14:37Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "workflow_id": "secondary"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "8ee5e483b79fdfd4",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T09:12:05Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T09:10:41.530768Z",
      "triggered_by": "curl",
      "triggered_workflow": "secondary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 18,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T09:10:31Z",
      "finished_at": "2017-08-17T09:12:04Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "601e080954bbd57b",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T09:09:24Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T09:09:23.662491Z",
      "triggered_by": "curl",
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "create_dev_file",
      "build_number": 17,
      "commit_hash": "b170936b1281a1cfd01fd7d19559793aae1b891a",
      "commit_message": "Create dev.txt\n\nAdd a file",
      "commit_view_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22/commit/b170936b1281a1cfd01fd7d19559793aae1b891a",
      "environment_prepare_finished_at": "2017-08-17T08:48:31Z",
      "finished_at": "2017-08-17T08:50:13Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "create_dev_file",
        "branch_dest": "master",
        "commit_hash": "b170936b1281a1cfd01fd7d19559793aae1b891a",
        "commit_message": "Create dev.txt\n\nAdd a file",
        "pull_request_head_branch": "pull/3/head",
        "pull_request_id": 3,
        "pull_request_merge_branch": "pull/3/merge",
        "pull_request_repository_url": "https://github.com/slapec93/sample-apps-android-sdk22.git"
      },
      "pull_request_id": 3,
      "pull_request_target_branch": "master",
      "pull_request_view_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22/pull/3",
      "slug": "62f841f1497f5f30",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T08:47:26Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T08:47:25.601465Z",
      "triggered_by": "webhook",
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 16,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T08:31:31Z",
      "finished_at": "2017-08-17T08:33:05Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "pull_request_id": 3
      },
      "pull_request_id": 3,
      "pull_request_target_branch": "master",
      "pull_request_view_url": "https://github.com/bitrise-samples/sample-apps-android-sdk22/pull/3",
      "slug": "b5e4e86ff62ef8ec",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T08:30:29Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T08:30:28.728743Z",
      "triggered_by": "curl",
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "develop",
      "build_number": 15,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T07:46:00Z",
      "finished_at": "2017-08-17T07:47:25Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "develop"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "1e79f459d59ec74b",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T07:46:00Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T07:45:59.381653Z",
      "triggered_by": "curl",
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 14,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-07-19T16:29:59Z",
      "finished_at": "2017-07-19T16:31:38Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "9fb8eaaa4bdd3763",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-07-19T16:28:51Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-07-19T16:28:50.744603Z",
      "triggered_by": "manual-api-demo",
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 13,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-07-19T16:26:33Z",
      "finished_at": "2017-07-19T16:27:50Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "78c605ea44677118",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-07-19T16:23:01Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-07-19T16:23:00.523386Z",
      "triggered_by": "manual-api-demo",
      "triggered_workflow": "primary"
    },
    {
      "abort_reason": "User api-demo requested to abort this build with reason: canceled through the API",
      "branch": "master",
      "build_number": 12,
      "commit_hash": null,
      "commit_message": "this build will be aborted through the API",
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-06-20T22:35:03Z",
      "finished_at": "2017-06-20T22:35:15Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "commit_message": "this build will be aborted through the API"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "ce86c8475d31d288",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-06-20T22:35:03Z",
      "status": 3,
      "status_text": "aborted",
      "tag": null,
      "triggered_at": "2017-06-20T22:35:02.40449Z",
      "triggered_by": null,
      "triggered_workflow": "primary"
    }
  ],
  "paging": {
    "page_item_limit": 50,
    "total_item_count": 19
  }
}

Request with workflow filtering (builds triggered with secondary workflow):

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds?workflow=secondary'

Response:

{
  "data": [
    {
      "abort_reason": null,
      "branch": "master",
      "build_number": 19,
      "commit_hash": null,
      "commit_message": null,
      "commit_view_url": null,
      "environment_prepare_finished_at": "2017-08-17T09:13:11Z",
      "finished_at": "2017-08-17T09:14:37Z",
      "is_on_hold": false,
      "original_build_params": {
        "branch": "master",
        "workflow_id": "secondary"
      },
      "pull_request_id": 0,
      "pull_request_target_branch": null,
      "pull_request_view_url": null,
      "slug": "8ee5e483b79fdfd4",
      "stack_config_type": "standard1",
      "stack_identifier": "linux-docker-android",
      "started_on_worker_at": "2017-08-17T09:12:05Z",
      "status": 1,
      "status_text": "success",
      "tag": null,
      "triggered_at": "2017-08-17T09:10:41.530768Z",
      "triggered_by": "curl",
      "triggered_workflow": "secondary"
    }
  ],
  "paging": {
    "page_item_limit": 50,
    "total_item_count": 19
  }
}

GET /apps/{APP-SLUG}/builds/{BUILD-SLUG}

Get a specific build's data.

Status codes (status) and related status texts (status_text): See the GET /apps/{APP-SLUG}/builds endpoint description

Build times: See the GET /apps/{APP-SLUG}/builds endpoint description

Example curl request

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds/BUILD-SLUG'

Example response

{
  "data": {
    "abort_reason": "User api-demo requested to abort this build with reason: This is an example abort build",
    "branch": "master",
    "build_number": 10,
    "commit_hash": null,
    "commit_message": "Abort example",
    "commit_view_url": null,
    "environment_prepare_finished_at": "2017-05-30T15:47:17Z",
    "finished_at": "2017-05-30T15:47:32Z",
    "is_on_hold": false,
    "original_build_params": {
      "branch": "master",
      "commit_message": "Abort example"
    },
    "pull_request_id": 0,
    "pull_request_target_branch": null,
    "pull_request_view_url": null,
    "slug": "3247e2920496e846",
    "stack_config_type": null,
    "stack_identifier": null,
    "started_on_worker_at": "2017-05-30T15:47:17Z",
    "status": 3,
    "status_text": "aborted",
    "tag": null,
    "triggered_at": "2017-05-30T15:47:17.135312Z",
    "triggered_by": null,
    "triggered_workflow": "primary"
  }
}

GET /apps/{APP-SLUG}/builds/{BUILD-SLUG}/log

Get the log info of a specific Build.

The log info includes the last couple of chunks (log_chunks) of the build log, as well as other meta infos like how many chunks were generated during the build (generated_log_chunks_num).

Once the build is finished and the full log is available in the log archives ("is_archived": true) the response will also include an expiring, read only download URL (expiring_raw_log_url).

There's no guarantee for how long this expiring raw log URL will exist (other than "for a couple of minutes"), so please do not store this URL! If you want to retrieve the full (raw) log please:

  1. Call this log info endpoint
  2. And right after that, when you get the response, parse the expiring_raw_log_url from it and send a GET request to that URL as soon as possible.

Important: when you send your GET request to the expiring_raw_log_url URL please do not include the Authorization headers. In fact, you should not include any special header at all; just create a simple GET request and send it to the expiring_raw_log_url url. The expiring_raw_log_url is configured so that it does not require any other parameter other than what's included in the URL.

Example curl request

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds/BUILD-SLUG/log'

Example response

{
  "expiring_raw_log_url": "https://bitrise-build-log-archives-production.s3.amazonaws.com/build-logs-v2/669403bffbe35909/3247e2920496e846/2194500/3247e2920496e846.log?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=AKIAIOC7N256G7J2W2TQ%2F20170919%2Fus-east-1%2Fs3%2Faws4_request\u0026X-Amz-Date=20170919T133615Z\u0026X-Amz-Expires=600\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=6f0c58f1678ece8d164ac7bd2eb25cf96f1e8658de6eea408d5db80ca421f46a",
  "generated_log_chunks_num": 6,
  "is_archived": true,
  "log_chunks": [
    {
      "chunk": "\n  ██████╗ ██╗████████╗██████╗ ██╗███████╗███████╗\n  ██╔══██╗██║╚══██╔══╝██╔══██╗██║██╔════╝██╔════╝\n  ██████╔╝██║   ██║   ██████╔╝██║███████╗█████╗\n  ██╔══██╗██║   ██║   ██╔══██╗██║╚════██║██╔══╝\n  ██████╔╝██║   ██║   ██║  ██║██║███████║███████╗\n  ╚═════╝ ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═╝╚══════╝╚══════╝\n\n\u001b[32;1mVersion: 1.6.1\u001b[0m\n\n\u001b[34mINFO\u001b[0m[15:47:21] \u001b[33;1mbitrise runs in CI mode\u001b[0m           \n\u001b[34mINFO\u001b[0m[15:47:21] \u001b[32;1mRunning workflow:\u001b[0m primary         \n\n\u001b[34;1mSwitching to workflow:\u001b[0m primary\n\n",
      "position": 0
    },
    {
      "chunk": "+------------------------------------------------------------------------------+\n| (0) activate-ssh-key@3.1.1                                                   |\n+------------------------------------------------------------------------------+\n| id: activate-ssh-key                                                         |\n| version: 3.1.1                                                               |\n| collection: https://github.com/bitrise-io/bitrise-steplib.git                |\n| toolkit: bash                                                                |\n| time: 2017-05-30T15:47:26Z                                                   |\n+------------------------------------------------------------------------------+\n|                                                                              |\n|                                                                              |\n+---+---------------------------------------------------------------+----------+\n| \u001b[34;1m-\u001b[0m | \u001b[34;1mactivate-ssh-key@3.1.1\u001b[0m                                        | 2.32 sec |\n+---+---------------------------------------------------------------+----------+\n\n                                          ▼\n\n\u001b[33mWARN\u001b[0m[15:47:26] The step's (activate-ssh-key@3.1.1) Run-If expression evaluated to false - skipping \n\u001b[34mINFO\u001b[0m[15:47:26] The Run-If expression was: \u001b[34;1m{{getenv \"SSH_RSA_PRIVATE_KEY\" | ne \"\"}}\u001b[0m \n",
      "position": 1
    },
    {
      "chunk": "+------------------------------------------------------------------------------+\n| (1) git-clone@3.4.3                                                          |\n+------------------------------------------------------------------------------+\n| id: git-clone                                                                |\n| version: 3.4.3                                                               |\n| collection: https://github.com/bitrise-io/bitrise-steplib.git                |\n| toolkit: go                                                                  |\n| time: 2017-05-30T15:47:27Z                                                   |\n+------------------------------------------------------------------------------+\n|                                                                              |\n\u001b[34mINFO\u001b[0m[15:47:27] Start installing (golang) with apt-get       \n\u001b[34mINFO\u001b[0m[15:47:27]  * \u001b[32;1m[OK]\u001b[0m Step dependency (go) installed, available. \n",
      "position": 2
    },
    {
      "chunk": "\n\u001b[34;1mGit Clone Configs:\u001b[0m\n- CloneIntoDir: /bitrise/src\n- RepositoryURL: https://github.com/bitrise-samples/sample-apps-android-sdk22.git\n\u001b[34;1mGit Checkout Configs:\u001b[0m\n- Commit: \n- Tag: \n- Branch: master\n- CloneDepth: \n\u001b[34;1mGit Pull Request Configs:\u001b[0m\n- PullRequestURI: \n- PullRequestID: \n- BranchDest: \n- PullRequestMergeBranch: \n- ResetRepository: No\n\u001b[34;1mBitrise Build Configs:\u001b[0m\n- BuildURL: https://www.bitrise.io/build/3247e2920496e846\n- BuildAPIToken: XtFWIhNx22MMMA6DcPXBGw\n\n\u001b[34;1mGit clone repository\u001b[0m\n=\u003e git \"init\"\n=\u003e git \"remote\" \"add\" \"origin\" \"https://github.com/bitrise-samples/sample-apps-android-sdk22.git\"\n=\u003e git \"fetch\"\n",
      "position": 3
    },
    {
      "chunk": "=\u003e git \"checkout\" \"master\"\n=\u003e git \"submodule\" \"update\" \"--init\" \"--recursive\"\n\u001b[34;1mExporting git logs\u001b[0m\n=\u003e GIT_CLONE_COMMIT_HASH\n   value: b4e7cad230e3fc2f2f84dbb455c7ac7f89a3a18b\n\n=\u003e GIT_CLONE_COMMIT_MESSAGE_SUBJECT\n   value: downgrade to com.android.tools.build:gradle:2.1.0\n\n=\u003e GIT_CLONE_COMMIT_MESSAGE_BODY\n   value: \n\n=\u003e GIT_CLONE_COMMIT_AUTHOR_NAME\n   value: Viktor Benei\n\n=\u003e GIT_CLONE_COMMIT_AUTHOR_EMAIL\n   value: viktor.benei@gmail.com\n\n=\u003e GIT_CLONE_COMMIT_COMMITER_NAME\n   value: GitHub\n\n=\u003e GIT_CLONE_COMMIT_COMMITER_EMAIL\n   value: noreply@github.com\n\n\u001b[32;1mSuccess\u001b[0m\n|                                                                              |\n+---+---------------------------------------------------------------+----------+\n| \u001b[32;1m✓\u001b[0m | \u001b[32;1mgit-clone@3.4.3\u001b[0m                                               | 8.77 sec |\n+---+---------------------------------------------------------------+----------+\n\n                                          ▼\n\n+------------------------------------------------------------------------------+\n| (2) Sleep                                                                    |\n+------------------------------------------------------------------------------+\n| id: script                                                                   |\n| version: 1.1.3                                                               |\n| collection: https://github.com/bitrise-io/bitrise-steplib.git                |\n| toolkit: bash                                                                |\n| time: 2017-05-30T15:47:35Z                                                   |\n+------------------------------------------------------------------------------+\n|                                                                              |\n",
      "position": 4
    },
    {
      "chunk": "+ sleep 30\n",
      "position": 5
    }
  ],
  "timestamp": "2017-05-30T15:47:39.567+00:00"
}

GET /apps/{APP-SLUG}/builds/{BUILD-SLUG}/artifacts

Get the artifacts for a specific build.

Example curl request

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds/BUILD-SLUG/artifacts'

Example response

{
  "data": [
    {
      "artifact_type": "file",
      "is_public_page_enabled": true,
      "slug": "0d2277e50b8d32ce",
      "title": "artifact-1.txt"
    },
    {
      "artifact_type": "file",
      "is_public_page_enabled": false,
      "slug": "b69c23de1f13b998",
      "title": "artifact-2.txt"
    }
  ],
  "paging": {
    "page_item_limit": 50,
    "total_item_count": 2
  }
}

GET /apps/{APP-SLUG}/builds/{BUILD-SLUG}/artifacts/{ARTIFACT-SLUG}

Get a certain build artifact's data. The provided download URL is a presigned Amazon S3 URL which is valid for 10 minutes and then it expires.

Example curl request

curl -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds/BUILD-SLUG/artifacts/ARTIFACT-SLUG'

Example response

{
  "data": {
    "artifact_type": "file",
    "expiring_download_url": "https://bitrise-prod-build-storage.s3.amazonaws.com/builds/9fb8eaaa4bdd3763/artifacts/2138393/artifact-1.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=AKIAIOC7N256G7J2W2TQ%2F20170919%2Fus-east-1%2Fs3%2Faws4_request\u0026X-Amz-Date=20170919T120024Z\u0026X-Amz-Expires=600\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=5d5a0f08e5889162897e0a8aab3d68c2c8a228758759dc6b1e3c49b7e9f12e69",
    "is_public_page_enabled": true,
    "public_install_page_url": "https://www.bitrise.io/artifact/2138393/p/6e7dc9c2b99492e6aa997a2e5d3f7413",
    "slug": "0d2277e50b8d32ce",
    "title": "artifact-1.txt"
  }
}

PATCH /apps/{APP-SLUG}/builds/{BUILD-SLUG}/artifacts/{ARTIFACT-SLUG}

Set the attributes of a build artifact. In the request body have to be sent a JSON with the specified new attribute values.

Note: at this time only the is_public_page_enabled attribute can be set through this endpoint call.

Example curl request

curl -X PATCH -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/APP-SLUG/builds/BUILD-SLUG/artifacts/ARTIFACT-SLUG' -d '{"is_public_page_enabled":true}'

Example response

{
  "data": {
    "artifact_type": "file",
    "expiring_download_url": "https://bitrise-prod-build-storage.s3.amazonaws.com/builds/9fb8eaaa4bdd3763/artifacts/2138393/artifact-1.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Credential=AKIAIOC7N256G7J2W2TQ%2F20170919%2Fus-east-1%2Fs3%2Faws4_request\u0026X-Amz-Date=20170919T120024Z\u0026X-Amz-Expires=600\u0026X-Amz-SignedHeaders=host\u0026X-Amz-Signature=5d5a0f08e5889162897e0a8aab3d68c2c8a228758759dc6b1e3c49b7e9f12e69",
    "is_public_page_enabled": true,
    "public_install_page_url": "https://www.bitrise.io/artifact/2138393/p/6e7dc9c2b99492e6aa997a2e5d3f7413",
    "slug": "0d2277e50b8d32ce",
    "title": "artifact-1.txt"
  }
}

POST /apps/{APP-SLUG}/builds/{BUILD-SLUG}/abort

Abort a running build.

Optionally you can specify a JSON body for the request, with an abort_reason. Example:

{
    "abort_reason": "test build abort"
}

Example curl request

curl -X POST -H 'Authorization: token THE-ACCESS-TOKEN' 'https://api.bitrise.io/v0.1/apps/{APP-SLUG}/builds/{BUILD-SLUG}/abort' -d '{"abort_reason": "test build abort via curl"}'

Example response

{
    "status": "ok"
}

If the build is already finished or aborted you'll get an error:

{
    "error_msg": "Build already finished, can't abort it."
}

WIP / working on it

See https://discuss.bitrise.io/t/bitrise-api-v0-1-work-in-progress/1554.

Feature / endpoint requests

If you want to request a new API feature / endpoint, please do it here: http://discuss.bitrise.io/t/bitrise-public-api/37