API Access

The 5X Managed dbt Core™ APIs allow users to orchestrate and manage dbt projects from client-side infrastructure. It supports API access using API tokens to authorize requests for executing queries against 5X Managed dbt Core™.

API Server URL

Production server (UTC): https://dbt.5x.co

Authentication and access tokens

The API access token provides access scoped to a GitHub account and enables control to perform 5X Managed dbt Core™ operations for Jobs and Job Runs. Users can seamlessly schedule and manage their dbt Jobs from preferred orchestration tools.

To generate the access token, refer to the following steps:

  1. Navigate to your 5X Managed dbt Core™ Project Settings and click View Access Tokens.

  2. Click + Create Token to create a token. Enter the token name and Create.

The new access token is generated.

5X Managed dbt Core authenticates API requests by adding the token using the API Key in the request header. Refer to Authentication to process and send the authorization in the header.

Example: We’re using PostMan to illustrate the authentication and Job ID setup.

  1. Once authenticated, you can customize your 5X Managed dbt Core™ functions to schedule and manage job runs. The response header returns string type application/JSON file. Users can add the Job ID in the body to trigger the API functions.

Select the job to retrieve the Job ID on the job header.

Currently, we support the following APIs:

  • POST Trigger Job: Trigger a 5X Managed dbt Core™ job on an external dbt environment.

  • GET Fetch Job Run Status: Retrieve the status and details of a 5X Managed dbt Core™ job run in a custom dbt environment.

  • GET Fetch All Job Runs: Retrieve the status and details of a 5X Managed dbt Core™ job run in a custom dbt environment.

Users can refer to developer docs to access and perform API functions.

Set up a DBT TOKEN

When creating a CI Job, users need to set up the access token and connect to their repository to authorize access. 5X Managed dbt Core™ requires users to name the Access Token in the GitHub Secrets with DBT_TOKEN.

CI Jobs are only supported for dbt projects connected to external GitHub repositories.

To set up your access token,

  1. Navigate to your 5X Managed dbt Core™ Project Settings and create an Access Token.

  2. Navigate to Security and click Secrets and variables on the left navigation bar of your GitHub repository.

Add the secret name and the saved dbt project secret key.

Once you have added the secret key to your dbt project’s repository, you can successfully create and run Slim CI Jobs.

Deploy Keys

When setting up the development environment and repository to access the Console on your dbt project, users need to deploy a public key to the connected GitHub repository. Follow the steps below to add deploy keys and access the Console on 5X Managed dbt Core™.

  1. Click Setup Repository on the Console of your dbt project.

  2. Click on the repository on the Project Settings popup to clone settings. Copy the deploy key to add to your repository.

  3. Navigate to the Settings of your GitHub repository. Click Deploy Keys from the Security section on the left navigation bar. Add a new deploy key as required. It is mandatory to Allow write access.

  4. Once added, you have connected the dbt project Console by deploying a public key. Refresh the Console to access it.

Last updated