Deactivate a workspace user
curl --request POST \
--url https://api.langdock.com/user-management/v1/deactivate-user \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com"
}
'import requests
url = "https://api.langdock.com/user-management/v1/deactivate-user"
payload = { "email": "user@example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com'})
};
fetch('https://api.langdock.com/user-management/v1/deactivate-user', 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/deactivate-user",
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([
'email' => 'user@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.langdock.com/user-management/v1/deactivate-user"
payload := strings.NewReader("{\n \"email\": \"user@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.langdock.com/user-management/v1/deactivate-user")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/user-management/v1/deactivate-user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"user@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "User deactivated"
}{
"message": "User not found or not an active member"
}{
"message": "User not found or not an active member"
}{
"message": "User not found or not an active member"
}User Management API
Deactivate User
Remove a user from your Langdock workspace while preserving their data
POST
/
user-management
/
v1
/
deactivate-user
Deactivate a workspace user
curl --request POST \
--url https://api.langdock.com/user-management/v1/deactivate-user \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com"
}
'import requests
url = "https://api.langdock.com/user-management/v1/deactivate-user"
payload = { "email": "user@example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'user@example.com'})
};
fetch('https://api.langdock.com/user-management/v1/deactivate-user', 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/deactivate-user",
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([
'email' => 'user@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.langdock.com/user-management/v1/deactivate-user"
payload := strings.NewReader("{\n \"email\": \"user@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.langdock.com/user-management/v1/deactivate-user")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.langdock.com/user-management/v1/deactivate-user")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"user@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "User deactivated"
}{
"message": "User not found or not an active member"
}{
"message": "User not found or not an active member"
}{
"message": "User not found or not an active member"
}This endpoint removes a user from your workspace. Their data — including conversations, agents, files, and integrations — is preserved and fully restored if they are re-added later.
Base URL
https://api.langdock.com/user-management/v1/deactivate-user
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
- User not found or not an active member? Returns
404. - Deactivated users lose workspace access immediately.
- All user data is retained and accessible again upon reactivation.
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.
Authorizations
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Body
application/json
Email address of the user
Example:
"user@example.com"
Was this page helpful?