Verify a Gate agent token
curl --request POST \
--url https://api.usefoil.com/v1/gate/agent-tokens/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_token": "agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF"
}
'import requests
url = "https://api.usefoil.com/v1/gate/agent-tokens/verify"
payload = { "agent_token": "agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_token: 'agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF'})
};
fetch('https://api.usefoil.com/v1/gate/agent-tokens/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usefoil.com/v1/gate/agent-tokens/verify"
payload := strings.NewReader("{\n \"agent_token\": \"agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}require 'uri'
require 'net/http'
url = URI("https://api.usefoil.com/v1/gate/agent-tokens/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_token\": \"agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usefoil.com/v1/gate/agent-tokens/verify",
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([
'agent_token' => 'agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"valid": true,
"gate_account_id": "gacct_0123456789abcdefghjkmnpqrs",
"status": "active",
"created_at": "2026-03-24T20:00:00.000Z",
"expires_at": "2026-03-24T20:00:05.000Z"
},
"meta": {
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1"
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}Agent tokens
Verify a Gate agent token
Requires Authorization: Bearer sk_* with the gate:agent_tokens:verify scope.
POST
/
v1
/
gate
/
agent-tokens
/
verify
Verify a Gate agent token
curl --request POST \
--url https://api.usefoil.com/v1/gate/agent-tokens/verify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_token": "agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF"
}
'import requests
url = "https://api.usefoil.com/v1/gate/agent-tokens/verify"
payload = { "agent_token": "agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_token: 'agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF'})
};
fetch('https://api.usefoil.com/v1/gate/agent-tokens/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usefoil.com/v1/gate/agent-tokens/verify"
payload := strings.NewReader("{\n \"agent_token\": \"agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}require 'uri'
require 'net/http'
url = URI("https://api.usefoil.com/v1/gate/agent-tokens/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_token\": \"agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usefoil.com/v1/gate/agent-tokens/verify",
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([
'agent_token' => 'agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"valid": true,
"gate_account_id": "gacct_0123456789abcdefghjkmnpqrs",
"status": "active",
"created_at": "2026-03-24T20:00:00.000Z",
"expires_at": "2026-03-24T20:00:05.000Z"
},
"meta": {
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1"
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}{
"error": {
"code": "request.validation_failed",
"message": "Observation payload failed validation.",
"status": 1,
"retryable": true,
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1",
"docs_url": "https://app.acme.co/signup",
"details": {
"fields": [
{
"name": "Acme Growth Workspace",
"issue": "required",
"expected": "string",
"received": "any_of"
}
],
"allowed_values": [
"verified"
],
"header_name": "x-forwarded-for",
"parameter_set": "browser_fingerprint",
"next_action": "retry"
}
}
}Authorizations
Send Authorization: Bearer . Gate business endpoints require sk_* secret keys. Gate workflow endpoints use gate-native bearer tokens such as gtpoll_* or agt_* where documented.
Body
application/json
Example:
"agt_0123456789abcdefghjkmnpqrstuvwxyzABCDEF"
Response
Agent token verification response.
Show child attributes
Show child attributes
Example:
{
"valid": true,
"gate_account_id": "gacct_0123456789abcdefghjkmnpqrs",
"status": "active",
"created_at": "2026-03-24T20:00:00.000Z",
"expires_at": "2026-03-24T20:00:05.000Z"
}
Show child attributes
Show child attributes
Example:
{
"request_id": "req_cf147349a4134208aebb8c70e25fb7e1"
}
⌘I