OAuth
Get OAuth session info for consent page
Retrieves user information, CSRF token, and authorized domains for the OAuth consent page. The session ID is obtained from the OAuth callback redirect.
GET
/
oauth
/
session-info
Get OAuth session info for consent page
curl --request GET \
--url https://app.usechar.ai/api/oauth/session-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.usechar.ai/api/oauth/session-info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.usechar.ai/api/oauth/session-info', 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.usechar.ai/api/oauth/session-info",
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://app.usechar.ai/api/oauth/session-info"
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://app.usechar.ai/api/oauth/session-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.usechar.ai/api/oauth/session-info")
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{
"user": {
"email": "<string>",
"name": "<string>",
"organizationName": "<string>"
},
"domains": [
"<string>"
],
"csrfToken": "<string>",
"needsOrgCreation": true,
"suggestedOrgName": "<string>",
"warning": "<string>"
}{
"defined": true,
"code": "BAD_REQUEST",
"status": 400,
"message": "Invalid request",
"data": {
"code": "BAD_REQUEST",
"details": "<string>"
}
}{
"defined": true,
"code": "CONFLICT",
"status": 409,
"message": "Resource conflict",
"data": {
"code": "DUPLICATE_RESOURCE",
"resource": "<string>",
"conflictingField": "<string>"
}
}{
"defined": true,
"code": "INTERNAL_SERVER_ERROR",
"status": 500,
"message": "Internal server error",
"data": {
"code": "INTERNAL_ERROR"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Session UUID from OAuth callback
Response
OK
Show child attributes
Show child attributes
List of authorized domains
CSRF token for consent form submission
Whether user needs to create an organization before continuing
Suggested organization name from email domain
Warning message (e.g., org context failed to load)
⌘I
Get OAuth session info for consent page
curl --request GET \
--url https://app.usechar.ai/api/oauth/session-info \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.usechar.ai/api/oauth/session-info"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.usechar.ai/api/oauth/session-info', 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.usechar.ai/api/oauth/session-info",
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://app.usechar.ai/api/oauth/session-info"
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://app.usechar.ai/api/oauth/session-info")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.usechar.ai/api/oauth/session-info")
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{
"user": {
"email": "<string>",
"name": "<string>",
"organizationName": "<string>"
},
"domains": [
"<string>"
],
"csrfToken": "<string>",
"needsOrgCreation": true,
"suggestedOrgName": "<string>",
"warning": "<string>"
}{
"defined": true,
"code": "BAD_REQUEST",
"status": 400,
"message": "Invalid request",
"data": {
"code": "BAD_REQUEST",
"details": "<string>"
}
}{
"defined": true,
"code": "CONFLICT",
"status": 409,
"message": "Resource conflict",
"data": {
"code": "DUPLICATE_RESOURCE",
"resource": "<string>",
"conflictingField": "<string>"
}
}{
"defined": true,
"code": "INTERNAL_SERVER_ERROR",
"status": 500,
"message": "Internal server error",
"data": {
"code": "INTERNAL_ERROR"
}
}
