For the complete documentation index, see llms.txt. This page is also available as Markdown.

Using the API to set up a GitHub connection

This page provides an example of using the API to set up a GitHub connection with the Universal Broker. Repeat connecting your Organization for as many integrations as needed.

Using the snyk-broker-config CLI tool is recommended for an easier experience. The API allows for automation and more control, and also requires a clear understanding of Broker deployments, credentials, connections, and integrations.

In any of the calls that follow, replace api.snyk.io with your regional equivalent if necessary, for example, api.eu.snyk.io. For a list of URLs, see API URLs.

Prerequisites

  • You must be a Snyk Tenant admin.

  • You must use a personal Snyk API token. Service account tokens do not work.

  • You need Org admin access for the Organization where you install the Broker app.

All examples on this page use REST API version 2025-11-05.

Install Broker for your Organization

Universal Broker facilitates the secure connection and communication with the Broker server through OAuth.

Install the Broker app at the Organization level. Group-level installation is not supported.

  1. Identify the Snyk Broker App ID for your region.

    • For most regions, the app ID is cb43d761-bd17-4b44-9b6c-e5b8ad077d33.

    • If you are using Snyk for Government, contact your account team for the app ID.

  2. Install the Broker on the Organization you use to administer Broker:

curl --location --request POST 'https://api.snyk.io/rest/orgs/ORG_ID/apps/installs?version=2025-11-05' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: token YOUR_SNYK_TOKEN' \
--data-raw '{
  "data": {
    "type": "app_install",
    "relationships": {
      "app": {
        "data": {
          "id": "SNYK_BROKER_APP_ID",
          "type": "app"
        }
      }
    }
  }
}'

Use the endpoint Install a Snyk App to this Organization as the source of truth for the exact request and response schema.

Save the values needed in later steps:

  • INSTALL_ID is the data.id from the response.

  • The Broker App ID is shown under data.relationships.app.data.id.

  • CLIENT_ID and CLIENT_SECRET (returned by the install call) are needed to run the Broker client.

The installation displays the CLIENT_SECRET only one time. You can rotate the secret using an API call.

Create your deployment

Use the following call to create your deployment.

This returns the DEPLOYMENT_ID (data.id), for example:

At this point, you can start running the Broker client.

Run your Broker deployment

Target your desired environment with the usual -e BROKER_SERVER_URL=https://broker.REGION.snyk.io \ if needed. For a list of URLs, see Broker server URLs.

Use the CLIENT_ID and CLIENT_SECRET values returned when you installed the Broker app.

When the command is running, you should get the following message in the output:

Create your credentials reference or references

This returns the credential reference ID (data. id), for example:

You can create a maximum of ten credentials in one call by adding more objects in attributes. These objects can be of different types.

Create your connection or connections

This returns a Connection ID (data.id), as shown in the example. This call returns the credential reference directly, ready for use, rather than the credential reference UUID.

If your credential reference is missing, you get the following message:

When you update an environment variable, you must restart your Broker. See Restart your Broker for a new environment variable.

You can now use the connection in an Organization integration.

Connect your Organization integration to use a connection

Repeat the process of connecting your Organization for as many integrations as needed.

Last updated

Was this helpful?