Approve Agent Authorization
curl --request POST \
--url https://api.casparser.in/v1/agent-auth/token/{token}/approve \
--header 'Content-Type: application/json' \
--data '
{
"id_token": "<string>",
"client_name": "Claude Code"
}
'import requests
url = "https://api.casparser.in/v1/agent-auth/token/{token}/approve"
payload = {
"id_token": "<string>",
"client_name": "Claude Code"
}
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({id_token: '<string>', client_name: 'Claude Code'})
};
fetch('https://api.casparser.in/v1/agent-auth/token/{token}/approve', 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.casparser.in/v1/agent-auth/token/{token}/approve",
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([
'id_token' => '<string>',
'client_name' => 'Claude Code'
]),
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://api.casparser.in/v1/agent-auth/token/{token}/approve"
payload := strings.NewReader("{\n \"id_token\": \"<string>\",\n \"client_name\": \"Claude Code\"\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://api.casparser.in/v1/agent-auth/token/{token}/approve")
.header("Content-Type", "application/json")
.body("{\n \"id_token\": \"<string>\",\n \"client_name\": \"Claude Code\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v1/agent-auth/token/{token}/approve")
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 \"id_token\": \"<string>\",\n \"client_name\": \"Claude Code\"\n}"
response = http.request(request)
puts response.read_body{
"status": "approved",
"email": "user@example.com"
}{
"detail": "Token must be 16-128 characters"
}{
"detail": "Invalid identity token"
}{
"detail": "Unsupported sign-in method"
}{
"detail": "Token already approved or storage unavailable"
}Agent Auth
Approve Agent Authorization
Called by the frontend after the user signs in.
Verifies the identity token, creates or looks up the user’s API key,
and stores it against the token for the agent to poll via GET /v1/agent-auth/token/{token}.
This endpoint is called by the browser, not by agents directly.
POST
/
v1
/
agent-auth
/
token
/
{token}
/
approve
Approve Agent Authorization
curl --request POST \
--url https://api.casparser.in/v1/agent-auth/token/{token}/approve \
--header 'Content-Type: application/json' \
--data '
{
"id_token": "<string>",
"client_name": "Claude Code"
}
'import requests
url = "https://api.casparser.in/v1/agent-auth/token/{token}/approve"
payload = {
"id_token": "<string>",
"client_name": "Claude Code"
}
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({id_token: '<string>', client_name: 'Claude Code'})
};
fetch('https://api.casparser.in/v1/agent-auth/token/{token}/approve', 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.casparser.in/v1/agent-auth/token/{token}/approve",
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([
'id_token' => '<string>',
'client_name' => 'Claude Code'
]),
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://api.casparser.in/v1/agent-auth/token/{token}/approve"
payload := strings.NewReader("{\n \"id_token\": \"<string>\",\n \"client_name\": \"Claude Code\"\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://api.casparser.in/v1/agent-auth/token/{token}/approve")
.header("Content-Type", "application/json")
.body("{\n \"id_token\": \"<string>\",\n \"client_name\": \"Claude Code\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.casparser.in/v1/agent-auth/token/{token}/approve")
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 \"id_token\": \"<string>\",\n \"client_name\": \"Claude Code\"\n}"
response = http.request(request)
puts response.read_body{
"status": "approved",
"email": "user@example.com"
}{
"detail": "Token must be 16-128 characters"
}{
"detail": "Invalid identity token"
}{
"detail": "Unsupported sign-in method"
}{
"detail": "Token already approved or storage unavailable"
}Path Parameters
The token the agent generated and included in the approval URL. Must be 16-128 characters.
Required string length:
16 - 128Example:
"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6a7b8c9d0e1f2a3b4c5d6a7b8c9d0e1f2"
Body
application/json
Was this page helpful?
⌘I

