curl --request POST \
--url https://api.example.com/api/agent/consent/poll \
--header 'Content-Type: application/json' \
--header 'X-Site-ID: <x-site-id>' \
--data '
{
"device_code": "<string>"
}
'import requests
url = "https://api.example.com/api/agent/consent/poll"
payload = { "device_code": "<string>" }
headers = {
"X-Site-ID": "<x-site-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Site-ID': '<x-site-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({device_code: '<string>'})
};
fetch('https://api.example.com/api/agent/consent/poll', 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.example.com/api/agent/consent/poll",
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([
'device_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Site-ID: <x-site-id>"
],
]);
$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.example.com/api/agent/consent/poll"
payload := strings.NewReader("{\n \"device_code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Site-ID", "<x-site-id>")
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.example.com/api/agent/consent/poll")
.header("X-Site-ID", "<x-site-id>")
.header("Content-Type", "application/json")
.body("{\n \"device_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/agent/consent/poll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Site-ID"] = '<x-site-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"device_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"expires_in": 123,
"scope": "<string>",
"agent_name": "<string>",
"budget_cents": 123,
"token_type": "Bearer"
}{
"error": "<string>",
"error_description": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Post Consent Poll
Poll for the customer’s decision per RFC 8628 §3.5.
HTTP 200 + RFC 6749 §5.1 success body when the agent token is minted; HTTP 400 + RFC 6749 §5.2 error body for every other state:
authorization_pending customer hasn’t decided yet access_denied customer denied expired_token consent code expired before claim invalid_grant unknown / malformed device_code already_claimed agent already polled successfully (Stella ext)
Stock OAuth client libraries that read access_token on 200 and
error on 4xx work out of the box. The success body adds Stella
extensions agent_name and budget_cents so the agent doesn’t
need a second call to learn the consent shape (RFC 6749 §5.1
explicitly allows extension parameters).
curl --request POST \
--url https://api.example.com/api/agent/consent/poll \
--header 'Content-Type: application/json' \
--header 'X-Site-ID: <x-site-id>' \
--data '
{
"device_code": "<string>"
}
'import requests
url = "https://api.example.com/api/agent/consent/poll"
payload = { "device_code": "<string>" }
headers = {
"X-Site-ID": "<x-site-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Site-ID': '<x-site-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({device_code: '<string>'})
};
fetch('https://api.example.com/api/agent/consent/poll', 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.example.com/api/agent/consent/poll",
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([
'device_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Site-ID: <x-site-id>"
],
]);
$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.example.com/api/agent/consent/poll"
payload := strings.NewReader("{\n \"device_code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Site-ID", "<x-site-id>")
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.example.com/api/agent/consent/poll")
.header("X-Site-ID", "<x-site-id>")
.header("Content-Type", "application/json")
.body("{\n \"device_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/agent/consent/poll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Site-ID"] = '<x-site-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"device_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>",
"expires_in": 123,
"scope": "<string>",
"agent_name": "<string>",
"budget_cents": 123,
"token_type": "Bearer"
}{
"error": "<string>",
"error_description": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Body
Agent → Stella: poll for consent decision.
8 - 200Response
Successful Response
Stella → agent: HTTP 200 success body per RFC 6749 §5.1.
scope is space-separated (NOT a JSON array) per spec. expires_in
is relative seconds (NOT a timestamp). Stella-specific extension
fields agent_name and budget_cents carry the consent shape so
the agent doesn't need a second call.