API Access to Public Builds

As best I can tell, you can’t query the REST API without an Access Token, but an Access Token is only enabled for the organizations you select. The list of allowed organizations is limited by membership.

The upshot of this, if I’m understanding the behaviour correctly, is that I can’t use the API to check build status from the Bazel build pipeline, as one example:

# with access token:
Error: https://api.buildkite.com/v2/organizations/bazel/pipelines/bazel-bazel/builds/15216: status code 404
# without access token:
Error: https://api.buildkite.com/v2/organizations/bazel/pipelines/bazel-bazel/builds/15216: status code 401

Anything I’m missing here? Any plans to allow REST API access for public pipelines?

Hi @liamdawson,

I think we will likely continue to require a token to access the API even for public objects, as it’s how we handle rate limits and keeping things reliable at the moment.

I think the inability to access public items with a valid token, though, is definitely an oversight on our part; it used to be possible to create an “all organisations” API access token, but this was removed to avoid potential unintended information leakage. This would also allow access to public data, but I can see that this is no longer available.

One option you do have is to create a token with GraphQL access and use the GraphQL API, as this API is not currently scoped to particular organizations.

I will bring up access to public objects as something for us to consider adding, for sure!

Thanks @jess. Good to know about the GraphQL API, but I’m avoiding it for this use-case until it supports read-only access.