Aller au contenu
agentsub
Esc
↑↓naviguer↵ouvrir⌘Japerçu

Check application access for the authenticated agent

Read-only check of a verified merchant offer against current agent clearance. Zero-price offers allow access without credits or a ledger write. Paid offers return allowed=false and paymentRequired=true; obtain and redeem a merchant-bound voucher separately. Merchant servers must match the returned AgentID issuer/subject, merchant and offer to their own authenticated session. A copied browser decision cannot authenticate a caller. Owner and merchant keys cannot substitute for the agent identity.

POST/v1/access/check
Authorization
AuthorizationBearer token (JWT) · headerrequired

Verified AgentID agent JWT (iss https://auth.agentid.com) or an agentsub OAuth access token (typ at+jwt, iss https://api.agentsub.dev, scope agentsub:agent). The agent's human owner must exist in Clerk with the same verified email.

Request body
requiredapplication/json
offerIdstringrequired
min length 1 · max length 200
Responses
200

Current access decision; no funds reserved or consumed

agentIdstringrequired
agentIdentityobjectrequired
Show properties
issuerstringrequired
subjectstringrequired
merchantIdstringrequired
offerIdstringrequired
allowedbooleanrequired
paymentRequiredbooleanrequired
priceUcMicrocreditsrequired

Integer microcredits as a decimal string. 1 credit = 1,000,000 microcredits = $0.01 USD.

matches ^[0-9]+$
accountobject
Show properties
availableUcMicrocredits

Integer microcredits as a decimal string. 1 credit = 1,000,000 microcredits = $0.01 USD.

matches ^[0-9]+$
voucherEndpointstring
400

Invalid offer request

401

unauthorized problem; live 401s advertise WWW-Authenticate: Bearer resource_metadata=...

typestringrequired
titlestringrequired
statusintegerrequired
codestringrequired
403

Identity, ownership, scope or policy denied (human_required, owner_claim_required, scope_required, FROZEN, CAP_EXCEEDED, SCOPE_FORBIDDEN)

typestringrequired
titlestringrequired
statusintegerrequired
codestringrequired
404

Active published offer not found

Request
curl -X POST 'https://api.agentsub.dev/v1/access/check' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "offerId": "string"
}'
Response
{
  "agentId": "string",
  "agentIdentity": {
    "issuer": "string",
    "subject": "string"
  },
  "merchantId": "string",
  "offerId": "string",
  "allowed": true,
  "paymentRequired": true,
  "priceUc": "string",
  "account": {
    "availableUc": "string"
  },
  "voucherEndpoint": "string"
}