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())curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "query ListBoltSchedules($offset: Int!, $limit: Int!, $showInactive: Boolean!) { listBoltSchedules(offset: $offset, limit: $limit, showInactive: $showInactive) { 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 } }",
       "variables": {
         "offset": 0,
         "limit": 10,
         "showInactive": false
       }
     }'Get Bolt schedule details
This endpoint will enable you to check the status of a schedule by passing a Bolt scheduleName .
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 BoltScheduleName {
    boltScheduleName(scheduleName: "daily run") {
        ok
        latestRunId
        commands
        owner
        schedule
        uuid
        source
    }
}
  """
  
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())
  curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "query BoltScheduleName($scheduleName: String!) { boltScheduleName(scheduleName: $scheduleName) { ok latestRunId commands owner schedule uuid source } }",
       "variables": {
         "scheduleName": "daily run"
       }
     }'Trigger a Bolt run
This endpoint will enable you to trigger a Bolt schedule run by passing a schedule name.
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 = """
mutation TriggerBoltRun {
    triggerBoltRun(scheduleName: "daily run") {
        runId
    }
}
  """
  
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())
curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "mutation TriggerBoltRun($scheduleName: String!) { triggerBoltRun(scheduleName: $scheduleName) { runId } }",
       "variables": {
         "scheduleName": "daily run"
       }
     }'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
import requests
import os
# API credentials
api_endpoint = "<YOUR_API_ENDPOINT>"
api_key = "<YOUR_API_KEY>"
api_secret = "<YOUR_API_SECRET>"
graphql_query = """
mutation TriggerBoltRun {
    triggerBoltRun(scheduleName: "daily run", commands: ["dbt compile", "dbt test"]) {
        runId
    }
}
  """
  
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())
  curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "mutation TriggerBoltRun($scheduleName: String!, $commands: [String!]) { triggerBoltRun(scheduleName: $scheduleName, commands: $commands) { runId } }",
       "variables": {
         "scheduleName": "daily run",
         "commands": ["dbt compile", "dbt test"]
       }
     }'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
import requests
import os
# API credentials
api_endpoint = "<YOUR_API_ENDPOINT>"
api_key = "<YOUR_API_KEY>"
api_secret = "<YOUR_API_SECRET>"
graphql_query = """
mutation TriggerBoltRun {
    triggerBoltRun(scheduleName: "daily run", branch: "feature-branch-123") {
        runId
    }
}
  """
  
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())curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "mutation TriggerBoltRun($scheduleName: String!, $branch: String!) { triggerBoltRun(scheduleName: $scheduleName, branch: $branch) { runId } }",
       "variables": {
         "scheduleName": "daily run",
         "branch": "feature-branch-123"
       }
     }'Cancel a Bolt run
This endpoint will enable you to cancel a Bolt run by passing the runID of a Bolt schedule.
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 = """
mutation CancelBoltRun {
    cancelBoltRun(scheduleRunId: 15507) {
        ok
    }
}
  """
  
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())
  curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "mutation CancelBoltRun($scheduleRunId: Int!) { cancelBoltRun(scheduleRunId: $scheduleRunId) { ok } }",
       "variables": {
         "scheduleRunId": 15507
       }
     }'Get Bolt run status
This endpoint will enable you to check the status of a Bolt run run by passing the runID.
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 BoltRunStatus {
    boltRunStatus(runId: 15509) {
        ok
        state
        commands {
            id
            command
            startDttm
            endDttm
            stdout
            stderr
            returnCode
        }
    }
}
  """
  
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())curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "query BoltRunStatus($runId: Int!) { boltRunStatus(runId: $runId) { ok state commands { id command startDttm endDttm stdout stderr returnCode } } }",
       "variables": {
         "runId": 15509
       }
     }'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
import requests
import os
# API credentials
api_endpoint = "<YOUR_API_ENDPOINT>"
api_key = "<YOUR_API_KEY>"
api_secret = "<YOUR_API_SECRET>"
graphql_query = """
query BoltCommand {
    boltCommand(commandId: 59241) {
        command
        startDttm
        endDttm
        stdout
        stderr
        returnCode
        scheduleRunId
        resources {
            id
            path
        }
        ok
    }
}
  """
  
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())
  curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "query BoltCommand($commandId: Int!) { boltCommand(commandId: $commandId) { command startDttm endDttm stdout stderr returnCode scheduleRunId resources { id path } ok } }",
       "variables": {
         "commandId": 59241
       }
     }'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
import requests
import os
# API credentials
api_endpoint = "<YOUR_API_ENDPOINT>"
api_key = "<YOUR_API_KEY>"
api_secret = "<YOUR_API_SECRET>"
graphql_query = """
query BoltResourceUrl {
    boltResourceUrl(resourceId: 306228) {
        ok
        url
    }
}
  """
  
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())curl -X POST "<YOUR_API_ENDPOINT>" \
     -H "Content-Type: application/json" \
     -H "X-API-KEY: <YOUR_API_KEY>" \
     -H "X-API-SECRET: <YOUR_API_SECRET>" \
     -d '{
       "query": "query BoltResourceUrl($resourceId: Int!) { boltResourceUrl(resourceId: $resourceId) { ok url } }",
       "variables": {
         "resourceId": 306228
       }
     }'Last updated
Was this helpful?