curl --request POST \
--url https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"credentials": {
"client_id": "<string>",
"client_secret": "<string>"
},
"generate_api_credentials": false,
"identifier": "<string>",
"options": {
"auth_type": "SECRETS",
"external_use_only": false,
"refresh_intervals": {}
},
"source_connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections"
payload = {
"credentials": {
"client_id": "<string>",
"client_secret": "<string>"
},
"generate_api_credentials": False,
"identifier": "<string>",
"options": {
"auth_type": "SECRETS",
"external_use_only": False,
"refresh_intervals": {}
},
"source_connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
credentials: {client_id: '<string>', client_secret: '<string>'},
generate_api_credentials: false,
identifier: '<string>',
options: {auth_type: 'SECRETS', external_use_only: false, refresh_intervals: {}},
source_connection_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'credentials' => [
'client_id' => '<string>',
'client_secret' => '<string>'
],
'generate_api_credentials' => false,
'identifier' => '<string>',
'options' => [
'auth_type' => 'SECRETS',
'external_use_only' => false,
'refresh_intervals' => [
]
],
'source_connection_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections"
payload := strings.NewReader("{\n \"credentials\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n },\n \"generate_api_credentials\": false,\n \"identifier\": \"<string>\",\n \"options\": {\n \"auth_type\": \"SECRETS\",\n \"external_use_only\": false,\n \"refresh_intervals\": {}\n },\n \"source_connection_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n },\n \"generate_api_credentials\": false,\n \"identifier\": \"<string>\",\n \"options\": {\n \"auth_type\": \"SECRETS\",\n \"external_use_only\": false,\n \"refresh_intervals\": {}\n },\n \"source_connection_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n },\n \"generate_api_credentials\": false,\n \"identifier\": \"<string>\",\n \"options\": {\n \"auth_type\": \"SECRETS\",\n \"external_use_only\": false,\n \"refresh_intervals\": {}\n },\n \"source_connection_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"health": {
"description": "<string>",
"name": "HEALTHY",
"resolution_owner": "LEEN",
"status": "HEALTHY",
"details": [
{
"endpoint": "<string>",
"data_export_type": "alerts"
}
]
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refresh_interval_secs": 123,
"state": "PENDING",
"timeout_secs": 123,
"updated_at": "2023-11-07T05:31:56Z",
"vendor": "<string>",
"api_credentials": {
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"rotation_count": 123,
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"allowed_ips": [
"<string>"
],
"description": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"last_rotated_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"rate_limit_per_hour": 123,
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_reason": "<string>",
"secret": "<string>"
},
"direction": "SOURCE",
"identifier": "<string>",
"last_token_issued_at": "2023-11-07T05:31:56Z",
"oauth2_authorize_url": "<string>",
"pull_destination_health": "HEALTHY",
"source_connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Create Connection
Create a connection for a given Organization.
curl --request POST \
--url https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"credentials": {
"client_id": "<string>",
"client_secret": "<string>"
},
"generate_api_credentials": false,
"identifier": "<string>",
"options": {
"auth_type": "SECRETS",
"external_use_only": false,
"refresh_intervals": {}
},
"source_connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections"
payload = {
"credentials": {
"client_id": "<string>",
"client_secret": "<string>"
},
"generate_api_credentials": False,
"identifier": "<string>",
"options": {
"auth_type": "SECRETS",
"external_use_only": False,
"refresh_intervals": {}
},
"source_connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
credentials: {client_id: '<string>', client_secret: '<string>'},
generate_api_credentials: false,
identifier: '<string>',
options: {auth_type: 'SECRETS', external_use_only: false, refresh_intervals: {}},
source_connection_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'credentials' => [
'client_id' => '<string>',
'client_secret' => '<string>'
],
'generate_api_credentials' => false,
'identifier' => '<string>',
'options' => [
'auth_type' => 'SECRETS',
'external_use_only' => false,
'refresh_intervals' => [
]
],
'source_connection_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections"
payload := strings.NewReader("{\n \"credentials\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n },\n \"generate_api_credentials\": false,\n \"identifier\": \"<string>\",\n \"options\": {\n \"auth_type\": \"SECRETS\",\n \"external_use_only\": false,\n \"refresh_intervals\": {}\n },\n \"source_connection_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n },\n \"generate_api_credentials\": false,\n \"identifier\": \"<string>\",\n \"options\": {\n \"auth_type\": \"SECRETS\",\n \"external_use_only\": false,\n \"refresh_intervals\": {}\n },\n \"source_connection_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.leen.dev/v1/provisioning/organizations/{organization_id}/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": {\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\"\n },\n \"generate_api_credentials\": false,\n \"identifier\": \"<string>\",\n \"options\": {\n \"auth_type\": \"SECRETS\",\n \"external_use_only\": false,\n \"refresh_intervals\": {}\n },\n \"source_connection_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"health": {
"description": "<string>",
"name": "HEALTHY",
"resolution_owner": "LEEN",
"status": "HEALTHY",
"details": [
{
"endpoint": "<string>",
"data_export_type": "alerts"
}
]
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"refresh_interval_secs": 123,
"state": "PENDING",
"timeout_secs": 123,
"updated_at": "2023-11-07T05:31:56Z",
"vendor": "<string>",
"api_credentials": {
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"rotation_count": 123,
"status": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"allowed_ips": [
"<string>"
],
"description": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"last_rotated_at": "2023-11-07T05:31:56Z",
"last_used_at": "2023-11-07T05:31:56Z",
"rate_limit_per_hour": 123,
"revoked_at": "2023-11-07T05:31:56Z",
"revoked_reason": "<string>",
"secret": "<string>"
},
"direction": "SOURCE",
"identifier": "<string>",
"last_token_issued_at": "2023-11-07T05:31:56Z",
"oauth2_authorize_url": "<string>",
"pull_destination_health": "HEALTHY",
"source_connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Headers
Path Parameters
Body
Connection credentials
- AikidoCredentials
- ArnicaCredentials
- AwsAccessAnalyzerCredentials
- AwsGuardDutyCredentials
- AwsInspector2Credentials
- AwsSecurityHubCredentials
- BitSightCredentials
- BlackDuckCredentials
- BlackDuckSCACredentials
- BlackKiteCredentials
- CheckmarxCredentials
- CrowdStrikeCredentials
- CrowdStrikeSpotlightCredentials
- GitHubCredentials
- GitlabCredentials
- HeelerCredentials
- InsightVMCredentials
- JiraOAuth2Credentials
- LaceworkCSPMCredentials
- MendCredentials
- MSDefenderCloudCredentials
- MSDefenderEndpointCredentials
- MSDefenderVMSCredentials
- MSDefenderVMSGccHighCredentials
- MSEntraOAuth2Credentials
- MSEntraSecretCredentials
- MSIntuneCredentials
- OktaIDPCredentials
- OrcaCredentials
- ProcessUnityCredentials
- ProofPointCredentials
- QualysCredentials
- SecurityScorecardCredentials
- SemgrepCredentials
- SentinelOneEDRCredentials
- SentinelOneVMSCredentials
- ServiceNowCredentials
- ServiceNowVRCredentials
- SnykCredentials
- SocketCredentials
- SonarQubeCredentials
- TaniumVMSCredentials
- TenableCredentials
- UpwindCredentials
- WizCodeCredentials
- WizCSPMCredentials
- WizVMSCredentials
Show child attributes
Show child attributes
Connection vendor
AIKIDO, ARNICA, AWS_ACCESS_ANALYSER, AWS_GUARDDUTY, AWS_INSPECTOR2, AWS_SECURITYHUB, BIT_SIGHT, BLACK_DUCK_COVERITY, BLACK_DUCK_SCA, BLACK_KITE, CHECKMARX, CROWDSTRIKE, CROWDSTRIKE_SPOTLIGHT, GITHUB, GITLAB, HEELER, INSIGHTVM, JIRA, LACEWORK_CSPM, MEND, MS_DEFENDER_CLOUD, MS_DEFENDER_ENDPOINT, MS_DEFENDER_VMS, MS_DEFENDER_VMS_GCC_HIGH, MS_ENTRA, MS_INTUNE, OKTA_IDP, ORCA, PROCESSUNITY, PROOFPOINT_TAP, QUALYS, SECURITY_SCORECARD, SEMGREP, SENTINELONE, SENTINELONE_VMS, SERVICENOW, SERVICENOW_ITSM, SERVICENOW_VR, SNYK, SOCKET, SONARQUBE, TANIUM_VMS, TENABLE, UPWIND, WIZ_CODE, WIZ_CSPM, WIZ_VMS If true, API credentials (client_id and client_secret) are generated and included in the response.
An optional identifier for the connection, you can use this to reference the connection in your own system
Connection options, ONLY used for Oauth2 URL overrides for Snyk and MS Defender Endpoint
- AikidoConnectionOptions
- ArnicaConnectionOptions
- AwsAccessAnalyzerOptions
- AwsGuardDutyOptions
- AwsInspector2Options
- AwsSecurityHubOptions
- BitSightConnectionOptions
- BlackDuckConnectionOptions
- BlackDuckSCAConnectionOptions
- BlackKiteConnectionOptions
- CheckmarxConnectionOptions
- CrowdStrikeConnectionOptions
- CrowdStrikeSpotlightConnectionOptions
- GitHubConnectionOptions
- GitlabOptions
- HeelerOptions
- InsightVMConnectionOptions
- JiraConnectionOptions
- LaceworkCSPMOptions
- MendConnectionOptions
- MSDefenderCloudConnectionOptions
- MSDefenderEndpointConnectionOptions
- MSDefenderVMSConnectionOptions
- MSDefenderVMSGccHighConnectionOptions
- MSEntraConnectionOptions
- MSIntuneConnectionOptions
- OktaIDPOptions
- OrcaConnectionOptions
- ProcessUnityConnectionOptions
- ProofPointOptions
- QualysConnectionOptions
- SecurityScorecardConnectionOptions
- SemgrepOptions
- SentinelOneEDROptions
- SentinelOneVMSOptions
- ServiceNowGRCConnectionOptions
- ServiceNowITSMConnectionOptions
- ServiceNowVROptions
- SnykConnectionOptions
- SocketOptions
- SonarQubeConnectionOptions
- TaniumVMSOptions
- TenableConnectionOptions
- UpwindConnectionOptions
- WizCodeOptions
- WizCSPMOptions
- WizVMSOptions
Show child attributes
Show child attributes
For pull destinations only: the id of the source connection this destination reads through. Must belong to the same organization.
Response
Successful Response
When the connection was created.
Whether the connection is working, and who has to act if it is not -- a revoked credential is yours to fix, a vendor outage is not.
Show child attributes
Show child attributes
Leen's identifier for this connection. Pass it as connection_id when reading data.
Whether scheduled syncing runs. Separate from state: a connection can be ACTIVE with syncing switched off.
The organization this connection belongs to.
Seconds between scheduled syncs. Defaults to 14400 -- four hours.
Lifecycle state. PENDING until credentials are accepted, then ACTIVE. PAUSED stops syncing without discarding anything; DELETED is a soft delete and its data is no longer readable.
PENDING, ACTIVE, PAUSED, DELETED, HARD_DELETED How long a single sync may run before it is abandoned. Defaults to 3600.
When any field on the connection last changed.
The tool this connection reads from or writes to, e.g. SNYK, QUALYS.
The credentials this connection authenticates with. Secret values are redacted; what is returned is enough to tell which credential is in use, not enough to reuse it.
Show child attributes
Show child attributes
Which way data moves. SOURCE reads from the vendor; the destination kinds write to it, and are what a push or pull integration uses.
SOURCE, PUSH_DESTINATION, PULL_DESTINATION Your own reference for this connection, set when it was created. Leen does not interpret it; it is here so you can match a connection to a record in your system.
Pull destinations only: latest access-token mint time across active secrets. Used as a freshness proxy since these connections never sync.
Where to send the user to authorise this connection, for vendors that use OAuth2. Null once authorisation is complete, and for every vendor that authenticates another way.
Pull destinations only: HEALTHY if a token was minted within the staleness window, STALE otherwise (including if none was ever minted).
HEALTHY, STALE For a destination connection, the source whose data it forwards. Null on a source connection.