Get current user
curl --request GET \
--url https://api.galtea.ai/auth/user \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/auth/user"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/auth/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.galtea.ai/auth/user",
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.galtea.ai/auth/user"
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.galtea.ai/auth/user")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/auth/user")
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{
"id": "user_123",
"email": "user@example.com",
"name": "John Doe",
"role": "MEMBER",
"organizationId": "org_123",
"hasPassword": true,
"hasGoogleId": true,
"hasGithubId": true,
"hasGitlabId": true,
"hasSamlId": true,
"hasApiKey": true,
"analyticsConsent": null,
"marketingConsent": false,
"mfaSource": null,
"firstSignInAt": "2023-11-07T05:31:56Z",
"latestSignInAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}Get current user
Get the currently authenticated user. See Registration & Authentication.
GET
/
auth
/
user
Get current user
curl --request GET \
--url https://api.galtea.ai/auth/user \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.galtea.ai/auth/user"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.galtea.ai/auth/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.galtea.ai/auth/user",
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.galtea.ai/auth/user"
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.galtea.ai/auth/user")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/auth/user")
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{
"id": "user_123",
"email": "user@example.com",
"name": "John Doe",
"role": "MEMBER",
"organizationId": "org_123",
"hasPassword": true,
"hasGoogleId": true,
"hasGithubId": true,
"hasGitlabId": true,
"hasSamlId": true,
"hasApiKey": true,
"analyticsConsent": null,
"marketingConsent": false,
"mfaSource": null,
"firstSignInAt": "2023-11-07T05:31:56Z",
"latestSignInAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Response
User retrieved successfully
Example:
"user_123"
Example:
"user@example.com"
Example:
"John Doe"
Available options:
ADMIN, OWNER, MEMBER Example:
"MEMBER"
Example:
"org_123"
Whether the user has a password set
Whether the user has a linked Google account
Whether the user has a linked GitHub account
Whether the user has a linked GitLab account
Whether the user has a linked SAML account
Whether the user currently holds at least one API token
Example:
null
Example:
false
Preferred MFA source; non-null enables MFA, null disables it. Currently only "EMAIL" is supported.
Available options:
EMAIL Example:
null