Skip to main content

Managing build artifacts

If you add the Deploy to bitrise.io Step to your Workflow, once the build has run, you can access the build artifacts in the build's Artifacts tab on bitrise.io.

You can also manage the generated artifacts with the Bitrise API.

IMPORTANT: Artifact retention policy

Artifacts, including build logs, build files, installable artifacts, or CodePush packages, are only stored for a limited amount of time. For details, see Artifact retention policy.

EndpointFunctionRequired role on the app's team
GET/apps/{app-slug}/builds/{build-slug}/artifactsListing build artifactsAny
GET/apps/{app-slug}/builds/{build-slug}/artifacts/{artifact-slug}Retrieving data of a specific build artifactAny
PATCH/apps/{app-slug}/builds/{build-slug}/artifacts/{artifact-slug}Updating a build artifactOwner, Admin, or Developer
DELETE/apps/{app-slug}/builds/{build-slug}/artifacts/{artifact-slug}Deleting a build artifactOwner, Admin, or Developer

Listing build artifactsClick to copy link

Required role

You must have a tester/QA, developer, admin, or owner role on the app's team to list build artifacts using the API.

For a complete list of user roles and role cheatsheets, check Roles and permissions for Bitrise CI.

To be able to use build artifact endpoints, you have to first list all artifacts that belong to an app’s build. The response will list all artifacts along with their slug which you will need later.

The required parameters are:

  • app slug
  • build slug

You can use the generated build artifact slug/s from the response output with other build artifact endpoints where the build artifact slug is a required parameter.

Listing the artifacts of an app

Request:

curl -X GET "https://api.bitrise.io/v0.1/apps/87a5991e180d91a9/builds/b234f959745082e0/artifacts" -H "accept: application/json" -H "Authorization: THE-ACCESS-TOKEN"

Response:

{
"data": [
{
"title": "another_app-debug.apk",
"artifact_type": "android-apk",
"is_public_page_enabled": true,
"slug": "92e0b6ecae87b832",
"file_size_bytes": 1574799
},
{
"title": "app-debug.apk",
"artifact_type": "android-apk",
"is_public_page_enabled": true,
"slug": "54ae701761c4f956",
"file_size_bytes": 1574793
}
],
"paging": {
"total_item_count": 2,
"page_item_limit": 50
}
}

Retrieving a specific build artifact's dataClick to copy link

Required role

You must have a tester/QA, developer, admin, or owner role on the app's team to retrive a specific build's artifact data using the API.

For a complete list of user roles and role cheatsheets, check Roles and permissions for Bitrise CI.

You can retrieve detailed data of a specific build's artifacts with the artifacts endpoint. The response shows the filename, the artifact type, the download URL, and the file size.

The required parameters are:

  • app slug
  • build slug
  • artifact slug

Retrieving the data of a specific artifact

Request:

curl -X GET "https://api.bitrise.io/v0.1/apps/87a5991e180d91a9/builds/b234f959745082e0/artifacts/92e0b6ecae87b832" -H "accept: application/json" -H "Authorization: THE-ACCESS-TOKEN"

Response:

{
"data": {
"title": "another_app-debug.apk",
"artifact_type": "android-apk",
"expiring_download_url": "https://bitrise-prod-build-storage.s3.amazonaws.com/builds/b234f959745082e0/artifacts/7626902/another_app-debug.apk?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAIV2YZWMVCNWNR2HA%2F20190426%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190426T131627Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=9f1af26787f34b5cf0cbc18b2372313607b1e3c0203a9ce7e42da884a6ddf70f",
"is_public_page_enabled": true,
"slug": "92e0b6ecae87b832",
"public_install_page_url": "https://www.bitrise.io/artifact/7626902/p/8e5b2c62abe28fecef09b271de767920",
"file_size_bytes": 1574799
}
}

By default, the value of the is_public_page_enabled input is set to true. This way the public_install_page_url becomes available and you can view some basic information about the artifact via this URL. You can also download the artifact using the download URL from the response output.

Disabling the public install page of an artifactClick to copy link

Required role

You must have a developer, admin, or owner role on the app's team to disable the public install page of an artifact using the API.

For a complete list of user roles and role cheatsheets, check Roles and permissions for Bitrise CI.

You can update the is_public_page_enabled parameter of your APK and IPA files. Please note this parameter’s value is set to true by default so you can only disable it with this endpoint.

The required parameters are:

  • app slug
  • build slug
  • artifact slug

Disabling the public install page for an APK file

Request:

curl -X PATCH "https://api.bitrise.io/v0.1/apps/87a5991e180d91a9/builds/b234f959745082e0/artifacts/54ae701761c4f956" -H "accept: application/json" -H "Authorization: THE-ACCESS-TOKEN" -H "Content-Type: application/json" -d "{ \"is_public_page_enabled\": false}"

Response:

{
"data": {
"title": "app-debug.apk",
"artifact_type": "android-apk",
"expiring_download_url": "https://bitrise-prod-build-storage.s3.amazonaws.com/builds/b234f959745082e0/artifacts/7626904/app-debug.apk?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAIV2YZWMVCNWNR2HA%2F20190503%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190503T082800Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=7251fcbc0574ffac60b3f1d4a8c398658e49f0b86fb3cfec1500bde125738abc",
"is_public_page_enabled": false,
"slug": "54ae701761c4f956",
"public_install_page_url": "",
"file_size_bytes": 1574793
}
}

If you check the build’s Artifacts tab, you will see that the Public install page toggle is disabled.

Deleting a build artifactClick to copy link

Required role

You must have a developer, admin, or owner role on the app's team to delete a build artifact using the API.

For a complete list of user roles and role cheatsheets, check Roles and permissions for Bitrise CI.

You can delete an app’s specific build artifact.

The required parameters are:

  • app slug
  • build slug
  • artifact slug

Deleting an APK file

Request:

curl -X DELETE "https://api.bitrise.io/v0.1/apps/87a5991e180d91a9/builds/b234f959745082e0/artifacts/54ae701761c4f956" -H "accept: application/json" -H "Authorization: THE-ACCESS-TOKEN"

Response:

{
"data": {
"title": "app-debug.apk",
"artifact_type": "android-apk",
"expiring_download_url": null,
"is_public_page_enabled": true,
"slug": "54ae701761c4f956",
"public_install_page_url": "",
"file_size_bytes": 1574793
}
}