Open Api Schema / Graphql

Hello everyone,

I was wondering if there is a public open api schema for the REST endpoints or a grahpql.schema file for the graphql endpoints? We want to integrate with buildkite and it would save some time if we would be able to generate the objects based on an official schema.

If there is one, can you please point the location of it?

Hi @rantofie!

Welcome to the community! :slight_smile:

All API access is over HTTPS, and accessed from the api.buildkite.com domain. All data is sent as JSON.

curl https://api.buildkite.com
{
  "response": "Hello World"
}

The GraphQL API endpoint is https://graphql.buildkite.com/v1 . All requests must be HTTP POST requests with application/json encoded bodies.
With the GraphQL console you can browse the schema and get an understanding of the endpoints.

You can find more information here REST API Overview | Buildkite Documentation and also here GraphQL API Overview | Buildkite Documentation

Cheers!

Hey @paula , thanks for the response, I was hoping that there’s a publicly available open api schema for JSON or for graphql so we can generate the model / clients based on it. Is there no such thing ?

Hi @rantofie, There is no Open API Schema. We have them maintained by hand here: REST API Overview | Buildkite Documentation. In this page, In the left sidebar → under the "Buildkite Rest API” section, you can browse through the sections and see the list of available rest APIs and their definitions.

For GraphQL, Documentation is available here. It has a full list of fields where we can see the schema of each query and mutation by clicking through each field.

Hope this helps!

Thank you for the documentation. I’ve went through it and it seems to me that the GraphQL API is a bit behind compared to the REST API on some scenarios - hopefully I’m wrong and maybe you can help me.
We are trying to extract the pipeline configuration for a given slug.

REST :

[
  {
    "id": "849411f9-9e6d-4739-a0d8-e247088e9b52",
    "graphql_id": "UGlwZWxpbmUtLS1lOTM4ZGQxYy03MDgwLTQ4ZmQtOGQyMC0yNmQ4M2E0ZjNkNDg=",
    "url": "https://api.buildkite.com/v2/organizations/acme-inc/pipelines/my-pipeline",
    "web_url": "https://buildkite.com/acme-inc/my-pipeline",
    "name": "My Pipeline",
    "slug": "my-pipeline",
    "repository": "git@github.com:acme-inc/my-pipeline.git",
    "branch_configuration": null,
    "default_branch": "master",
    "provider": {
      "id": "github",
      "webhook_url": "https://webhook.buildkite.com/deliver/xxx",
      "settings": {
        "publish_commit_status": true,
        "build_pull_requests": true,
        "build_pull_request_forks": false,
        "build_tags": false,
        "publish_commit_status_per_step": false,
        "repository": "acme-inc/my-pipeline",
        "trigger_mode": "code"
      }
    },
    "skip_queued_branch_builds": false,

GraphQL :
https://buildkite.com/user/graphql/documentation/type/RepositoryProvider

As you can see in the RepositoryProvider we are missing build_pull_requests / forks / tags and so on.
So, is there a way to extract this information through GraphQL ?

Hey @rantofie!

Yup, you are correct. We are having a bit of API parity issue at the moment, but we are working on it. I’ll share this with our product team so we can work on those fields for GraphQL.

Thanks!