Bolt API

Overview

The Bolt API allows you to easily manage and control Bolt schedules and runs within your workspace.

List Bolt schedules

This endpoint will return the active Bolt schedules in your workspace.

Example Request

import requests
import os

# API credentials
api_endpoint = "<YOUR_API_ENDPOINT>"
api_key = "<YOUR_API_KEY>"
api_secret = "<YOUR_API_SECRET>"

graphql_query = """
query ListBoltSchedules {
    listBoltSchedules(offset: 0, limit: 10, showInactive: false) {
        schedules {
            name
            schedule
            owner
            lastRunAt
            lastRunState
            nextRunAt
            id
            uuid
            source
            turboCi {
                enabled
                deferredScheduleName
                successfulRunOnly
            }
            deferredSchedule {
                deferredScheduleName
                enabled
                successfulRunOnly
            }
            commands
            gitBranch
            slackOn
            slackNotify
            emailOn
            emailNotify
        }
        totalCount
    }
}
  """
  
response = requests.post(api_endpoint, json={"query": graphql_query}, headers={
      "Content-Type": "application/json",
      "X-API-KEY": api_key,
      "X-API-SECRET": api_secret,
  })

print(response.json())
Example response

Get Bolt schedule details

This endpoint will enable you to check the status of a schedule by passing a Bolt scheduleName .

Example Request

Example response

Trigger a Bolt run

This endpoint will enable you to trigger a Bolt schedule run by passing a schedule name.

Example Request

Example response

Trigger a Bolt run with custom commands

This endpoint will enable you to trigger a Bolt schedule with a custom command and overwrite the actual commands defined in the schedule for that particular run.

This only modifies the command at runtime for the triggered Bolt schedule and not the commands configuration defined in the schedule.

Example Request

Example response

Trigger a Bolt run with a custom git branch

This endpoint will enable you to trigger a Bolt schedule with a custom git commit and overwrite the branch name defined in the schedule configuration.

This only modifies the commit at runtime for the triggered Bolt schedule and not the branch name defined in the schedule.

Example Request

Example response

Trigger a Bolt run with a PR number

This endpoint enables you to trigger a Bolt schedule with a specific pull request number, which is particularly useful for Turbo CI workflows that need to associate runs with pull requests for smart cancellation and concurrency enabedled.

Example response

Cancel a Bolt run

This endpoint will enable you to cancel a Bolt run by passing the runID of a Bolt schedule.

Example Request

Example response

Get Bolt run status

This endpoint will enable you to check the status of a Bolt run run by passing the runID.

Example Request

Example response

Get Bolt command details

This endpoint will enable you to extract for a given command all the related details including raw error logs by passing a commandId. This is normally used in conjunction with the Paradime Webhooks.

Example Request

Example response

Get Bolt command resource URL

This endpoint will enable you to extract for a given command the related resource generated by the execution of the command, for example the run_results.json or the manifest.json by passing a resourceId. This is normally used in conjunction with the Paradime Webhooks.

Example Request

Example response

Last updated

Was this helpful?