Endurance

LDAP

Configuration

GET /ldap/config

Get the LDAP configuration (bind password masked)

curl
curl -X GET "https://appliance.example.com/api/v1/ldap/config" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ldap/config';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/ldap/config", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ldap/config', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "LDAP configuration",
  "data": [
    {
      "bindPassword": "********",
      "bindDn": "cn=svc,dc=example,dc=com",
      "baseDn": "dc=example,dc=com",
      "encryption": "none"
    }
  ]
}

PUT /ldap/config

Update the LDAP configuration and group mappings

This change is staged. Send PUT /services/apply to apply it.

curl
curl -X PUT "https://appliance.example.com/api/v1/ldap/config" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ldap/config';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.put("https://appliance.example.com/api/v1/ldap/config", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ldap/config', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "LDAP configuration updated",
  "data": []
}

Test the LDAP connection

POST /ldap/config/test

Test the LDAP connection without saving

This change is staged. Send PUT /services/apply to apply it.

curl
curl -X POST "https://appliance.example.com/api/v1/ldap/config/test" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ldap/config/test';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.post("https://appliance.example.com/api/v1/ldap/config/test", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ldap/config/test', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Connection test complete",
  "data": {
    "stage": "bind",
    "ok": false
  }
}

List the LDAP users

GET /ldap/users

Get all JIT-provisioned LDAP users

curl
curl -X GET "https://appliance.example.com/api/v1/ldap/users" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ldap/users';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/ldap/users", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ldap/users', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "All LDAP users",
  "data": []
}

Users by ID

GET /ldap/users/{id}

Get an LDAP user by id

Path parameters
id string Required
curl
curl -X GET "https://appliance.example.com/api/v1/ldap/users/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ldap/users/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/ldap/users/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ldap/users/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Get LDAP user",
  "data": []
}

PUT /ldap/users/{id}

Enable or disable an LDAP user

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

.Body parameters

disabled boolean Required
curl
curl -X PUT "https://appliance.example.com/api/v1/ldap/users/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "disabled": true
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ldap/users/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'disabled' => true,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "disabled": true
}

response = requests.put("https://appliance.example.com/api/v1/ldap/users/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ldap/users/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "disabled": true
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "LDAP user updated",
  "data": []
}

DELETE /ldap/users/{id}

Delete an LDAP user record

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required
curl
curl -X DELETE "https://appliance.example.com/api/v1/ldap/users/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ldap/users/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/ldap/users/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ldap/users/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "LDAP user deleted",
  "data": []
}