Skip to main content
POST
/
white-label
/
logout
Logout platform user
curl --request POST \
  --url https://app.autocalls.ai/api/white-label/logout \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_id": 123,
  "email": "<string>",
  "token_id": 123
}
'
import requests

url = "https://app.autocalls.ai/api/white-label/logout"

payload = {
"user_id": 123,
"email": "<string>",
"token_id": 123
}
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({user_id: 123, email: '<string>', token_id: 123})
};

fetch('https://app.autocalls.ai/api/white-label/logout', 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://app.autocalls.ai/api/white-label/logout",
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([
'user_id' => 123,
'email' => '<string>',
'token_id' => 123
]),
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://app.autocalls.ai/api/white-label/logout"

payload := strings.NewReader("{\n \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_id\": 123\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://app.autocalls.ai/api/white-label/logout")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_id\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.autocalls.ai/api/white-label/logout")

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 \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_id\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "message": "User logged out successfully."
}
{
  "error": "You are not a white label admin."
}
{
  "error": "User not found."
}
{
  "message": "Either user_id or email is required.",
  "errors": {
    "user_id": ["Either user_id or email is required."]
  }
}
This endpoint allows white label admins to revoke API tokens for one of their platform users, effectively logging them out.
This endpoint requires authentication as a white label admin. You can only logout users belonging to your platform.

Request Body

user_id
integer
The ID of the user to logout. Required if email is not provided.
email
string
The email of the user to logout. Required if user_id is not provided.
token_id
integer
Optional. The specific token ID to revoke. If not provided, all tokens for the user will be revoked.

Response

message
string
Success message
{
  "message": "User logged out successfully."
}
{
  "error": "You are not a white label admin."
}
{
  "error": "User not found."
}
{
  "message": "Either user_id or email is required.",
  "errors": {
    "user_id": ["Either user_id or email is required."]
  }
}

Example: Logout by Email (All Tokens)

curl -X POST https://app.autocalls.ai/api/white-label/logout \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "platformuser@example.com"
  }'

Example: Logout Specific Token

curl -X POST https://app.autocalls.ai/api/white-label/logout \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123,
    "token_id": 45
  }'