curl
curl -X POST https://my_sql_node.com/v1/logout
-d '{
"database": "retail_analytics"
}import requests
url = "https://{sql_node}/v1/logout"
payload = { "database": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({database: '<string>'})
};
fetch('https://{sql_node}/v1/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://{sql_node}/v1/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([
'database' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://{sql_node}/v1/logout"
payload := strings.NewReader("{\n \"database\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://{sql_node}/v1/logout")
.header("Content-Type", "application/json")
.body("{\n \"database\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{sql_node}/v1/logout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"database\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"reason": "Logged out successfully",
"sql_state": "00000",
"vendor_code": 0
}
}Ocient HTTP Query API
logout
Log out from a SQL session. This clears any associated cookies, but does not invalidate any access tokens.
This endpoint terminates only the cookie-based session. Any bearer tokens that were previously issued continue to work until they expire.
You must discard any stored bearer tokens to complete the log out in a client application.
POST
/
v1
/
logout
curl
curl -X POST https://my_sql_node.com/v1/logout
-d '{
"database": "retail_analytics"
}import requests
url = "https://{sql_node}/v1/logout"
payload = { "database": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({database: '<string>'})
};
fetch('https://{sql_node}/v1/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://{sql_node}/v1/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([
'database' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://{sql_node}/v1/logout"
payload := strings.NewReader("{\n \"database\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://{sql_node}/v1/logout")
.header("Content-Type", "application/json")
.body("{\n \"database\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{sql_node}/v1/logout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"database\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": {
"reason": "Logged out successfully",
"sql_state": "00000",
"vendor_code": 0
}
}Last modified on July 8, 2026
Was this page helpful?
⌘I

