> For the complete documentation index, see [llms.txt](https://docs.balkan.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.balkan.id/getting-started/setting-up-your-tenant/application-integrations/direct-application-integrations/semgrep-application-integration-setup.md).

# Semgrep Integration Setup

### Getting Started

Use this guide to connect Semgrep to your BalkanID tenant. You will need an API token from Semgrep and access to the Integrations section in BalkanID.

#### **Requirements:**

Before you begin, collect the following value from Semgrep:

* **API Token**

{% hint style="info" %}
The token must be created by a Semgrep deployment administrator, from **Settings > Tokens**, with **Web API** access explicitly enabled. Member accounts cannot create or view tokens, and a token without Web API access is rejected.
{% endhint %}

### Configure Semgrep within your BalkanID tenant

1. To create the **API Token**, sign in to Semgrep as a deployment administrator.
2. Go to **Settings** > **Tokens**, and create a new token.
3. Under **Access**, enable **Web API**, then click **Create token**. Copy the value — Semgrep displays it only once.
4. In BalkanID, go to **Integrations** and click **Add integration**.
5. Search for **Semgrep**, select it, and click **Next**.

   <div data-with-frame="true"><figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2F71vw667EyjgUSgykJzcA%2Fimage.png?alt=media&amp;token=2528dc43-0cc7-4bee-add7-d1bdb8620655" alt=""><figcaption></figcaption></figure></div>
6. Under **Data Sync Preferences**, choose the entity types you want BalkanID to sync. Everything supported is selected by default. Users are always synced and cannot be deselected, and the relationships between the types you select are synced for you.
7. Under **Select Extraction Type**, choose **Direct Configuration**, paste your **API Token**, then click **Next**.

   <div data-with-frame="true"><figure><img src="https://2975852473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbVGYwk8aSk5yI1GDPEW9%2Fuploads%2FBrl8c2t49wmpMBFI1UeX%2Fimage.png?alt=media&amp;token=dd37dd4f-5104-4729-903d-f9d3145a99b4" alt=""><figcaption></figcaption></figure></div>
8. Click Next to move onto *Optional Configuration.*
9. Fill **Optional Configuration**, if required. This is where you would configure integration-level [reviewer assignment and precedence](/user-access-reviews/access-review-management/how-reviewer-assignment-and-approval-works.md), if required.
10. Once you have filled in the information, click **Save**. Your integration is now configured and you will see the status of the integration displayed alongside other integrations on the Integrations page. When data is available, the integration Status column will read **Connected** and the integration Message will read **Data available**.

### What BalkanID extracts

| Data                 | Description                                                                                                         |
| -------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **Users**            | The members of your Semgrep deployment, their organization role, and whether they are managed through SCIM          |
| **Teams**            | The teams configured in your deployment, and their parent/child structure                                           |
| **Team roles**       | The role a user holds on a specific team                                                                            |
| **Projects**         | The projects in your deployment, and which teams and users can access them                                          |
| **SSO providers**    | The single sign-on providers configured for your deployment, and whether each is enabled                            |
| **SCM integrations** | The source code management integrations connected to your deployment, and the scopes granted to their access tokens |

### Integration Scopes

| Read Only Scopes                                                                                                                                           | Lifecycle Management Scopes |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| **Web API** — everything this integration reads: deployment membership, organization and team roles, teams, projects, SSO providers, and SCM integrations. | N/A                         |

One scope covers everything this integration reads, so **Web API** is the only permission to enable on the token.

Semgrep accounts carry no HR data, so no employee records are extracted.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.balkan.id/getting-started/setting-up-your-tenant/application-integrations/direct-application-integrations/semgrep-application-integration-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
