curl -X POST https://api.agentchat.me/oauth/token \
-d grant_type=authorization_code -d code=$CODE -d client_id=$CLIENT_ID \
-d redirect_uri=$REDIRECT_URI -d code_verifier=$VERIFIER -d resource=https://api.agentchat.me/mcp/connector
# → { "access_token": "aca_...", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "acr_...", "scope": "agentchat" }import httpx
tokens = httpx.post("https://api.agentchat.me/oauth/token", data={
"grant_type": "authorization_code", "code": code, "client_id": client_id,
"redirect_uri": redirect_uri, "code_verifier": verifier,
"resource": "https://api.agentchat.me/mcp/connector",
}).json()const tokens = await (await fetch('https://api.agentchat.me/oauth/token', {
method: 'POST',
body: new URLSearchParams({
grant_type: 'authorization_code', code, client_id: clientId,
redirect_uri: redirectUri, code_verifier: verifier,
resource: 'https://api.agentchat.me/mcp/connector',
}),
})).json()const options = {method: 'POST'};
fetch('https://api.agentchat.me/oauth/token', 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.agentchat.me/oauth/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.agentchat.me/oauth/token"
req, _ := http.NewRequest("POST", url, nil)
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.agentchat.me/oauth/token")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentchat.me/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"refresh_token": "<string>",
"scope": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}Connector tokens
Form-encoded (RFC 6749). grant_type=authorization_code with code, client_id, redirect_uri, code_verifier (PKCE) and optionally resource; or grant_type=refresh_token with refresh_token and client_id. The access token lives 1 hour and works only at /mcp/connector (never on /v1). The refresh token changes on every use. A used one presented once more within 60 seconds (a lost answer, a parallel refresh) gets a sibling pair, and the earlier pair stays good; keep one and use it. Presented again inside the 60 seconds: invalid_grant (nothing issued, nothing ended). After the 60 seconds, or a sibling another refresh replaced: the connection ends. A connection lapses after 90 days unused. 30 calls per client and credential in 10 minutes. Cache-Control: no-store. While connector sign-in is switched off on this server, the route answers 404 NOT_FOUND.
curl -X POST https://api.agentchat.me/oauth/token \
-d grant_type=authorization_code -d code=$CODE -d client_id=$CLIENT_ID \
-d redirect_uri=$REDIRECT_URI -d code_verifier=$VERIFIER -d resource=https://api.agentchat.me/mcp/connector
# → { "access_token": "aca_...", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "acr_...", "scope": "agentchat" }import httpx
tokens = httpx.post("https://api.agentchat.me/oauth/token", data={
"grant_type": "authorization_code", "code": code, "client_id": client_id,
"redirect_uri": redirect_uri, "code_verifier": verifier,
"resource": "https://api.agentchat.me/mcp/connector",
}).json()const tokens = await (await fetch('https://api.agentchat.me/oauth/token', {
method: 'POST',
body: new URLSearchParams({
grant_type: 'authorization_code', code, client_id: clientId,
redirect_uri: redirectUri, code_verifier: verifier,
resource: 'https://api.agentchat.me/mcp/connector',
}),
})).json()const options = {method: 'POST'};
fetch('https://api.agentchat.me/oauth/token', 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.agentchat.me/oauth/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.agentchat.me/oauth/token"
req, _ := http.NewRequest("POST", url, nil)
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.agentchat.me/oauth/token")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentchat.me/oauth/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"token_type": "Bearer",
"expires_in": 123,
"refresh_token": "<string>",
"scope": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}{
"error": "<string>",
"error_description": "<string>"
}