> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/platform-administration/snyk-broker/universal-broker/using-the-api-to-set-up-universal-broker.md).

# Using the API to set up Universal Broker

All flows available in the `snyk-broker-config` CLI tool are built on top of the public REST API. The workflows in the CLI tool implement particular flows to provide for ease of setup and use. The same workflows can be accomplished using the API, allowing for automation.

The `snyk-broker-config` tool provides non-workflow commands to simplify the automation of particular tasks through simple bash scripting, avoiding the use of a more complicated API-only path.

## Prerequisites

Before you begin, ensure you have:

* A **personal Snyk API token** for a user. Service account tokens do not work for Universal Broker setup.
* **Snyk Tenant admin** permissions.
* **Org admin** access for the Organization where you install the Snyk Broker App.
* Access to a command-line tool like `curl` and `jq` for JSON parsing (recommended).
* Any necessary pre-configurations for your specific SCM integration.
* Snyk Broker App ID whenever you want to call the API. For most regions, the Snyk Broker App ID is: `cb43d761-bd17-4b44-9b6c-e5b8ad077d33`\
  If you are using a Snyk for Government tenant, contact your account team for the App ID.

{% hint style="info" %}
When you change an environment variable, you must restart your Broker.
{% endhint %}

## Understand the workflow

The [Universal Broker workflow diagrams](/platform-administration/snyk-broker/universal-broker/using-the-api-to-set-up-universal-broker/universal-broker-workflow-diagrams.md) illustrate the steps that are implemented in the `snyk broker config` tool when you use the commands to automate. The same workflows are implemented when you use the API.

## API configuration for Broker

You can either follow the general API steps to understand the underlying process or go directly to a specific SCM tutorial for detailed API commands. Use the instructions provided under the [Universal Broker API](/developer-tools/snyk-api/reference/universal-broker.md) or specific instructions on how to [Set up an SCM connection using the API](/platform-administration/snyk-broker/universal-broker/using-the-api-to-set-up-universal-broker/using-the-api-to-set-up-a-github-connection.md).

See the [Universal Broker APIs ](/developer-tools/snyk-api/reference/universal-broker.md)in the API Reference for more details. An example is provided: [Using the API to set up a GitHub connection](/platform-administration/snyk-broker/universal-broker/using-the-api-to-set-up-universal-broker/using-the-api-to-set-up-a-github-connection.md).

{% hint style="info" %}
Use the Snyk Broker App ID whenever you want to call the API. The Snyk Broker App ID differs for each [region](/snyk-data-and-governance/regional-hosting-and-data-residency.md#broker-client-urls).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.snyk.io/platform-administration/snyk-broker/universal-broker/using-the-api-to-set-up-universal-broker.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
