Bitrise API: Build custom integrations with your preferred tools and processes

This article helps you learn more about the Bitrise API and how to make the most out of it — with real examples from members of the Bitrise community.

APIs are everywhere: in every application and every business. Developers are attracted to APIs because they can build, customize, use, and integrate any service or tool with their platform or app easily. As you know, Bitrise provides CI/CD platform as a service (PaaS) that helps mobile developers build, test, and deploy their apps quickly and frequently. Furthermore, we have an API that allows them to custom build different solutions.

In this guide, we will learn more about the Bitrise API and how the community uses it to build different solutions. Let’s get started! 

What's the Bitrise API?

The Bitrise API allows you to build deep, custom integrations with your preferred tools and processes to create even more efficient development pipelines.

The API provides you with control of — and access to — the features and data available through the Bitrise website and CLI. By using the API, you gain the ability to fully customize Bitrise’s functionality to fit your process. Right now we have only one version: v0.1

What can I do with the Bitrise API?

There are different endpoints in the Bitrise API that brings you most of the features of the Bitrise platform at your fingertips for instance the following endpoints: 

  • Authenticating (currently supports only one type of authentication: user generated personal access tokens)
  • Adding and managing apps.
  • Triggering and aborting builds.
  • Incoming and outgoing webhooks.
  • Managing iOS code signing files.
  • Managing files in Generic File Storage.
  • Managing build artifacts.

All the details can be found in the API specification documentation.

NOTE: Every API endpoint requires authentication, except the “root” URL (https://api.bitrise.io)

How can I generate my personal access token?

To create a new personal access token you should do the following steps:

  1. In the upper right corner, open the account selector dropdown menu.
  2. Select the Profile settings option.
  1. This takes you to the Edit your profile page.
  2. In your Security tab, click on Create token.
  1. Fill out the Token description field and select the appropriate expiration time (1 hour, 1 day, 1 month or never) for your token.
  1. Click Next.
  2. Click Copy and close to save it somewhere now so that you can use it later
  1. Save it in a secure way.
  2. In the personal access token window, you can see your newly generated token.

And to test it, add an Authorization header with the access token to your API calls.

curl -H 'Authorization: YOUR-ACCESS-TOKEN' https://api.bitrise.io/v0.1/me
Copy code

All the endpoints and the details can be found in the API reference.

Awesome, now you can use the endpoints. 🎉 Let’s use one of these endpoints as an example. 

Triggering a new build with the API

Let’s assume that you already have an app on Bitrise and you need to trigger a new build via the API.

To trigger a new build with the Bitrise API, call the /apps/{APP-SLUG}/builds endpoint. You need to specify an app slug and at least one build parameter in a JSON object:

  • A git tag or git commit hash
  • A branch
  • A Workflow ID

The JSON object must also contain a hook_info object with a type key and bitrise as the value of the key.

For instance, you can use an API client like Postman or Paw to explore the API endpoints. Bitrise API is based on Swagger which it will be easily to import the Swagger JSON file to the client and start calling the API endpoints in three steps:

  • Install Postman app.
  • Import the API Swagger JSON file.
  • Start exploring the API endpoints. 

After that, if you want for instance to trigger a Bitrise build via the API POST endpoint (apps/app-slug/builds), don’t forget to add the API Key as an Authorization Key like this: 

Additionally, builds can be triggered using voice commands via Amazon Alexa or from AWS Lambda functions. You can specify several different build parameters when triggering a build. The parameters should be set in the build_params object.

For more details about this endpoint, you can read our documentation.

NOTE: You can find an interactive cURL call configurator by clicking on the Start/Schedule a build button on your app’s bitrise.io page and switching to Advanced mode in the popup. At the bottom of the popup you can find a curl call, based on the parameters you specify in the popup.

Bitrise API and the Open-source community

With Bitrise API, you can write your own apps that exploit the openness of the API is an added-value feature of Bitrise and good use of this possibility has already been made by existing Bitrise users.

A case in point is the Bitrise Wall, created by Jas Manigundan. This is an app for both iOS and Android that allows you to monitor the activity of your builds and even download the latest app version directly from your mobile phone. Bitrise Wall (BitWall) is open source, so you can download the code to make your own version or perhaps contribute open-source improvements on Github:

https://github.com/jaswanthm/bitrise-wall-android-opensource

https://github.com/jaswanthm/bitrise-wall-iOS-opensource

We’ve talked before with Jas about his project and you can watch the demo of Bitrise Wall from here: 

Community Creations: Introducing the Bitrise Wall mobile app

Another example of the open source project is Bitrise Reports, A tool to extract reports from projects you build on Bitrise created by Ubiratan Soares.

There are different features of the project such as:

  • Backed by Bitrise REST API under the hood.
  • Can compute timing (queued, running and total execution time) for all builds in the given time window.
  • Results are detailed per machine type and also per Workflow.
  • Report types: CLI (stdout), JSON and Excel spreadsheet.

Also, there is a curated list of the open-source Bitrise tool extras created by Jas. You can see this list here!. 🚀

Thanks to our community members for the effort and time they put into doing amazing projects as well as helping our users grasp Bitrise easily and efficiently. 

Everyone is welcome to join our community and build new open source Bitrise Steps or use the API. 💜

Conclusion

The Bitrise API allows you to build deep, custom integrations with your preferred tools and processes to create even more efficient development pipelines.

While Bitrise's API is still in development, it has already provided us with useful functionality so that many users can extend Bitrise with their own applications. Our team will support the developer community in doing so, and we will raise awareness to make these benefits available to a wider audience.

Thank you and happy building 👨🏻‍💻

Further reading

No items found.
The Mobile DevOps Newsletter

Explore more topics

App development

Best practices from engineers on how to use Bitrise to build better apps, faster.

Community

Meet other Bitrise engineers, technology experts, power users, partners and join our BUGs.

Company

All the updates about Bitrise events, sponsorships, employees, and more.

Insights

Mobile development, latest tech, industry insights, and interviews with experts.

Mobile DevOps

Learn why mobile development is unique and requires a set of unique practices.

Releases

Stay tuned for the last updates, new features, and product improvements.

The Mobile DevOps Newsletter

Join 1000s of your peers. Sign up to receive Mobile DevOps tips, news, and best practice guides once every two weeks.