{"openapi":"3.1.0","info":{"title":"Agentic Bank API","version":"1.0.0","description":"Bank accounts for AI agents. Sandbox: no real money moves. Agentic Bank is a technology platform, not a bank. The sandbox holds no real money; deposits are not insured."},"servers":[{"url":"https://www.agenticbank.site"}],"components":{"securitySchemes":{"agentKey":{"type":"http","scheme":"bearer","description":"Agent API key (ab_test_…)"},"ownerSession":{"type":"apiKey","in":"cookie","name":"ab_session","description":"Owner wallet session (dashboard)"}}},"paths":{"/api/v1/agents/register":{"post":{"operationId":"agents.register","summary":"An agent signs itself up: returns an API key and a claim link for its owner. Until claimed it can only hold $1,000 of sandbox money and pay other Agentic Bank accounts.","tags":["Agents"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Agent name","minLength":1,"maxLength":80},"erc8004":{"type":"string","description":"ERC-8004 identity, chain:id (optional)","pattern":"^[a-z0-9-]{2,30}:[0-9]{1,20}$"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/rails":{"get":{"operationId":"meta.rails","summary":"Currencies, the rails each one pays by, and sandbox settlement times.","tags":["Reference"],"security":[],"parameters":[],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/rates":{"get":{"operationId":"meta.rates","summary":"Sandbox exchange rates (value of 1 unit in USD).","tags":["Reference"],"security":[],"parameters":[],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/waitlist":{"post":{"operationId":"waitlist.join","summary":"Join the live-mode waitlist (real accounts, cards and payouts).","tags":["Live mode"],"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email","pattern":"^[^@\\s]{1,64}@[^@\\s]{1,255}$","maxLength":254},"name":{"type":"string","description":"Name","maxLength":100},"company":{"type":"string","description":"Company","maxLength":120},"use_case":{"type":"string","description":"What your agents will do with money","maxLength":1000},"rails":{"type":"array","items":{"type":"string","description":"rail or currency"},"description":"What you need","maxItems":12},"wallet":{"type":"string","description":"Wallet","pattern":"^0x[0-9a-fA-F]{40}$"}},"required":["email"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/claims/{token}":{"get":{"operationId":"claims.preview","summary":"Which agent a claim link is for.","tags":["Agents"],"security":[],"parameters":[{"name":"token","in":"path","required":true,"description":"Claim token","schema":{"type":"string","pattern":"^clm_[A-Za-z0-9_-]{20,64}$"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}},"post":{"operationId":"claims.accept","summary":"Claim a self-registered agent: it becomes yours, with the default policy.","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"token","in":"path","required":true,"description":"Claim token","schema":{"type":"string","pattern":"^clm_[A-Za-z0-9_-]{20,64}$"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/me":{"get":{"operationId":"me","summary":"Who this key belongs to: the agent, whether it is claimed, and its spending policy.","tags":["Accounts"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/accounts":{"get":{"operationId":"accounts.list","summary":"The agent’s accounts with balances and details.","tags":["Accounts"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}},"post":{"operationId":"accounts.open","summary":"Open an account: usd (ACH/wire numbers), eur (IBAN), gbp (sort code), inr (UPI), usdc (Base/Arbitrum/Ethereum) or usdg (Robinhood Chain).","tags":["Accounts"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","description":"Currency","enum":["usd","eur","gbp","inr","usdc","usdg"]},"chain":{"type":"string","description":"Stablecoins only: base, arbitrum, ethereum (usdc) or robinhood (usdg)","enum":["base","arbitrum","ethereum","robinhood"]},"nickname":{"type":"string","description":"Label","maxLength":60}},"required":["currency"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/accounts/{id}":{"get":{"operationId":"accounts.get","summary":"One account: balance and the details to receive money (account numbers, IBAN, UPI ID…).","tags":["Accounts"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Account id","schema":{"type":"string","pattern":"^acc_[a-z0-9]{8,32}$"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/accounts/{id}/close":{"post":{"operationId":"accounts.close","summary":"Close an empty account (its cards close too).","tags":["Accounts"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Account id","schema":{"type":"string","pattern":"^acc_[a-z0-9]{8,32}$"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/balances":{"get":{"operationId":"balances","summary":"Every balance plus the total in USD.","tags":["Accounts"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/transactions":{"get":{"operationId":"transactions.list","summary":"Ledger entries (money in and out), newest first.","tags":["Accounts"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"account_id","in":"query","required":false,"description":"Only this account","schema":{"type":"string","pattern":"^acc_[a-z0-9]{8,32}$"}},{"name":"limit","in":"query","required":false,"description":"Max items (≤ 200)","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"Cursor: next_before from the previous page","schema":{"type":"string"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/accounts/{id}/statement":{"get":{"operationId":"statements.get","summary":"Monthly statement: opening and closing balance and every entry. format=csv for a spreadsheet.","tags":["Accounts"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Account id","schema":{"type":"string","pattern":"^acc_[a-z0-9]{8,32}$"}},{"name":"month","in":"query","required":false,"description":"YYYY-MM (default this month)","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"format","in":"query","required":false,"description":"json or csv","schema":{"type":"string","enum":["json","csv"]}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/payments":{"post":{"operationId":"payments.create","summary":"Send money from an account by a rail. Checked against the spending policy; above the approval threshold it waits for the owner (status pending_approval, funds held).","tags":["Payments"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from_account":{"type":"string","description":"Pay from this account","pattern":"^acc_[a-z0-9]{8,32}$"},"rail":{"type":"string","description":"Rail","enum":["internal","ach","wire","sepa","fps","upi","onchain","x402"]},"to":{"type":"object","description":"Recipient. internal: {account_id} · ach/wire: {routing_number, account_number, name} · sepa: {iban, name} · fps: {sort_code, account_number, name} · upi: {vpa} · onchain: {address} · x402: {url, pay_to}","additionalProperties":true},"amount":{"type":"string","description":"Amount as a decimal string, e.g. \"25.00\"","pattern":"^[0-9]{1,15}(\\.[0-9]{1,6})?$","example":"25.00"},"memo":{"type":"string","description":"Note for the recipient / your books","maxLength":140},"idempotency_key":{"type":"string","description":"Same key = same payment, never twice (also accepted as the Idempotency-Key header)","maxLength":100}},"required":["from_account","rail","to","amount"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}},"get":{"operationId":"payments.list","summary":"Payments, newest first.","tags":["Payments"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"Filter","schema":{"type":"string","enum":["pending_approval","processing","completed","failed","cancelled","rejected"]}},{"name":"account_id","in":"query","required":false,"description":"Only this account","schema":{"type":"string","pattern":"^acc_[a-z0-9]{8,32}$"}},{"name":"limit","in":"query","required":false,"description":"Max items (≤ 200)","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"Cursor: next_before from the previous page","schema":{"type":"string"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/payments/{id}":{"get":{"operationId":"payments.get","summary":"One payment and its status.","tags":["Payments"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Payment id","schema":{"type":"string","pattern":"^pay_[a-z0-9]{8,32}$"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/payments/{id}/cancel":{"post":{"operationId":"payments.cancel","summary":"Cancel a payment that is still waiting for approval; the money returns.","tags":["Payments"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Payment id","schema":{"type":"string","pattern":"^pay_[a-z0-9]{8,32}$"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/conversions/quote":{"post":{"operationId":"conversions.quote","summary":"What a conversion between two of the agent’s accounts would give.","tags":["Payments"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from_account":{"type":"string","description":"From","pattern":"^acc_[a-z0-9]{8,32}$"},"to_account":{"type":"string","description":"To","pattern":"^acc_[a-z0-9]{8,32}$"},"amount":{"type":"string","description":"Amount to convert, in the from currency","pattern":"^[0-9]{1,15}(\\.[0-9]{1,6})?$","example":"25.00"}},"required":["from_account","to_account","amount"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/conversions":{"post":{"operationId":"conversions.create","summary":"Convert between two of the agent’s accounts (e.g. USD → INR, EUR → USDC) at the sandbox rate.","tags":["Payments"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from_account":{"type":"string","description":"From","pattern":"^acc_[a-z0-9]{8,32}$"},"to_account":{"type":"string","description":"To","pattern":"^acc_[a-z0-9]{8,32}$"},"amount":{"type":"string","description":"Amount to convert, in the from currency","pattern":"^[0-9]{1,15}(\\.[0-9]{1,6})?$","example":"25.00"}},"required":["from_account","to_account","amount"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/cards":{"post":{"operationId":"cards.issue","summary":"Issue a virtual Visa card on a USD account, with its own limits, categories and merchant list. The number is returned once here (and with reveal=true).","tags":["Cards"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"A USD account","pattern":"^acc_[a-z0-9]{8,32}$"},"nickname":{"type":"string","description":"Label, e.g. \"OpenAI API\"","maxLength":60},"limits":{"type":"object","properties":{"per_tx_usd":{"type":"string","description":"Max per charge, USD"},"daily_usd":{"type":"string","description":"Max per day, USD"},"monthly_usd":{"type":"string","description":"Max per month, USD"},"allowed_categories":{"type":"array","items":{"type":"string","description":"category","enum":["software","cloud","ai","advertising","data","travel","food","retail","services","gambling","crypto","other"]},"description":"Only these merchant categories (empty = any)"},"blocked_categories":{"type":"array","items":{"type":"string","description":"category","enum":["software","cloud","ai","advertising","data","travel","food","retail","services","gambling","crypto","other"]},"description":"Never these categories"},"merchants":{"type":"array","items":{"type":"string","description":"merchant name"},"description":"Only these merchants (empty = any)","maxItems":100}},"required":[],"description":"Card limits","additionalProperties":false}},"required":["account_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}},"get":{"operationId":"cards.list","summary":"The agent’s cards (numbers masked).","tags":["Cards"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/cards/{id}":{"get":{"operationId":"cards.get","summary":"One card; reveal=true includes the full number and CVC (sandbox numbers only work in the sandbox).","tags":["Cards"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Card id","schema":{"type":"string","pattern":"^card_[a-z0-9]{8,32}$"}},{"name":"reveal","in":"query","required":false,"description":"Include number and CVC","schema":{"type":"boolean"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}},"patch":{"operationId":"cards.update","summary":"Freeze, unfreeze or close a card, or change its limits (an agent stays within its policy; the owner can do anything).","tags":["Cards"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Card id","schema":{"type":"string","pattern":"^card_[a-z0-9]{8,32}$"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","description":"New status","enum":["active","frozen","closed"]},"nickname":{"type":"string","description":"Label","maxLength":60},"limits":{"type":"object","properties":{"per_tx_usd":{"type":"string","description":"Max per charge, USD"},"daily_usd":{"type":"string","description":"Max per day, USD"},"monthly_usd":{"type":"string","description":"Max per month, USD"},"allowed_categories":{"type":"array","items":{"type":"string","description":"category","enum":["software","cloud","ai","advertising","data","travel","food","retail","services","gambling","crypto","other"]},"description":"Only these merchant categories (empty = any)"},"blocked_categories":{"type":"array","items":{"type":"string","description":"category","enum":["software","cloud","ai","advertising","data","travel","food","retail","services","gambling","crypto","other"]},"description":"Never these categories"},"merchants":{"type":"array","items":{"type":"string","description":"merchant name"},"description":"Only these merchants (empty = any)","maxItems":100}},"required":[],"description":"Card limits","additionalProperties":false}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/cards/{id}/authorizations":{"get":{"operationId":"cards.authorizations","summary":"Charges on a card, approved and declined (with the reason).","tags":["Cards"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Card id","schema":{"type":"string","pattern":"^card_[a-z0-9]{8,32}$"}},{"name":"limit","in":"query","required":false,"description":"Max items (≤ 200)","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/policy":{"get":{"operationId":"policy.get","summary":"The spending policy the owner set for this agent (agents can read it, never change it), and what is used today and this month.","tags":["Policy"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/events":{"get":{"operationId":"events.list","summary":"Recent events (the same ones sent to webhooks), newest first.","tags":["Webhooks"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"type","in":"query","required":false,"description":"Type prefix, e.g. payment. or card.","schema":{"type":"string","maxLength":40}},{"name":"limit","in":"query","required":false,"description":"Max items (≤ 200)","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"Cursor: next_before from the previous page","schema":{"type":"string"}},{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/sandbox/deposits":{"post":{"operationId":"sandbox.deposit","summary":"Simulate money arriving in an account (an incoming ACH, SEPA, Faster Payment, UPI or on-chain transfer).","tags":["Sandbox"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Account to fund","pattern":"^acc_[a-z0-9]{8,32}$"},"amount":{"type":"string","description":"Amount as a decimal string, e.g. \"25.00\"","pattern":"^[0-9]{1,15}(\\.[0-9]{1,6})?$","example":"25.00"},"from":{"type":"string","description":"Sender name","maxLength":80},"reference":{"type":"string","description":"Reference","maxLength":60}},"required":["account_id","amount"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/sandbox/card-charges":{"post":{"operationId":"sandbox.card_charge","summary":"Simulate a merchant charging a card. Approved or declined by the card’s status, limits, categories, merchant list, the agent’s policy and the balance.","tags":["Sandbox"],"security":[{"agentKey":[]},{"ownerSession":[]}],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Owner session only: which of your agents","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"card_id":{"type":"string","description":"Card id","pattern":"^card_[a-z0-9]{8,32}$"},"amount":{"type":"string","description":"Amount in USD","pattern":"^[0-9]{1,15}(\\.[0-9]{1,6})?$","example":"25.00"},"merchant":{"type":"object","properties":{"name":{"type":"string","description":"Merchant name","maxLength":80},"category":{"type":"string","description":"Category","enum":["software","cloud","ai","advertising","data","travel","food","retail","services","gambling","crypto","other"]},"country":{"type":"string","description":"Country (ISO 2)","maxLength":2}},"required":["name"],"additionalProperties":false}},"required":["card_id","amount","merchant"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/owner":{"get":{"operationId":"owner.overview","summary":"The signed-in owner: agents with balances, pending approvals, webhook.","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/agents":{"post":{"operationId":"agents.create","summary":"Create an agent; returns its first API key (shown once).","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Agent name","minLength":1,"maxLength":80},"erc8004":{"type":"string","description":"ERC-8004 identity, chain:id","pattern":"^[a-z0-9-]{2,30}:[0-9]{1,20}$"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}},"get":{"operationId":"agents.list","summary":"Your agents with balances.","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/agents/{id}":{"patch":{"operationId":"agents.update","summary":"Rename, link an ERC-8004 identity, or pause / resume an agent (paused = no money moves, cards decline).","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent id","schema":{"type":"string","pattern":"^agt_[a-z0-9]{8,32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name","maxLength":80},"erc8004":{"type":"string","description":"chain:id","pattern":"^[a-z0-9-]{2,30}:[0-9]{1,20}$"},"status":{"type":"string","description":"Status","enum":["active","paused"]}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/agents/{id}/policy":{"put":{"operationId":"agents.policy","summary":"Set the agent’s spending policy: limits, approval threshold, allowed rails, counterparty allowlist.","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent id","schema":{"type":"string","pattern":"^agt_[a-z0-9]{8,32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"per_tx_usd":{"type":"string","description":"Max per payment, USD equivalent"},"daily_usd":{"type":"string","description":"Max per day across payments and cards, USD"},"monthly_usd":{"type":"string","description":"Max per month, USD"},"approval_over_usd":{"type":"string","description":"Payments at or above this wait for your approval (\"\" = never)"},"rails":{"type":"array","items":{"type":"string","description":"rail","enum":["internal","ach","wire","sepa","fps","upi","onchain","x402"]},"description":"Rails the agent may use"},"allowlist":{"type":"array","items":{"type":"string","description":"account id, IBAN, routing:account, sort-code:account, UPI ID, 0x address or x402 host"},"description":"Only these counterparties (empty = any)","maxItems":200}},"required":[],"description":"Spending policy","additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/agents/{id}/keys":{"get":{"operationId":"keys.list","summary":"The agent’s active API keys (prefixes only).","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent id","schema":{"type":"string","pattern":"^agt_[a-z0-9]{8,32}$"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}},"post":{"operationId":"keys.create","summary":"A new API key for the agent (shown once).","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent id","schema":{"type":"string","pattern":"^agt_[a-z0-9]{8,32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Label","maxLength":60}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/agents/{id}/keys/{key_id}":{"delete":{"operationId":"keys.revoke","summary":"Revoke an API key at once.","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent id","schema":{"type":"string","pattern":"^agt_[a-z0-9]{8,32}$"}},{"name":"key_id","in":"path","required":true,"description":"Key id","schema":{"type":"string","pattern":"^key_[a-z0-9]{8,32}$"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/approvals":{"get":{"operationId":"approvals.list","summary":"Payments waiting for your approval (status=all for history).","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"pending (default), approved, rejected, cancelled or all","schema":{"type":"string","enum":["pending","approved","rejected","cancelled","all"]}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/approvals/{id}":{"post":{"operationId":"approvals.decide","summary":"Approve (the payment goes out) or reject (the money returns to the agent).","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Approval id","schema":{"type":"string","pattern":"^apr_[a-z0-9]{8,32}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","description":"approve or reject","enum":["approve","reject"]},"reason":{"type":"string","description":"Reason (shown to the agent)","maxLength":200}},"required":["decision"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/owner/events":{"get":{"operationId":"owner.events","summary":"Every event across your agents, with webhook delivery status.","tags":["Owner"],"security":[{"ownerSession":[]}],"parameters":[{"name":"type","in":"query","required":false,"description":"Type prefix","schema":{"type":"string","maxLength":40}},{"name":"limit","in":"query","required":false,"description":"Max items (≤ 200)","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"before","in":"query","required":false,"description":"Cursor: next_before from the previous page","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/webhook":{"get":{"operationId":"webhook.get","summary":"Your webhook URL and signing secret.","tags":["Webhooks"],"security":[{"ownerSession":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}},"put":{"operationId":"webhook.set","summary":"Set (or clear with \"\") the https URL that receives every event of your agents.","tags":["Webhooks"],"security":[{"ownerSession":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"https URL (\"\" to turn off)","maxLength":2048}},"required":[],"additionalProperties":false}}}},"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/webhook/rotate":{"post":{"operationId":"webhook.rotate","summary":"A new signing secret (the old one stops at once).","tags":["Webhooks"],"security":[{"ownerSession":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}},"/api/v1/webhook/test":{"post":{"operationId":"webhook.test","summary":"Send a webhook.test event now.","tags":["Webhooks"],"security":[{"ownerSession":[]}],"parameters":[],"responses":{"200":{"description":"OK"},"4XX":{"description":"Error: {\"error\": {\"code\", \"message\"}}"}}}}}}