> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leen.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating a new connection

> Due to a limitation in our docs it has become confusing to figure out how to create a new connection. This guide will help you through the process.

Before you can create a new connection we need a few prerequisites: an API Key and an Organization.
For more information on these two items please review our quick start guide [here](intro/quick-start).

The last step of the quick start describes how to create a new connection, the POST body consists of:

1. `vendor` - The Enum of the vendor product you want to connect to. Use [List Integration Details](https://docs.leen.dev/api-reference/integration-details/list-integration-details.md) to discover valid `vendor` values and the credential fields each one requires.
2. `credentials` - The specific credential body for the vendor you are connecting to, this is not required for Oauth based connections.
3. `options` - (Optional) Any additional options you want to pass to the connection, each vendor has different options available.

Since creating a connection requires you to have the correct combination of vendor, credentials, and options in the correct combination we have provided examples of each below.

## VMS Connections

> [accordion] Tenable
>
> ```json theme={null}
> {
>   "credentials": {
>     "client_key": "<string>",
>     "secret_key": "<string>"
>   },
>   "vendor": "TENABLE"
> }
> ```

> [accordion] Qualys
>
> ```json theme={null}
> {
>   "credentials": {
>       "username": "test",
>       "password": "pass",
>   },
>   "options": { # Optional not required
>       "init_load_timestamp": "2021-01-01T00:00:00+00:00", # Timestamp to start the data pull from
>   },
>   "vendor": "QUALYS"
> }
> ```

> [accordion] InsightVM
>
> ```json theme={null}
> {
>   "credentials": {
>     "base_url": "https://api.url.com",
>     "api_key": "api_key"
>   },
>   "vendor": "INSIGHTVM"
> }
> ```

> [accordion] MS Defender VMS
>
> Admin consent — the customer authorizes Leen's Microsoft Defender app. The response carries an
> `oauth2_authorize_url` to send them to.
>
> ```json theme={null}
> {
>   "vendor": "MS_DEFENDER_VMS",
>   "options": { # Optional not required
>     "oauth2_redirect_urls": { # Overried the default redirect to Leen's splash page'
>       "success": "https://myapp.com/success",
>       "error": "https://myapp.com/error"
>     }
>   }
> }
> ```
>
> Or the customer's own app registration. All three values are required together, and the response
> carries no `oauth2_authorize_url` — the connection is active immediately.
>
> ```json theme={null}
> {
>   "vendor": "MS_DEFENDER_VMS",
>   "credentials": {
>     "tenant_id": "...",    # Directory (tenant) ID
>     "client_id": "...",    # Application (client) ID
>     "client_secret": "..." # the secret Value, not the Secret ID
>   }
> }
> ```
>
> More info on both flows can be found [here](https://docs.leen.dev/integrations/ms-defender-vms-credential.md)

> [accordion] SentinelOne VMS
>
> ```json theme={null}
> {
>   "credentials": {
>     "base_url": "https://api.url.com",
>     "api_token": "api_token"
>   },
>   "vendor": "SENTINELONE_VMS"
> }
> ```

> [accordion] CrowdStrike Spotlight
>
> ```json theme={null}
> {
>   "credentials": {
>     "client_id": "client_id",
>     "client_secret": "client_secret"
>   },
>   "vendor": "CROWDSTRIKE_SPOTLIGHT"
> }
> ```

> [accordion] AWS Inspector2
>
> > [accordion] Direct access
> >
> > ```json theme={null}
> > {
> >   "credentials": {
> >     "aws": {
> >       "aws_access_key_id": "access_key_id",
> >       "aws_secret_access_key": "secret_key",
> >       "aws_region_name": "us-east-1",
> >       "type": "direct_access"
> >     }
> >   },
> >   "vendor": "AWS_INSPECTOR2"
> > }
> > ```
>
> > [accordion] Leen Role
> >
> > ```json theme={null}
> > {
> >   "credentials": {
> >     "aws": {
> >       "aws_role_arn": "role_arn",
> >       "external_id": "external_id",
> >       "aws_region_name": "us-east-1",
> >       "type": "leen_role"
> >     }
> >   },
> >   "vendor": "AWS_INSPECTOR2"
> > }
> > ```
>
> > [accordion] Role Chaining
> >
> > ```json theme={null}
> > {
> >   "credentials": {
> >     "aws": {
> >       "aws_role_arn": "role_arn",
> >       "external_id": "external_id",
> >       "aws_region_name": "us-east-1",
> >       "type": "role_chaining"
> >     }
> >   },
> >   "vendor": "AWS_INSPECTOR2"
> > }
> > ```

> [accordion] Wiz VMS
>
> ```json theme={null}
> {
>   "credentials": {
>     "base_url": "https://api.usxx.app.wiz.io",
>     "client_id": "client_id",
>     "client_secret": "client_secret"
>   },
>   "vendor": "WIZ_VMS"
> }
> ```

## EDR Connections

> [accordion] MS Defender Endpoint
>
> Admin consent — the customer authorizes Leen's Microsoft Defender app. The response carries an
> `oauth2_authorize_url` to send them to.
>
> ```json theme={null}
> {
>   "vendor": "MS_DEFENDER_ENDPOINT",
>   "options": { # Optional not required
>     "oauth2_redirect_urls": { # Overried the default redirect to Leen's splash page'
>       "success": "https://myapp.com/success",
>       "error": "https://myapp.com/error"
>     }
>   }
> }
> ```
>
> Or the customer's own app registration. All three values are required together, and the response
> carries no `oauth2_authorize_url` — the connection is active immediately.
>
> ```json theme={null}
> {
>   "vendor": "MS_DEFENDER_ENDPOINT",
>   "credentials": {
>     "tenant_id": "...",    # Directory (tenant) ID
>     "client_id": "...",    # Application (client) ID
>     "client_secret": "..." # the secret Value, not the Secret ID
>   }
> }
> ```
>
> More info on both flows can be found [here](https://docs.leen.dev/integrations/ms-defender-credential.md)

> [accordion] SentinelOne Endpoint
>
> ```json theme={null}
> {
>   "credentials": {
>     "base_url": "https://api.url.com",
>     "api_token": "api_token"
>     },
>     "vendor": "SENTINELONE"
> }
> ```

> [accordion] CrowdStrike Falcon
>
> ```json theme={null}
> {
>   "credentials": {
>     "client_id": "client_id",
>     "client_secret": "client_secret"
>   },
>   "vendor": "CROWDSTRIKE"
> }
> ```

## AppSec Connections

> [accordion] Snyk
>
> Both routes below take `base_url`, which selects the Snyk region. It must be one of
> `https://app.snyk.io` (US-01, the default), `https://app.us.snyk.io` (US-02) or
> `https://app.eu.snyk.io` (EU-01). Use the app hostname, not the API one. On the OAuth route it
> also decides which region the returned `oauth2_authorize_url` points at, so send it whenever the
> customer is not on US-01.
>
> OAuth — the customer authorizes Leen's Snyk app. The response carries an
> `oauth2_authorize_url` to send them to.
>
> ```json theme={null}
> {
>     "vendor": "SNYK",
>     "credentials": {
>         "base_url": "https://app.us.snyk.io" # Optional, defaults to https://app.snyk.io
>     },
>     "options": { # Optional not required
>         "oauth2_redirect_urls": { # Overried the default redirect to Leen's splash page'
>           "success": "https://myapp.com/success",
>           "error": "https://myapp.com/error"
>         }
>     }
> }
> ```
>
> Or a Snyk API token, from a service account with the Org Admin role. The response carries no
> `oauth2_authorize_url` — the connection is active immediately.
>
> ```json theme={null}
> {
>     "vendor": "SNYK",
>     "credentials": {
>         "api_token": "...",
>         "base_url": "https://app.us.snyk.io" # Optional, defaults to https://app.snyk.io
>     }
> }
> ```
>
> More info on both flows can be found [here](https://docs.leen.dev/integrations/snyk-credential.md)

> [accordion] Semgrep
>
> ```json theme={null}
> {
>   "vendor": "SEMGREP",
>   "credentials": {
>     "web_api_token": "web_api_token"
>   }
> }
> ```

> [accordion] Aikido
>
> ```json theme={null}
> {
>   "vendor": "AIKIDO",
>   "credentials": {
>     "client_id": "client_id",
>     "client_secret": "client_secret",
>   }
> }
> ```

> [accordion] Wiz Code
>
> ```json theme={null}
> {
>   "credentials": {
>     "base_url": "https://api.usxx.app.wiz.io",
>     "client_id": "client_id",
>     "client_secret": "client_secret"
>   },
>   "vendor": "WIZ_CODE"
> }
> ```

> [accordion] Checkmarx
>
> ```json theme={null}
> {
>   "credentials": {
>     "base_url": "https://us.ast.checkmarx.net",
>     "tenant_name": "tenant-name",
>     "client_id": "client_id",
>     "client_secret": "client_secret"
>   },
>   "vendor": "CHECKMARX"
> }
> ```

> [accordion] Mend.io
>
> ```json theme={null}
> {
>   "credentials": {
>     "user_email": "user-email",
>     "user_key": "user-key",
>     "org_uuid": "org-uuid",
>     "base_url": "https://api-saas.mend.io"
>   }
>   "vendor": "MEND"
> },
> ```

## IDP Connections

> [accordion] Okta
>
> ```json theme={null}
> {
>     "vendor": "OKTA",
>     "credentials": {
>       "org_url": "https://{your-tenant}.okta.com",
>       "api_token": "api_token"
>     }
> }
> ```

> [accordion] MS Entra
>
> > [accordion] OAuth2
> >
> > ```json theme={null}
> > {
> >   "vendor": "MS_ENTRA",
> >   "options": { # Optional not required
> >     "oauth2_redirect_urls": { # Overried the default redirect to Leen's splash page'
> >       "success": "https://myapp.com/success",
> >       "error": "https://myapp.com/error"
> >     }
> >   }
> > }
> > ```
> >
> > More info on our OAuth flow can be found [here](https://docs.leen.dev/integrations/ms-entra-idp-credential.md)
>
> > [accordion] Secret
> >
> > ```json theme={null}
> > {
> >   "vendor": "MS_ENTRA",
> >   "credentials": {
> >     "client_id": "client_id",
> >     "client_secret": "client_secret",
> >     "tenant_id": "tenant_id"
> >   }
> > }
> > ```

## TPRM Connections

> [accordion] Black Kite
>
> ```json theme={null}
> {
>   "credentials": {
>     "client_id": "client_id",
>     "client_secret": "client_secret"
>   },
>   "vendor": "BLACK_KITE"
> }
> ```

> [accordion] BitSight
>
> ```json theme={null}
> {
>   "credentials": {
>     "username": "<generated_api-token>"
>   },
>   "vendor": "BIT_SIGHT"
> }
> ```

> [accordion] SecurityScorecard
>
> ```json theme={null}
> {
>   "credentials": {
>     "api_key": "<generated_api-token>"
>   },
>   "vendor": "SECURITY_SCORECARD",
> }
> ```

> [accordion] ProcessUnity
>
> ```json theme={null}
> {
>     "credentials": {
>         "base_url": "https://{region}.processunity.net/{InstanceName}",
>         "username": "<PU username>",
>         "password": "<PU password>",
>         "third_party_import_template_id": "<Int, Third Party Import Template ID>",
>         "issues_import_template_id": "<Int, Issues Import Template ID>"
>     },
>     "vendor": "PROCESSUNITY",
>     "options": {
>         "connection_id": "<Leen connection id of source connection>"
>     }
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.