curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/ldap/synchronize?token=' \
--header 'Content-Type: application/json' \
--data '
{
"credentials": {},
"options": {},
"query": "(objectclass=*)"
}
'import requests
url = "https://sandbox.circularo.com/api/v1/ldap/synchronize?token="
payload = {
"credentials": {},
"options": {},
"query": "(objectclass=*)"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({credentials: {}, options: {}, query: '(objectclass=*)'})
};
fetch('https://sandbox.circularo.com/api/v1/ldap/synchronize?token=', 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://sandbox.circularo.com/api/v1/ldap/synchronize?token=",
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' => [
],
'options' => [
],
'query' => '(objectclass=*)'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://sandbox.circularo.com/api/v1/ldap/synchronize?token="
payload := strings.NewReader("{\n \"credentials\": {},\n \"options\": {},\n \"query\": \"(objectclass=*)\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandbox.circularo.com/api/v1/ldap/synchronize?token=")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": {},\n \"options\": {},\n \"query\": \"(objectclass=*)\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/ldap/synchronize?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": {},\n \"options\": {},\n \"query\": \"(objectclass=*)\"\n}"
response = http.request(request)
puts response.read_body{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 500,
"type": "SYSTEM:INTERNAL_ERROR",
"message": "Internal error",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Synchronize users and groups from Active Directory
POST /ldap/synchronize
Reads users and groups out of Active Directory and brings them into Circularo. The directory to talk to and the attribute mapping to translate its entries through both come from the login configuration that applies to you, group membership is worked out from the directory and written onto the users, and both users and groups are created when they are new and updated when they already exist. Where organizations are switched on, everything synchronized is filed under the tenant’s default organization.
The synchronization only ever adds and refreshes. A user or group that has disappeared from the directory is left exactly as it is, a group a user was removed from in the directory stays on them here, and a user found in the directory is set active even if the account had been suspended. Nothing is ever written back to the directory.
Run it with dryRun first to see what the directory returns. The report is the same either way - the directory entries as they were read and mapped, split into users, groups and entries that are neither - so it shows what the search found rather than what changed; a real run reports the same entries even for the few it had to skip as unusable.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
Required user rights: ad_synchronize
Required user role: admin
curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/ldap/synchronize?token=' \
--header 'Content-Type: application/json' \
--data '
{
"credentials": {},
"options": {},
"query": "(objectclass=*)"
}
'import requests
url = "https://sandbox.circularo.com/api/v1/ldap/synchronize?token="
payload = {
"credentials": {},
"options": {},
"query": "(objectclass=*)"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({credentials: {}, options: {}, query: '(objectclass=*)'})
};
fetch('https://sandbox.circularo.com/api/v1/ldap/synchronize?token=', 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://sandbox.circularo.com/api/v1/ldap/synchronize?token=",
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' => [
],
'options' => [
],
'query' => '(objectclass=*)'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://sandbox.circularo.com/api/v1/ldap/synchronize?token="
payload := strings.NewReader("{\n \"credentials\": {},\n \"options\": {},\n \"query\": \"(objectclass=*)\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://sandbox.circularo.com/api/v1/ldap/synchronize?token=")
.header("Content-Type", "application/json")
.body("{\n \"credentials\": {},\n \"options\": {},\n \"query\": \"(objectclass=*)\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/ldap/synchronize?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"credentials\": {},\n \"options\": {},\n \"query\": \"(objectclass=*)\"\n}"
response = http.request(request)
puts response.read_body{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 404,
"type": "RESOURCE:NOT_FOUND",
"message": "Resource not found",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 409,
"type": "RESOURCE:STATE_CONFLICT",
"message": "Resource state conflict",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 500,
"type": "SYSTEM:INTERNAL_ERROR",
"message": "Internal error",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Query Parameters
Body
Directory access to use instead of the configured one, as baseDN, username and password - the search base and the bind identity. Anything given here overrides the stored login configuration for this one call; anything left out falls back to it. The server address itself always comes from the configuration and cannot be overridden.
Response
Returns the directory entries that were read, mapped and grouped into users, groups and everything else.