You'll need roughly 4 minutes to read this article.
We launched a new version of the API, which is open to anyone and doesn’t require any registration. This page will provide more context around the new API and examples of how to work with it.
If you’re just looking to get started, head over to the API v2 Documentation for all the details.
The new API has initially been focused on solving a specific set of core use cases, which has been requested by the majority of users:
If you need help with something you’re trying to use the API for, whether covered by the above use cases or not, please reach out to our support via helpdesk.codeship.com.
Having the above scenarios as a guiding light, we have focus on these specific endpoints:
For Projects, you’re able to do most CRUD operations (we’re working on the remaining ones) which should allow you to automate most of your project maintenance tasks; especially useful for those with 10s or 100s of projects.
Things to note:
Builds can’t really be deleted, but otherwise you can do pretty much anything with them. You can even go a level deeper than what the Codeship UI offers; if you restart a build, the old build data is kept around, but the UI only shows the latest. With the builds endpoint you can get the information on those old builds as well.
In terms of
commands on the builds endpoint, we’ve deviated slightly from “textbook REST” and have allowed endpoints to
/restart an existing build or
/stop a running build. If you want to trigger a build that pulls the latest code from a given branch, you would POST to the
/builds endpoint with the project and the branch in question. More details can be found on this in the API v2 Documentation.
If you’re using Golang for you automation, you can get started more quickly with the Official Codeship Go API Client. There’s a good introduction in the git repo, and you can find the full documentation here.
The Golang library is released with the MIT license, so feel free to use it as you will. If you have suggestions, bugs or otherwise want to contribute to the project, please use the GitHub Issues to submit these (or submit a PR).
Things to note:
With the public release of v2, the old v1 API will be deprecated by July 1st, 2018. If you’re relying on v1 and don’t think you can migrate to v2 before this date, please get in touch with helpdesk.codeship.com and we’ll see how we can help.
We also have a couple of code examples and sample projects available.