Endurance

Users

The local user accounts that can log into the appliance and use the API.

Current token

Get your own user account

GET /localUsers/current

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

$url = 'https://appliance.example.com/api/v1/localUsers/current';
$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/localUsers/current", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/localUsers/current', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get your own user account
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/localUsers/current
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Current user",
  "data": {
    "email": "test-test@loadbalancer.org",
    "firstName": "Test Test",
    "lastName": "Test"
  }
}

Update your own user account

PUT /localUsers/current

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

Body parameters
email string Required
firstname string Required
lastname string Required
password string Required
curl
curl -X PUT "https://appliance.example.com/api/v1/localUsers/current" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "<email>",
  "firstname": "<firstname>",
  "lastname": "<lastname>",
  "password": "<password>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/localUsers/current';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'email' => '<email>',
    'firstname' => '<firstname>',
    'lastname' => '<lastname>',
    'password' => '<password>',
];

$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 = {
    "email": "<email>",
    "firstname": "<firstname>",
    "lastname": "<lastname>",
    "password": "<password>"
}

response = requests.put("https://appliance.example.com/api/v1/localUsers/current", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/localUsers/current', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "email": "<email>",
  "firstname": "<firstname>",
  "lastname": "<lastname>",
  "password": "<password>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Update your own user account
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/localUsers/current
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "email": "<email>",
    "firstname": "<firstname>",
    "lastname": "<lastname>",
    "password": "<password>"
  }
}
Response
{
  "status": "success",
  "message": "Your information has been updated"
}

Update a user

Edit a User Refused while a transaction is open. Commit or roll back the transaction first.

PUT /localUsers/users/{id}

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

Path parameters
id string Required

The id of the user.

Body parameters
email string Required
firstname string Required
lastname string Required
password string Required
disabled string default: "false"
groups array
roles array
curl
curl -X PUT "https://appliance.example.com/api/v1/localUsers/users/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "<email>",
  "firstname": "<firstname>",
  "lastname": "<lastname>",
  "password": "<password>",
  "disabled": "false",
  "groups": [
    "<groups>"
  ],
  "roles": [
    "<roles>"
  ]
}'
PHP
<?php

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

$payload = [
    'email' => '<email>',
    'firstname' => '<firstname>',
    'lastname' => '<lastname>',
    'password' => '<password>',
    'disabled' => 'false',
    'groups' => [
        '<groups>',
    ],
    'roles' => [
        '<roles>',
    ],
];

$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 = {
    "email": "<email>",
    "firstname": "<firstname>",
    "lastname": "<lastname>",
    "password": "<password>",
    "disabled": "false",
    "groups": [
        "<groups>"
    ],
    "roles": [
        "<roles>"
    ]
}

response = requests.put("https://appliance.example.com/api/v1/localUsers/users/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/localUsers/users/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "email": "<email>",
  "firstname": "<firstname>",
  "lastname": "<lastname>",
  "password": "<password>",
  "disabled": "false",
  "groups": [
    "<groups>"
  ],
  "roles": [
    "<roles>"
  ]
}),
});

const data = await response.json();
Bruno
meta {
  name: Update a user
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/localUsers/users/{id}
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "email": "<email>",
    "firstname": "<firstname>",
    "lastname": "<lastname>",
    "password": "<password>",
    "disabled": "false",
    "groups": [
      "<groups>"
    ],
    "roles": [
      "<roles>"
    ]
  }
}
Response
{
  "status": "success",
  "message": "User edited"
}

Current token (/userExtras/current)

Get the current user’s Extras (WebUI preferences). When no preferences have been saved yet, the response serializes "extras" as [] (an empty JSON array), not {}.

GET /userExtras/current

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

$url = 'https://appliance.example.com/api/v1/userExtras/current';
$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/userExtras/current", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/userExtras/current', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get your own user preferences
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/userExtras/current
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Your Extras",
  "data": {
    "extras": {
      "menuFloats": true,
      "codeEditorDarkTheme": true
    }
  }
}

Replace the current user’s Extras. Keys must match [A-Za-z0-9_]{1,64}; values must be string/bool/number/null. Sending an empty object {} clears all stored Extras.

PUT /userExtras/current

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

Body parameters
extras object Required

Flat map of preference key/value pairs.

curl
curl -X PUT "https://appliance.example.com/api/v1/userExtras/current" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "extras": {}
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/userExtras/current';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'extras' => [],
];

$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 = {
    "extras": {}
}

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

const data = await response.json();
Bruno
meta {
  name: Update your own user preferences
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/userExtras/current
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "extras": {}
  }
}
Response
{
  "status": "success",
  "message": "Your Extras have been updated"
}