List assignable roles
curl --request GET \
--url https://api.langdock.com/user-management/v1/roles \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/user-management/v1/roles"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/user-management/v1/roles', 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.langdock.com/user-management/v1/roles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.langdock.com/user-management/v1/roles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.langdock.com/user-management/v1/roles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/user-management/v1/roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"roles": [
{
"id": "member",
"kind": "system",
"name": "Member",
"description": ""
},
{
"id": "editor",
"kind": "system",
"name": "Editor",
"description": ""
},
{
"id": "admin",
"kind": "system",
"name": "Admin",
"description": ""
},
{
"id": "33333333-3333-4333-8333-333333333333",
"kind": "custom",
"name": "Support lead",
"description": "Can view analytics and governance"
}
]
}{
"message": "User not found or not an active member"
}{
"message": "Insufficient API key permissions.",
"error": "INSUFFICIENT_SCOPES",
"details": {
"required": [
"USER_MANAGEMENT_API"
],
"missing": [
"USER_MANAGEMENT_API"
]
}
}{
"message": "User not found or not an active member"
}User Management API
List Roles
List the system roles and custom roles you can assign with the User Management API
GET
/
user-management
/
v1
/
roles
List assignable roles
curl --request GET \
--url https://api.langdock.com/user-management/v1/roles \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.langdock.com/user-management/v1/roles"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.langdock.com/user-management/v1/roles', 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.langdock.com/user-management/v1/roles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.langdock.com/user-management/v1/roles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.langdock.com/user-management/v1/roles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/user-management/v1/roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"roles": [
{
"id": "member",
"kind": "system",
"name": "Member",
"description": ""
},
{
"id": "editor",
"kind": "system",
"name": "Editor",
"description": ""
},
{
"id": "admin",
"kind": "system",
"name": "Admin",
"description": ""
},
{
"id": "33333333-3333-4333-8333-333333333333",
"kind": "custom",
"name": "Support lead",
"description": "Can view analytics and governance"
}
]
}{
"message": "User not found or not an active member"
}{
"message": "Insufficient API key permissions.",
"error": "INSUFFICIENT_SCOPES",
"details": {
"required": [
"USER_MANAGEMENT_API"
],
"missing": [
"USER_MANAGEMENT_API"
]
}
}{
"message": "User not found or not an active member"
}This endpoint lists the system roles and custom roles you can assign with Update User Role. Custom role names are not unique. Use
id when you assign a role.
The call is authorized by the workspace API key’s USER_MANAGEMENT_API scope. It does not run as the person who created the key, so it keeps working after that admin leaves the workspace.
Base URL
https://api.langdock.com/user-management/v1/roles
Dedicated deploymentsReplace
api.langdock.com with <your-deployment-url>/api/public in all requests.Prerequisites
- API Key with the
USER_MANAGEMENT_APIscope - The API key must be created by a workspace admin
Behavior
- System roles come first, in this order:
member,editor,admin.kindissystem.nameis Member, Editor, or Admin.descriptionis empty.idis that lowercase role name. - Custom roles follow, oldest first.
kindiscustom. Deleted custom roles are left out. - Each role has
id,kind,name, anddescription. Permission settings are not included. - The call takes no query parameters.
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.
Was this page helpful?