Review a CLI login request
curl --request GET \
--url https://api.pyai.com/auth/cli/device \
--cookie pyai_session=import requests
url = "https://api.pyai.com/auth/cli/device"
headers = {"cookie": "pyai_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'pyai_session='}};
fetch('https://api.pyai.com/auth/cli/device', 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.pyai.com/auth/cli/device",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "pyai_session=",
]);
$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.pyai.com/auth/cli/device"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "pyai_session=")
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.pyai.com/auth/cli/device")
.header("cookie", "pyai_session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/auth/cli/device")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'pyai_session='
response = http.request(request)
puts response.read_body{
"user_code": "<string>",
"client_name": "PyAI CLI",
"status": "pending",
"expires_at": 123,
"scopes": [
"<string>"
],
"credential_ttl_seconds": 2592000
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Identity
Review a CLI login request
GET
/
auth
/
cli
/
device
Review a CLI login request
curl --request GET \
--url https://api.pyai.com/auth/cli/device \
--cookie pyai_session=import requests
url = "https://api.pyai.com/auth/cli/device"
headers = {"cookie": "pyai_session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'pyai_session='}};
fetch('https://api.pyai.com/auth/cli/device', 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.pyai.com/auth/cli/device",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "pyai_session=",
]);
$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.pyai.com/auth/cli/device"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "pyai_session=")
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.pyai.com/auth/cli/device")
.header("cookie", "pyai_session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pyai.com/auth/cli/device")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'pyai_session='
response = http.request(request)
puts response.read_body{
"user_code": "<string>",
"client_name": "PyAI CLI",
"status": "pending",
"expires_at": 123,
"scopes": [
"<string>"
],
"credential_ttl_seconds": 2592000
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}{
"title": "<string>",
"status": 123,
"type": "<string>",
"detail": "<string>",
"request_id": "<string>"
}Authorizations
Console session cookie. PyAI-admin routes also require the configured platform-admin email allowlist.
Query Parameters
Pattern:
^[A-Z2-9]{4}-[A-Z2-9]{4}$Response
Consent details; never contains a device secret or an API key.