Locating UUIDs

2 minute read

All API calls must be done in relation to an organization in CodeShip, using its UUID.

When requesting detailed information about projects or builds, you’ll also need their UUIDs, so here is how to locate each of the different UUIDs.

Organization UUIDs

These UUIDs are not available in the web console, but are returned as part of the authentication response.

Here is an example of what that response could look like:

{ "access_token": "EXAMPLE eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6IjYzMjIwNzg0YzUzODA3ZjVmZTc2Yjg4ZjZkNjdlMmExZTIxODlhZTEiLCJjbGllbnRfaWQiOiJUZXN0IENsaWVudCBJRCIsInVzZXJfaWQiOm51bGwsImV4cGlyZXMiOjEzODAwNDQ1NDIsInRva2VuX3R5cGUiOiJiZWFyZXIiLCJzY29wZSI6bnVsbH0.PcC4k8Q_etpU-J4yGFEuBUdeyMJhtpZFkVQ__sXpe78eSi7xTniqOOtgfWa73Y4sj5Npta8xPuDglH8Fueh_APZ53wGCiRE1P4nT4APQCOTbgjgCNXwjmP8znk9F76ID2WxThaMbmpsTTEkuyyUYQKCCdxlIcSbVvcLZUGKZ6-g", "organizations": [ { "uuid": "dc37c39f-731e-4100-b8bf-69dae9eb14aa", "name": "Codeship", "scopes": [ "build.read", "project.read" ] }, { "uuid": "dc37c39f-731e-4100-b8bf-69dae9eb14ab", "name": "Codeship Test Org", "scopes": [ "build.read", "build.write", "project.read", "project.write" ] } ], "expires_at": 1504275032 }

From the example, a data structure called organizations is returned, which is where you’ll find the list of organizations you have access to and their UUIDs.

You can also see the scopes for each organization, which indicates what permissions your user has for each.

Project UUIDs

The easiest way to get a list of all your project UUIDs is to get the list from the projects endpoint. Every time you get a project in an API response it will contain the UUID of the project. This also applies to creating projects.

Alternatively, if you just need the UUID of a specific project, you can go to the web console and navigate to the Project Settings for the project and then the General tab. You’ll find the UUID just below the section on badge status images.

Build UUIDs

As with organizations, these are not available in the web console, so the best way to get a particular build’s UUID is to get a list of builds for the project and locate the build that way.

If you’re looking for a build UUID with the purpose of restarting the build, you can also create a new build with the same commit_sha using the create build endpoint.