{"openapi":"3.1.0","info":{"title":"Catena API","description":"Operator API for the Catena console and API consumers. Error responses share one envelope: `{ error, code?, fields?, requestId? }`, where `error` is a human-readable message and `code` is a stable machine-readable identifier. Per-operation documentation covers success shapes. The agent-facing surface under /v1/agent-api has its own contract at /v1/agent-api/openapi.json.","version":"121095ee6973d7228504f6078bdf4d3d58bb6ac3"},"servers":[{"url":"/v1"}],"components":{"securitySchemes":{"operatorBearer":{"type":"http","scheme":"bearer","description":"Operator session token with operator role"},"sessionCookie":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"Console sign-in session cookie (prefixed __Secure- in production), obtained through the /v1/auth sign-in flows"}}},"security":[{"operatorBearer":[]}],"paths":{"/accounts":{"get":{"operationId":"getAccounts","summary":"List accounts","description":"Deposit instructions are included only for KYB-verified organizations with the fiat-rails capability.","tags":["Accounts"],"responses":{"200":{"description":"Accounts with cards, agent access, and policy access","content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"type":{"enum":["bankAccount","wallet"],"type":"string"},"status":{"enum":["pending","active","suspended","closed","archived","locked"],"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"heldBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"availableBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"currency":{"type":"string"},"policyAccess":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"createdAt":{"type":"string","format":"date-time"},"bankPartner":{"type":"string"},"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"},"depositPolicy":{"enum":["hold_usd","auto_convert_usdc_base","native_usdc"],"type":"string"},"providerAccountId":{"type":"string"},"providerName":{"type":"string"},"fiatRails":{"type":"object","properties":{"enabled":{"type":"boolean"},"provider":{"type":"string"}},"required":["enabled"]},"pendingIncoming":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"cards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"cardLast4":{"type":"string"},"cardLimit":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},{"type":"null"}]},"assignedAgentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"status":{"enum":["active","suspended","expired"],"type":"string"},"createdAt":{"type":"string","format":"date-time"},"assignedAgentName":{"type":"string"}},"required":["id","accountId","cardLast4","cardLimit","assignedAgentId","expiresAt","status","createdAt"]}},"agentAccess":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"sendAgentCount":{"type":"number"}},"required":["id","name","type","status","balance","currency","policyAccess","createdAt","providerAccountId","cards","agentAccess","sendAgentCount"]}}},"required":["accounts"]}}}}}}},"/accounts/activity":{"get":{"operationId":"getAccountsActivity","summary":"List activity across accounts","tags":["Accounts"],"responses":{"200":{"description":"Recent activity rows across all visible accounts","content":{"application/json":{"schema":{"type":"object","properties":{"activity":{"type":"array","items":{"type":"object","properties":{},"required":[]}}},"required":["activity"]}}}}}}},"/accounts/{id}/activity":{"get":{"operationId":"getAccountsByIdActivity","summary":"List activity for an account","tags":["Accounts"],"responses":{"200":{"description":"Recent activity rows for the account","content":{"application/json":{"schema":{"type":"object","properties":{"activity":{"type":"array","items":{"type":"object","properties":{},"required":[]}}},"required":["activity"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/accounts/balance-history":{"get":{"operationId":"getAccountsBalanceHistory","summary":"Get daily balance history for all accounts","description":"Returns one balance point per account per calendar day, including days without movement.","tags":["Accounts"],"responses":{"200":{"description":"Daily balance rows per account","content":{"application/json":{"schema":{"type":"object","properties":{"history":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"date":{"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]}},"required":["accountId","date","balance"]}}},"required":["history"]}}}}}}},"/accounts/{id}/balance-history":{"get":{"operationId":"getAccountsByIdBalanceHistory","summary":"Get daily balance history for an account","tags":["Accounts"],"responses":{"200":{"description":"Daily balance rows for the account","content":{"application/json":{"schema":{"type":"object","properties":{"history":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"date":{"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]}},"required":["accountId","date","balance"]}}},"required":["history"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/accounts/{id}/live-balance":{"get":{"operationId":"getAccountsByIdLiveBalance","summary":"Get a live account balance","description":"Turnkey wallet accounts only. `status` is `live`, `stale`, or `unavailable`; when `unavailable`, `balance` and `asOf` are null and no balance should be assumed.","tags":["Accounts"],"responses":{"200":{"description":"Live, cached, or unavailable balance","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"const":"live"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"asOf":{"type":"string","format":"date-time"}},"required":["status","balance","asOf"]},{"type":"object","properties":{"status":{"const":"stale"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"asOf":{"type":"string","format":"date-time"}},"required":["status","balance","asOf"]},{"type":"object","properties":{"status":{"const":"unavailable"},"balance":{"type":"null"},"asOf":{"type":"null"}},"required":["status","balance","asOf"]}]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/accounts/{id}":{"delete":{"operationId":"deleteAccountsById","summary":"Delete an account","tags":["Accounts"],"responses":{"200":{"description":"Account deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]},"patch":{"operationId":"patchAccountsById","summary":"Rename an account","tags":["Accounts"],"responses":{"200":{"description":"The updated account","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"type":{"enum":["bankAccount","wallet"],"type":"string"},"status":{"enum":["pending","active","suspended","closed","archived","locked"],"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"heldBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"availableBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"currency":{"type":"string"},"policyAccess":{"type":"array","items":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"}},"createdAt":{"type":"string","format":"date-time"},"bankPartner":{"type":"string"},"accountNumber":{"type":"string"},"routingNumber":{"type":"string"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"},"depositPolicy":{"enum":["hold_usd","auto_convert_usdc_base","native_usdc"],"type":"string"},"providerAccountId":{"type":"string"},"providerName":{"type":"string"},"fiatRails":{"type":"object","properties":{"enabled":{"type":"boolean"},"provider":{"type":"string"}},"required":["enabled"]}},"required":["id","name","type","status","balance","currency","policyAccess","createdAt","providerAccountId"]}},"required":["account"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40}},"required":["name"],"additionalProperties":false}}}}}},"/accounts/{id}/archive":{"post":{"operationId":"postAccountsByIdArchive","summary":"Archive an account","description":"Fails when the account holds a balance or is referenced by an active policy. Deactivates the account's deposit rails.","tags":["Accounts"],"responses":{"200":{"description":"Account archived","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/accounts/{id}/unarchive":{"post":{"operationId":"postAccountsByIdUnarchive","summary":"Unarchive an account","tags":["Accounts"],"responses":{"200":{"description":"Account restored to active","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/accounts/{id}/fiat-rails":{"post":{"operationId":"postAccountsByIdFiatRails","summary":"Enable fiat deposit rails on a wallet account","tags":["Accounts"],"responses":{"200":{"description":"Fiat rails enabled","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]},"delete":{"operationId":"deleteAccountsByIdFiatRails","summary":"Disable fiat deposit rails on a wallet account","tags":["Accounts"],"responses":{"200":{"description":"Fiat rails disabled","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/accounts/{id}/cards":{"post":{"operationId":"postAccountsByIdCards","summary":"Issue a card for an account","tags":["Accounts"],"responses":{"201":{"description":"The issued card","content":{"application/json":{"schema":{"type":"object","properties":{"card":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"cardLast4":{"type":"string"},"cardLimit":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},{"type":"null"}]},"assignedAgentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"status":{"enum":["active","suspended","expired"],"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","accountId","cardLast4","cardLimit","assignedAgentId","expiresAt","status","createdAt"]}},"required":["card"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assignedAgentId":{"type":"string"},"cardLimit":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":[]}}}}}},"/accounts/{accountId}/cards/{cardId}":{"delete":{"operationId":"deleteAccountsByAccountIdCardsByCardId","summary":"Revoke a card","tags":["Accounts"],"responses":{"200":{"description":"Card revoked","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"in":"path","name":"accountId","schema":{"type":"string","pattern":"^acct_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true},{"in":"path","name":"cardId","schema":{"type":"string"},"required":true}]}},"/agents":{"get":{"operationId":"getAgents","summary":"List agents","tags":["Agents"],"responses":{"200":{"description":"Agents with policy, account access, and activity summaries","content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"policyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"accountAccess":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"linkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastActiveAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"activeLinkCount":{"type":"number"},"policyOverride":{"anyOf":[{"type":"object","properties":{"policyId":{"type":"string"},"policyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string","format":"date-time"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["policyId","policyName","expiresAt","summary"]},{"type":"null"}]}},"required":["id","policyName","status","accountAccess","linkedAt","lastActiveAt","activeLinkCount","policyOverride"]}}},"required":["agents"]}}}}}},"post":{"operationId":"postAgents","summary":"Create an agent","tags":["Agents"],"responses":{"201":{"description":"The created agent","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"policyId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","policyId"]}},"required":["agent"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"policyId":{"anyOf":[{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},{"const":""}]}},"required":["name"]}}}}}},"/agents/{id}":{"delete":{"operationId":"deleteAgentsById","summary":"Delete an agent","tags":["Agents"],"responses":{"200":{"description":"The deleted agent id","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"string"}},"required":["deleted"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]},"patch":{"operationId":"patchAgentsById","summary":"Rename an agent","tags":["Agents"],"responses":{"200":{"description":"The renamed agent","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"}},"required":["id","name"]}},"required":["agent"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]}}}}}},"/agents/{id}/policy":{"patch":{"operationId":"patchAgentsByIdPolicy","summary":"Assign or clear an agent's policy","description":"A null or empty policyId clears the assignment.","tags":["Agents"],"responses":{"200":{"description":"The agent with its updated policy assignment","content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"policyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"}},"required":["id","policyId","status"]},"policyName":{"type":"string"},"grant":{"type":"object","properties":{"id":{"type":"string"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","expiresAt"]}},"required":["agent"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"policyId":{"anyOf":[{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},{"const":""},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["policyId"]}}}}}},"/agents/{id}/policy-override":{"post":{"operationId":"postAgentsByIdPolicyOverride","summary":"Grant a temporary policy override","description":"Creates an immutable agent-scoped override derived from the agent's current base policy.","tags":["Agents"],"responses":{"200":{"description":"The temporary override policy and its expiring grant","content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"basePolicyId":{"type":"string"},"grant":{"type":"object","properties":{"id":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["id","expiresAt"]}},"required":["policy","basePolicyId","grant"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"basePolicyId":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"baseVersion":{"type":"integer","minimum":1},"expiresAt":{"type":"string","format":"date-time"},"config":{"type":"object","properties":{"read":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"}},"required":["accountId"],"additionalProperties":false}}},"required":["accounts"],"additionalProperties":false},"send":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"}},"required":["accountId"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ruleType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount","hourly_count","daily_count"],"type":"string"},"thresholdAmount":{"anyOf":[{"type":"string"},{"type":"number"}]},"thresholdCount":{"type":"integer","minimum":0},"action":{"enum":["block","require_approval"],"type":"string"},"requiredApprovals":{"type":"integer","minimum":1},"accountAggregationScope":{"enum":["per_account","across_accounts"],"type":"string"},"actorAggregationScope":{"enum":["per_agent","per_policy"],"type":"string"},"displayOrder":{"type":"integer","minimum":0}},"required":["ruleType","action"],"additionalProperties":false}}},"required":["accounts"],"additionalProperties":false},"transfer":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"}},"required":["accountId"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ruleType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount","hourly_count","daily_count"],"type":"string"},"thresholdAmount":{"anyOf":[{"type":"string"},{"type":"number"}]},"thresholdCount":{"type":"integer","minimum":0},"action":{"enum":["block","require_approval"],"type":"string"},"requiredApprovals":{"type":"integer","minimum":1},"accountAggregationScope":{"enum":["per_account","across_accounts"],"type":"string"},"actorAggregationScope":{"enum":["per_agent","per_policy"],"type":"string"},"displayOrder":{"type":"integer","minimum":0}},"required":["ruleType","action"],"additionalProperties":false}}},"required":["accounts"],"additionalProperties":false},"counterpartyRules":{"type":"object","properties":{"mode":{"enum":["open","restricted"],"type":"string"},"allowedCounterparties":{"type":"array","items":{"type":"string"}},"createAction":{"enum":["allow","block","require_approval"],"type":"string"},"requestPaymentDetailsAction":{"enum":["allow","block","require_approval"],"type":"string"},"allowCreate":{"type":"boolean"}},"required":["mode"]}},"required":["read","send","transfer"],"additionalProperties":false}},"required":["basePolicyId","baseVersion","expiresAt","config"],"additionalProperties":false}}}}},"delete":{"operationId":"deleteAgentsByIdPolicyOverride","summary":"Revoke a temporary policy override","tags":["Agents"],"responses":{"200":{"description":"The revoked override grant id","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"grant":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["success","grant"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/agents/{id}/activity":{"get":{"operationId":"getAgentsByIdActivity","summary":"List agent activity","tags":["Agents"],"responses":{"200":{"description":"A page of agent activity items","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"const":"intent"},"id":{"type":"string"},"action":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"counterpartyName":{"type":"string"},"state":{"type":"string"},"accountId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["type","id","action","state","accountId","createdAt"]},{"type":"object","properties":{"type":{"const":"agent_linked"},"id":{"type":"string"},"clientKind":{"enum":["mcp","cli","remote_mcp","service"],"type":"string"},"clientLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"operatorId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["type","id","operatorId","createdAt"]}]}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"},"totalPages":{"type":"number"}},"required":["items","total","page","pageSize","totalPages"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true},{"in":"query","name":"page","schema":{"type":"integer","pattern":"^\\d+$","minimum":1,"maximum":9007199254740991,"default":"1"}},{"in":"query","name":"pageSize","schema":{"type":"integer","pattern":"^\\d+$","minimum":1,"maximum":9007199254740991,"default":"10"}}]}},"/agents/{id}/keys":{"get":{"operationId":"getAgentsByIdKeys","summary":"List agent keys","tags":["Agents"],"responses":{"200":{"description":"The agent's keys","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^aak_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyThumbprint":{"type":"string"},"status":{"enum":["active","revoked"],"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","keyThumbprint","status","createdAt","lastSeenAt","revokedAt"]}}},"required":["keys"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]},"post":{"operationId":"postAgentsByIdKeys","summary":"Create an agent key","description":"Credential-granting, so it requires the console sign-in session with step-up assurance; bearer tokens are rejected.","tags":["Agents"],"security":[{"sessionCookie":[]}],"responses":{"200":{"description":"The created key","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string","pattern":"^aak_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyThumbprint":{"type":"string"},"status":{"enum":["active","revoked"],"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","keyThumbprint","status","createdAt","lastSeenAt","revokedAt"]}},"required":["key"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"publicKeyHex":{"type":"string","pattern":"^0[23][0-9a-f]{64}$"}},"required":["name","publicKeyHex"]}}}}}},"/agents/{id}/keys/{keyId}":{"delete":{"operationId":"deleteAgentsByIdKeysByKeyId","summary":"Revoke an agent key","description":"Credential-revoking, so it requires the console sign-in session with step-up assurance; bearer tokens are rejected.","tags":["Agents"],"security":[{"sessionCookie":[]}],"responses":{"200":{"description":"The revoked key","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string","pattern":"^aak_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyThumbprint":{"type":"string"},"status":{"enum":["active","revoked"],"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastSeenAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","keyThumbprint","status","createdAt","lastSeenAt","revokedAt"]}},"required":["key"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true},{"in":"path","name":"keyId","schema":{"type":"string","pattern":"^aak_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/approvals":{"get":{"operationId":"getApprovals","summary":"List pending and resolved approvals","description":"Pending intents are sorted by amount, largest first; resolved intents are capped to the 200 most recent.","tags":["Approvals"],"responses":{"200":{"description":"Pending and resolved approval intents","content":{"application/json":{"schema":{"type":"object","properties":{"pending":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"actorType":{"enum":["agent","operator"],"type":"string"},"actorUserId":{"type":"string"},"accountId":{"type":"string"},"action":{"enum":["send","transfer","create_counterparty","request_counterparty_details","x402","mpp","policy_override"],"type":"string"},"actionData":{"anyOf":[{"type":"object","properties":{"kind":{"const":"send"},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string"},"description":{"type":"string","maxLength":280}},"required":["method"]},{"type":"object","properties":{"kind":{"const":"x402"},"paymentRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"rawPaymentRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"resource":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"authorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"authorizationSource":{"enum":["caller","server"],"type":"string"},"callerAuthorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"preparedBodyHash":{"type":"string"},"prepareExpiresAt":{"type":"string"},"submitClaimedAt":{"type":"string"},"providerActivityId":{"type":"string"},"turnkeyFingerprint":{"type":"string"},"transactionId":{"type":"string"},"approveAttemptedAt":{"type":"string"},"paymentSignatureHeader":{"type":"string"},"signedOffer":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signedOfferVerification":{"type":"object","properties":{"status":{"enum":["verified","signer_unverified","failed","unsupported"],"type":"string"},"signer":{"type":"string"},"reason":{"type":"string"},"verifiedAt":{"type":"string"},"resourceUrl":{"type":"string"},"transaction":{"type":"string"},"transactionSource":{"enum":["chain","reported"],"type":"string"}},"required":["status","verifiedAt"]},"signedReceipt":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signedReceiptVerification":{"type":"object","properties":{"status":{"enum":["verified","signer_unverified","failed","unsupported"],"type":"string"},"signer":{"type":"string"},"reason":{"type":"string"},"verifiedAt":{"type":"string"},"resourceUrl":{"type":"string"},"transaction":{"type":"string"},"transactionSource":{"enum":["chain","reported"],"type":"string"}},"required":["status","verifiedAt"]}},"required":["kind","paymentRequirements"]},{"type":"object","properties":{"kind":{"const":"mpp"},"approvalChallenge":{"type":"object","properties":{"id":{"type":"string"},"realm":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"intent":{"const":"charge"},"request":{"type":"string"},"description":{"type":"string"},"digest":{"type":"string"},"expires":{"type":"string"},"header":{"const":"Payment-Authorization"},"opaque":{"type":"string"}},"required":["id","realm","method","intent","request","expires"]},"approvalResource":{"type":"object","properties":{"url":{"type":"string"},"serviceName":{"type":"string"}},"required":["url"]},"approvalPayment":{"type":"object","properties":{"amount":{"type":"string"},"chainId":{"type":"number"},"currency":{},"externalId":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"network":{"enum":["base","base-sepolia"],"type":"string"},"recipient":{}},"required":["amount","chainId","currency","method","network","recipient"]},"executionChallenge":{"type":"object","properties":{"id":{"type":"string"},"realm":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"intent":{"const":"charge"},"request":{"type":"string"},"description":{"type":"string"},"digest":{"type":"string"},"expires":{"type":"string"},"header":{"const":"Payment-Authorization"},"opaque":{"type":"string"}},"required":["id","realm","method","intent","request","expires"]},"executionResource":{"type":"object","properties":{"url":{"type":"string"},"serviceName":{"type":"string"}},"required":["url"]},"executionPayment":{"type":"object","properties":{"amount":{"type":"string"},"chainId":{"type":"number"},"currency":{},"externalId":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"network":{"enum":["base","base-sepolia"],"type":"string"},"recipient":{}},"required":["amount","chainId","currency","method","network","recipient"]},"authorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"preparedBodyHash":{"type":"string"},"prepareExpiresAt":{"type":"string"},"submitClaimedAt":{"type":"string"},"providerActivityId":{"type":"string"},"turnkeyFingerprint":{"type":"string"},"transactionId":{"type":"string"},"approveAttemptedAt":{"type":"string"},"paymentCredential":{"type":"string"}},"required":["kind","approvalChallenge","approvalResource","approvalPayment"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"const":1},"operations":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount"],"type":"string"},"newLimit":{"type":"object","properties":{"amount":{"type":"string"},"assetId":{"const":"USD"}},"required":["amount","assetId"]}},"required":["type","accountId","capability","limitType","newLimit"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["hourly_count","daily_count"],"type":"string"},"newLimit":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["type","accountId","capability","limitType","newLimit"]}]},"minItems":1},"durationSeconds":{"type":"number"},"reason":{"type":"string"},"approvedBasePolicyId":{"type":"string"},"approvedBaseVersion":{"type":"number"},"approvedOverrideSlot":{"type":"object","properties":{"activeGrantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"grantCount":{"type":"integer","minimum":0}},"required":["activeGrantId","grantCount"]},"resultPolicyId":{"type":"string"},"resultGrantId":{"type":"string"}},"required":["kind","schemaVersion","operations","durationSeconds","reason"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"const":1},"operations":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount"],"type":"string"},"newLimit":{"type":"object","properties":{"amount":{"type":"string"},"assetId":{"const":"USD"}},"required":["amount","assetId"]}},"required":["type","accountId","capability","limitType","newLimit"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["hourly_count","daily_count"],"type":"string"},"newLimit":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["type","accountId","capability","limitType","newLimit"]}]},{"anyOf":[{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string","minLength":1},"capability":{"type":"string","minLength":1},"limitType":{"type":"string","minLength":1},"newLimit":{}},"required":["type","accountId","capability","limitType","newLimit"]}]}]},"minItems":1},"durationSeconds":{"type":"number"},"reason":{"type":"string"},"resultPolicyId":{"type":"string"},"resultGrantId":{"type":"string"}},"required":["kind","schemaVersion","operations","durationSeconds","reason"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"type":"integer","minimum":1}},"required":["kind","schemaVersion"]},{"type":"object","properties":{"kind":{"const":"transfer"},"memo":{"type":"string"},"description":{"type":"string","maxLength":280}},"required":[]},{"type":"object","properties":{"kind":{"const":"create_counterparty"},"name":{"type":"string"},"email":{"type":"string"},"rail":{},"resultCounterpartyId":{"type":"string"}},"required":["kind","name"]},{"type":"object","properties":{"kind":{"const":"request_counterparty_details"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["kind","methods"]}]},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"counterpartyName":{"type":"string"},"state":{"enum":["created","evaluating","approved","pending_approval","blocked","denied","expired","executing","completed","failed"],"type":"string"},"decision":{"anyOf":[{"enum":["approved","pending_approval","blocked"],"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"approvals":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"at":{"type":"string"},"notes":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"}},"required":["email","at"]}},"requiredApprovals":{"type":"number"},"deniedBy":{"type":"string"},"deniedByName":{"type":"string"},"stateHistory":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string"},"enteredAt":{"type":"string"},"dwellMs":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["state","enteredAt","dwellMs"]}},"idempotencyKey":{"type":"string"},"requestHash":{"type":"string"},"policyId":{"type":"string"},"counterpartyId":{"type":"string"},"counterpartyRailId":{"type":"string"},"failureReason":{"type":"string"},"counterparty":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name"]},"requiresSignature":{"type":"boolean"}},"required":["id","agentId","agentName","actorType","action","state","decision","reasons","createdAt","resolvedAt","requiresSignature"]}},"resolved":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"actorType":{"enum":["agent","operator"],"type":"string"},"actorUserId":{"type":"string"},"accountId":{"type":"string"},"action":{"enum":["send","transfer","create_counterparty","request_counterparty_details","x402","mpp","policy_override"],"type":"string"},"actionData":{"anyOf":[{"type":"object","properties":{"kind":{"const":"send"},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string"},"description":{"type":"string","maxLength":280}},"required":["method"]},{"type":"object","properties":{"kind":{"const":"x402"},"paymentRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"rawPaymentRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"resource":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"authorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"authorizationSource":{"enum":["caller","server"],"type":"string"},"callerAuthorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"preparedBodyHash":{"type":"string"},"prepareExpiresAt":{"type":"string"},"submitClaimedAt":{"type":"string"},"providerActivityId":{"type":"string"},"turnkeyFingerprint":{"type":"string"},"transactionId":{"type":"string"},"approveAttemptedAt":{"type":"string"},"paymentSignatureHeader":{"type":"string"},"signedOffer":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signedOfferVerification":{"type":"object","properties":{"status":{"enum":["verified","signer_unverified","failed","unsupported"],"type":"string"},"signer":{"type":"string"},"reason":{"type":"string"},"verifiedAt":{"type":"string"},"resourceUrl":{"type":"string"},"transaction":{"type":"string"},"transactionSource":{"enum":["chain","reported"],"type":"string"}},"required":["status","verifiedAt"]},"signedReceipt":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signedReceiptVerification":{"type":"object","properties":{"status":{"enum":["verified","signer_unverified","failed","unsupported"],"type":"string"},"signer":{"type":"string"},"reason":{"type":"string"},"verifiedAt":{"type":"string"},"resourceUrl":{"type":"string"},"transaction":{"type":"string"},"transactionSource":{"enum":["chain","reported"],"type":"string"}},"required":["status","verifiedAt"]}},"required":["kind","paymentRequirements"]},{"type":"object","properties":{"kind":{"const":"mpp"},"approvalChallenge":{"type":"object","properties":{"id":{"type":"string"},"realm":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"intent":{"const":"charge"},"request":{"type":"string"},"description":{"type":"string"},"digest":{"type":"string"},"expires":{"type":"string"},"header":{"const":"Payment-Authorization"},"opaque":{"type":"string"}},"required":["id","realm","method","intent","request","expires"]},"approvalResource":{"type":"object","properties":{"url":{"type":"string"},"serviceName":{"type":"string"}},"required":["url"]},"approvalPayment":{"type":"object","properties":{"amount":{"type":"string"},"chainId":{"type":"number"},"currency":{},"externalId":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"network":{"enum":["base","base-sepolia"],"type":"string"},"recipient":{}},"required":["amount","chainId","currency","method","network","recipient"]},"executionChallenge":{"type":"object","properties":{"id":{"type":"string"},"realm":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"intent":{"const":"charge"},"request":{"type":"string"},"description":{"type":"string"},"digest":{"type":"string"},"expires":{"type":"string"},"header":{"const":"Payment-Authorization"},"opaque":{"type":"string"}},"required":["id","realm","method","intent","request","expires"]},"executionResource":{"type":"object","properties":{"url":{"type":"string"},"serviceName":{"type":"string"}},"required":["url"]},"executionPayment":{"type":"object","properties":{"amount":{"type":"string"},"chainId":{"type":"number"},"currency":{},"externalId":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"network":{"enum":["base","base-sepolia"],"type":"string"},"recipient":{}},"required":["amount","chainId","currency","method","network","recipient"]},"authorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"preparedBodyHash":{"type":"string"},"prepareExpiresAt":{"type":"string"},"submitClaimedAt":{"type":"string"},"providerActivityId":{"type":"string"},"turnkeyFingerprint":{"type":"string"},"transactionId":{"type":"string"},"approveAttemptedAt":{"type":"string"},"paymentCredential":{"type":"string"}},"required":["kind","approvalChallenge","approvalResource","approvalPayment"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"const":1},"operations":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount"],"type":"string"},"newLimit":{"type":"object","properties":{"amount":{"type":"string"},"assetId":{"const":"USD"}},"required":["amount","assetId"]}},"required":["type","accountId","capability","limitType","newLimit"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["hourly_count","daily_count"],"type":"string"},"newLimit":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["type","accountId","capability","limitType","newLimit"]}]},"minItems":1},"durationSeconds":{"type":"number"},"reason":{"type":"string"},"approvedBasePolicyId":{"type":"string"},"approvedBaseVersion":{"type":"number"},"approvedOverrideSlot":{"type":"object","properties":{"activeGrantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"grantCount":{"type":"integer","minimum":0}},"required":["activeGrantId","grantCount"]},"resultPolicyId":{"type":"string"},"resultGrantId":{"type":"string"}},"required":["kind","schemaVersion","operations","durationSeconds","reason"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"const":1},"operations":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount"],"type":"string"},"newLimit":{"type":"object","properties":{"amount":{"type":"string"},"assetId":{"const":"USD"}},"required":["amount","assetId"]}},"required":["type","accountId","capability","limitType","newLimit"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["hourly_count","daily_count"],"type":"string"},"newLimit":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["type","accountId","capability","limitType","newLimit"]}]},{"anyOf":[{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string","minLength":1},"capability":{"type":"string","minLength":1},"limitType":{"type":"string","minLength":1},"newLimit":{}},"required":["type","accountId","capability","limitType","newLimit"]}]}]},"minItems":1},"durationSeconds":{"type":"number"},"reason":{"type":"string"},"resultPolicyId":{"type":"string"},"resultGrantId":{"type":"string"}},"required":["kind","schemaVersion","operations","durationSeconds","reason"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"type":"integer","minimum":1}},"required":["kind","schemaVersion"]},{"type":"object","properties":{"kind":{"const":"transfer"},"memo":{"type":"string"},"description":{"type":"string","maxLength":280}},"required":[]},{"type":"object","properties":{"kind":{"const":"create_counterparty"},"name":{"type":"string"},"email":{"type":"string"},"rail":{},"resultCounterpartyId":{"type":"string"}},"required":["kind","name"]},{"type":"object","properties":{"kind":{"const":"request_counterparty_details"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["kind","methods"]}]},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"counterpartyName":{"type":"string"},"state":{"enum":["created","evaluating","approved","pending_approval","blocked","denied","expired","executing","completed","failed"],"type":"string"},"decision":{"anyOf":[{"enum":["approved","pending_approval","blocked"],"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"approvals":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"at":{"type":"string"},"notes":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"}},"required":["email","at"]}},"requiredApprovals":{"type":"number"},"deniedBy":{"type":"string"},"deniedByName":{"type":"string"},"stateHistory":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string"},"enteredAt":{"type":"string"},"dwellMs":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["state","enteredAt","dwellMs"]}},"idempotencyKey":{"type":"string"},"requestHash":{"type":"string"},"policyId":{"type":"string"},"counterpartyId":{"type":"string"},"counterpartyRailId":{"type":"string"},"failureReason":{"type":"string"},"counterparty":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name"]}},"required":["id","agentId","agentName","actorType","action","state","decision","reasons","createdAt","resolvedAt"]}}},"required":["pending","resolved"]}}}}}}},"/approvals/{id}/approve":{"post":{"operationId":"postApprovalsByIdApprove","summary":"Approve a pending intent","description":"Returns partial: true when more approvals are needed to complete quorum.","tags":["Approvals"],"responses":{"200":{"description":"The approved intent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"partial":{"type":"boolean"},"intent":{"type":"object","properties":{"id":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"actorType":{"enum":["agent","operator"],"type":"string"},"actorUserId":{"type":"string"},"accountId":{"type":"string"},"action":{"enum":["send","transfer","create_counterparty","request_counterparty_details","x402","mpp","policy_override"],"type":"string"},"actionData":{"anyOf":[{"type":"object","properties":{"kind":{"const":"send"},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string"},"description":{"type":"string","maxLength":280}},"required":["method"]},{"type":"object","properties":{"kind":{"const":"x402"},"paymentRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"rawPaymentRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"resource":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"authorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"authorizationSource":{"enum":["caller","server"],"type":"string"},"callerAuthorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"preparedBodyHash":{"type":"string"},"prepareExpiresAt":{"type":"string"},"submitClaimedAt":{"type":"string"},"providerActivityId":{"type":"string"},"turnkeyFingerprint":{"type":"string"},"transactionId":{"type":"string"},"approveAttemptedAt":{"type":"string"},"paymentSignatureHeader":{"type":"string"},"signedOffer":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signedOfferVerification":{"type":"object","properties":{"status":{"enum":["verified","signer_unverified","failed","unsupported"],"type":"string"},"signer":{"type":"string"},"reason":{"type":"string"},"verifiedAt":{"type":"string"},"resourceUrl":{"type":"string"},"transaction":{"type":"string"},"transactionSource":{"enum":["chain","reported"],"type":"string"}},"required":["status","verifiedAt"]},"signedReceipt":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signedReceiptVerification":{"type":"object","properties":{"status":{"enum":["verified","signer_unverified","failed","unsupported"],"type":"string"},"signer":{"type":"string"},"reason":{"type":"string"},"verifiedAt":{"type":"string"},"resourceUrl":{"type":"string"},"transaction":{"type":"string"},"transactionSource":{"enum":["chain","reported"],"type":"string"}},"required":["status","verifiedAt"]}},"required":["kind","paymentRequirements"]},{"type":"object","properties":{"kind":{"const":"mpp"},"approvalChallenge":{"type":"object","properties":{"id":{"type":"string"},"realm":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"intent":{"const":"charge"},"request":{"type":"string"},"description":{"type":"string"},"digest":{"type":"string"},"expires":{"type":"string"},"header":{"const":"Payment-Authorization"},"opaque":{"type":"string"}},"required":["id","realm","method","intent","request","expires"]},"approvalResource":{"type":"object","properties":{"url":{"type":"string"},"serviceName":{"type":"string"}},"required":["url"]},"approvalPayment":{"type":"object","properties":{"amount":{"type":"string"},"chainId":{"type":"number"},"currency":{},"externalId":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"network":{"enum":["base","base-sepolia"],"type":"string"},"recipient":{}},"required":["amount","chainId","currency","method","network","recipient"]},"executionChallenge":{"type":"object","properties":{"id":{"type":"string"},"realm":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"intent":{"const":"charge"},"request":{"type":"string"},"description":{"type":"string"},"digest":{"type":"string"},"expires":{"type":"string"},"header":{"const":"Payment-Authorization"},"opaque":{"type":"string"}},"required":["id","realm","method","intent","request","expires"]},"executionResource":{"type":"object","properties":{"url":{"type":"string"},"serviceName":{"type":"string"}},"required":["url"]},"executionPayment":{"type":"object","properties":{"amount":{"type":"string"},"chainId":{"type":"number"},"currency":{},"externalId":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"network":{"enum":["base","base-sepolia"],"type":"string"},"recipient":{}},"required":["amount","chainId","currency","method","network","recipient"]},"authorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"preparedBodyHash":{"type":"string"},"prepareExpiresAt":{"type":"string"},"submitClaimedAt":{"type":"string"},"providerActivityId":{"type":"string"},"turnkeyFingerprint":{"type":"string"},"transactionId":{"type":"string"},"approveAttemptedAt":{"type":"string"},"paymentCredential":{"type":"string"}},"required":["kind","approvalChallenge","approvalResource","approvalPayment"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"const":1},"operations":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount"],"type":"string"},"newLimit":{"type":"object","properties":{"amount":{"type":"string"},"assetId":{"const":"USD"}},"required":["amount","assetId"]}},"required":["type","accountId","capability","limitType","newLimit"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["hourly_count","daily_count"],"type":"string"},"newLimit":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["type","accountId","capability","limitType","newLimit"]}]},"minItems":1},"durationSeconds":{"type":"number"},"reason":{"type":"string"},"approvedBasePolicyId":{"type":"string"},"approvedBaseVersion":{"type":"number"},"approvedOverrideSlot":{"type":"object","properties":{"activeGrantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"grantCount":{"type":"integer","minimum":0}},"required":["activeGrantId","grantCount"]},"resultPolicyId":{"type":"string"},"resultGrantId":{"type":"string"}},"required":["kind","schemaVersion","operations","durationSeconds","reason"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"const":1},"operations":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount"],"type":"string"},"newLimit":{"type":"object","properties":{"amount":{"type":"string"},"assetId":{"const":"USD"}},"required":["amount","assetId"]}},"required":["type","accountId","capability","limitType","newLimit"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["hourly_count","daily_count"],"type":"string"},"newLimit":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["type","accountId","capability","limitType","newLimit"]}]},{"anyOf":[{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string","minLength":1},"capability":{"type":"string","minLength":1},"limitType":{"type":"string","minLength":1},"newLimit":{}},"required":["type","accountId","capability","limitType","newLimit"]}]}]},"minItems":1},"durationSeconds":{"type":"number"},"reason":{"type":"string"},"resultPolicyId":{"type":"string"},"resultGrantId":{"type":"string"}},"required":["kind","schemaVersion","operations","durationSeconds","reason"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"type":"integer","minimum":1}},"required":["kind","schemaVersion"]},{"type":"object","properties":{"kind":{"const":"transfer"},"memo":{"type":"string"},"description":{"type":"string","maxLength":280}},"required":[]},{"type":"object","properties":{"kind":{"const":"create_counterparty"},"name":{"type":"string"},"email":{"type":"string"},"rail":{},"resultCounterpartyId":{"type":"string"}},"required":["kind","name"]},{"type":"object","properties":{"kind":{"const":"request_counterparty_details"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["kind","methods"]}]},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"counterpartyName":{"type":"string"},"state":{"enum":["created","evaluating","approved","pending_approval","blocked","denied","expired","executing","completed","failed"],"type":"string"},"decision":{"anyOf":[{"enum":["approved","pending_approval","blocked"],"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"approvals":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"at":{"type":"string"},"notes":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"}},"required":["email","at"]}},"requiredApprovals":{"type":"number"},"deniedBy":{"type":"string"},"deniedByName":{"type":"string"},"stateHistory":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string"},"enteredAt":{"type":"string"},"dwellMs":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["state","enteredAt","dwellMs"]}},"idempotencyKey":{"type":"string"},"requestHash":{"type":"string"},"policyId":{"type":"string"},"counterpartyId":{"type":"string"},"counterpartyRailId":{"type":"string"},"failureReason":{"type":"string"}},"required":["id","agentId","agentName","actorType","action","state","decision","reasons","createdAt","resolvedAt"]}},"required":["success","intent"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string","maxLength":1000}},"required":[]}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/approvals/{id}/deny":{"post":{"operationId":"postApprovalsByIdDeny","summary":"Deny a pending intent","description":"A single deny resolves the intent even when partial approvals exist.","tags":["Approvals"],"responses":{"200":{"description":"The denied intent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"intent":{"type":"object","properties":{"id":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"actorType":{"enum":["agent","operator"],"type":"string"},"actorUserId":{"type":"string"},"accountId":{"type":"string"},"action":{"enum":["send","transfer","create_counterparty","request_counterparty_details","x402","mpp","policy_override"],"type":"string"},"actionData":{"anyOf":[{"type":"object","properties":{"kind":{"const":"send"},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string"},"description":{"type":"string","maxLength":280}},"required":["method"]},{"type":"object","properties":{"kind":{"const":"x402"},"paymentRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"rawPaymentRequirements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"resource":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"authorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"authorizationSource":{"enum":["caller","server"],"type":"string"},"callerAuthorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"preparedBodyHash":{"type":"string"},"prepareExpiresAt":{"type":"string"},"submitClaimedAt":{"type":"string"},"providerActivityId":{"type":"string"},"turnkeyFingerprint":{"type":"string"},"transactionId":{"type":"string"},"approveAttemptedAt":{"type":"string"},"paymentSignatureHeader":{"type":"string"},"signedOffer":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signedOfferVerification":{"type":"object","properties":{"status":{"enum":["verified","signer_unverified","failed","unsupported"],"type":"string"},"signer":{"type":"string"},"reason":{"type":"string"},"verifiedAt":{"type":"string"},"resourceUrl":{"type":"string"},"transaction":{"type":"string"},"transactionSource":{"enum":["chain","reported"],"type":"string"}},"required":["status","verifiedAt"]},"signedReceipt":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"signedReceiptVerification":{"type":"object","properties":{"status":{"enum":["verified","signer_unverified","failed","unsupported"],"type":"string"},"signer":{"type":"string"},"reason":{"type":"string"},"verifiedAt":{"type":"string"},"resourceUrl":{"type":"string"},"transaction":{"type":"string"},"transactionSource":{"enum":["chain","reported"],"type":"string"}},"required":["status","verifiedAt"]}},"required":["kind","paymentRequirements"]},{"type":"object","properties":{"kind":{"const":"mpp"},"approvalChallenge":{"type":"object","properties":{"id":{"type":"string"},"realm":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"intent":{"const":"charge"},"request":{"type":"string"},"description":{"type":"string"},"digest":{"type":"string"},"expires":{"type":"string"},"header":{"const":"Payment-Authorization"},"opaque":{"type":"string"}},"required":["id","realm","method","intent","request","expires"]},"approvalResource":{"type":"object","properties":{"url":{"type":"string"},"serviceName":{"type":"string"}},"required":["url"]},"approvalPayment":{"type":"object","properties":{"amount":{"type":"string"},"chainId":{"type":"number"},"currency":{},"externalId":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"network":{"enum":["base","base-sepolia"],"type":"string"},"recipient":{}},"required":["amount","chainId","currency","method","network","recipient"]},"executionChallenge":{"type":"object","properties":{"id":{"type":"string"},"realm":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"intent":{"const":"charge"},"request":{"type":"string"},"description":{"type":"string"},"digest":{"type":"string"},"expires":{"type":"string"},"header":{"const":"Payment-Authorization"},"opaque":{"type":"string"}},"required":["id","realm","method","intent","request","expires"]},"executionResource":{"type":"object","properties":{"url":{"type":"string"},"serviceName":{"type":"string"}},"required":["url"]},"executionPayment":{"type":"object","properties":{"amount":{"type":"string"},"chainId":{"type":"number"},"currency":{},"externalId":{"type":"string"},"method":{"enum":["evm","usdc"],"type":"string"},"network":{"enum":["base","base-sepolia"],"type":"string"},"recipient":{}},"required":["amount","chainId","currency","method","network","recipient"]},"authorization":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string"},"validAfter":{"type":"string"},"validBefore":{"type":"string"},"nonce":{"type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"]},"preparedBodyHash":{"type":"string"},"prepareExpiresAt":{"type":"string"},"submitClaimedAt":{"type":"string"},"providerActivityId":{"type":"string"},"turnkeyFingerprint":{"type":"string"},"transactionId":{"type":"string"},"approveAttemptedAt":{"type":"string"},"paymentCredential":{"type":"string"}},"required":["kind","approvalChallenge","approvalResource","approvalPayment"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"const":1},"operations":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount"],"type":"string"},"newLimit":{"type":"object","properties":{"amount":{"type":"string"},"assetId":{"const":"USD"}},"required":["amount","assetId"]}},"required":["type","accountId","capability","limitType","newLimit"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["hourly_count","daily_count"],"type":"string"},"newLimit":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["type","accountId","capability","limitType","newLimit"]}]},"minItems":1},"durationSeconds":{"type":"number"},"reason":{"type":"string"},"approvedBasePolicyId":{"type":"string"},"approvedBaseVersion":{"type":"number"},"approvedOverrideSlot":{"type":"object","properties":{"activeGrantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"grantCount":{"type":"integer","minimum":0}},"required":["activeGrantId","grantCount"]},"resultPolicyId":{"type":"string"},"resultGrantId":{"type":"string"}},"required":["kind","schemaVersion","operations","durationSeconds","reason"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"const":1},"operations":{"type":"array","items":{"anyOf":[{"anyOf":[{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount"],"type":"string"},"newLimit":{"type":"object","properties":{"amount":{"type":"string"},"assetId":{"const":"USD"}},"required":["amount","assetId"]}},"required":["type","accountId","capability","limitType","newLimit"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string"},"capability":{"enum":["send","transfer"],"type":"string"},"limitType":{"enum":["hourly_count","daily_count"],"type":"string"},"newLimit":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["type","accountId","capability","limitType","newLimit"]}]},{"anyOf":[{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"const":"increase_limit"},"accountId":{"type":"string","minLength":1},"capability":{"type":"string","minLength":1},"limitType":{"type":"string","minLength":1},"newLimit":{}},"required":["type","accountId","capability","limitType","newLimit"]}]}]},"minItems":1},"durationSeconds":{"type":"number"},"reason":{"type":"string"},"resultPolicyId":{"type":"string"},"resultGrantId":{"type":"string"}},"required":["kind","schemaVersion","operations","durationSeconds","reason"]},{"type":"object","properties":{"kind":{"const":"policy_override"},"schemaVersion":{"type":"integer","minimum":1}},"required":["kind","schemaVersion"]},{"type":"object","properties":{"kind":{"const":"transfer"},"memo":{"type":"string"},"description":{"type":"string","maxLength":280}},"required":[]},{"type":"object","properties":{"kind":{"const":"create_counterparty"},"name":{"type":"string"},"email":{"type":"string"},"rail":{},"resultCounterpartyId":{"type":"string"}},"required":["kind","name"]},{"type":"object","properties":{"kind":{"const":"request_counterparty_details"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["kind","methods"]}]},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"counterpartyName":{"type":"string"},"state":{"enum":["created","evaluating","approved","pending_approval","blocked","denied","expired","executing","completed","failed"],"type":"string"},"decision":{"anyOf":[{"enum":["approved","pending_approval","blocked"],"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"approvals":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"at":{"type":"string"},"notes":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"}},"required":["email","at"]}},"requiredApprovals":{"type":"number"},"deniedBy":{"type":"string"},"deniedByName":{"type":"string"},"stateHistory":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string"},"enteredAt":{"type":"string"},"dwellMs":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["state","enteredAt","dwellMs"]}},"idempotencyKey":{"type":"string"},"requestHash":{"type":"string"},"policyId":{"type":"string"},"counterpartyId":{"type":"string"},"counterpartyRailId":{"type":"string"},"failureReason":{"type":"string"}},"required":["id","agentId","agentName","actorType","action","state","decision","reasons","createdAt","resolvedAt"]}},"required":["success","intent"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string","maxLength":1000}},"required":[]}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]}},"/audit/reports/agent-money-activity":{"get":{"operationId":"getAuditReportsAgentMoneyActivity","summary":"List the agent money activity report","tags":["Audit"],"responses":{"200":{"description":"A page of report rows with period metadata and a summary","content":{"application/json":{"schema":{"type":"object","properties":{"reportType":{"const":"agent_money_activity"},"schemaVersion":{"const":"agent_money_activity_report.v1"},"canonicalizationVersion":{"const":"agent_money_activity_report.canon.v1"},"organizationId":{"type":"string"},"periodBasis":{"const":"intent_created"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"generatedAt":{"type":"string","format":"date-time"},"asOf":{"type":"string","format":"date-time"},"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"intentId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"resolvedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"agentId":{"type":"string"},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"policyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"enum":["send","transfer","x402","mpp"],"type":"string"},"disposition":{"enum":["pending","approved","blocked","denied","expired","executing","completed","failed"],"type":"string"},"executionStatus":{"enum":["no_execution","initiated","provider_pending","processing","completed","failed","reversed","manual_review"],"type":"string"},"custodyProvider":{"enum":["bridge","turnkey","none"],"type":"string"},"linkageStatus":{"enum":["not_applicable","linked","unlinked"],"type":"string"},"manifestStatus":{"enum":["present","not_generated"],"type":"string"},"evidenceLookup":{"type":"object","properties":{"key":{"enum":["intentId","transactionId","walletTransactionId"],"type":"string"},"id":{"type":"string"}},"required":["key","id"]},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"assetDecimals":{"anyOf":[{"type":"number"},{"type":"null"}]},"counterpartyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requiredApprovals":{"anyOf":[{"type":"number"},{"type":"null"}]},"approvalsCount":{"type":"number"},"missingEvidenceCodes":{"type":"array","items":{"enum":["not_applicable","source_row_missing","not_captured_legacy","correlator_absent","redacted","truncated","vertical_not_covered","ambiguous_source_rows"],"type":"string"}},"manifestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"payloadHash":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["intentId","createdAt","resolvedAt","agentId","agentName","accountId","policyId","action","disposition","executionStatus","custodyProvider","linkageStatus","manifestStatus","evidenceLookup","amount","assetDecimals","counterpartyName","requiredApprovals","approvalsCount","missingEvidenceCodes","manifestId","payloadHash"]}},"summary":{"type":"object","properties":{"rowCount":{"type":"number"},"missingEvidenceRowCount":{"type":"number"},"byExecutionGroup":{"type":"object","properties":{"completed":{"type":"number"},"in_flight":{"type":"number"},"exceptions":{"type":"number"},"no_execution":{"type":"number"}},"required":["completed","in_flight","exceptions","no_execution"]},"nativeAmounts":{"type":"array","items":{"type":"object","properties":{"asset_id":{"type":"string"},"requested":{"type":"string"},"executed":{"type":"string"},"rowCount":{"type":"number"}},"required":["asset_id","requested","executed","rowCount"]}}},"required":["rowCount","missingEvidenceRowCount","byExecutionGroup","nativeAmounts"]}},"required":["reportType","schemaVersion","canonicalizationVersion","organizationId","periodBasis","periodStart","periodEnd","generatedAt","asOf","total","limit","offset","rows","summary"]}}}}},"parameters":[{"in":"query","name":"from","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"agentId","schema":{}},{"in":"query","name":"accountId","schema":{}},{"in":"query","name":"action","schema":{}},{"in":"query","name":"policyId","schema":{}},{"in":"query","name":"executionGroup","schema":{}},{"in":"query","name":"custodyProvider","schema":{}},{"in":"query","name":"disposition","schema":{}},{"in":"query","name":"missingEvidenceOnly","schema":{"enum":["true","false"],"type":"string","default":"false"}},{"in":"query","name":"executionStatus","schema":{"not":{}}},{"in":"query","name":"limit","schema":{"type":"integer","pattern":"^\\d+$","minimum":1,"maximum":9007199254740991,"default":"50"}},{"in":"query","name":"offset","schema":{"type":"integer","pattern":"^\\d+$","minimum":0,"maximum":9007199254740991,"default":"0"}}]}},"/audit/reports/agent-money-activity/export":{"post":{"operationId":"postAuditReportsAgentMoneyActivityExport","summary":"Export the agent money activity report","description":"The response body is a CSV attachment, not JSON.","tags":["Audit"],"responses":{"200":{"description":"The report as a CSV attachment","content":{"text/csv":{"schema":{"type":"string"}}}}},"parameters":[{"in":"query","name":"from","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"agentId","schema":{}},{"in":"query","name":"accountId","schema":{}},{"in":"query","name":"action","schema":{}},{"in":"query","name":"policyId","schema":{}},{"in":"query","name":"executionGroup","schema":{}},{"in":"query","name":"custodyProvider","schema":{}},{"in":"query","name":"disposition","schema":{}},{"in":"query","name":"missingEvidenceOnly","schema":{"enum":["true","false"],"type":"string","default":"false"}},{"in":"query","name":"executionStatus","schema":{"not":{}}}]}},"/audit/reports/exceptions/{intentId}/handling":{"patch":{"operationId":"patchAuditReportsExceptionsByIntentIdHandling","summary":"Update an operational exception's handling","tags":["Audit"],"responses":{"200":{"description":"The exception's handling state after the action","content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"boolean"},"handling":{"type":"object","properties":{"status":{"enum":["unreviewed","open","in_review","resolved","dismissed"],"type":"string"},"disposition":{"anyOf":[{"enum":["action_completed","reviewed_no_action","duplicate","not_actionable","superseded"],"type":"string"},{"type":"null"}]},"ownerMemberId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reviewed":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"at":{"type":"string","format":"date-time"}},"required":["userId","email","role","at"]},{"type":"null"}]},"resolved":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"at":{"type":"string","format":"date-time"}},"required":["userId","email","role","at"]},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["status","disposition","ownerMemberId","reviewed","resolved","updatedAt"]}},"required":["changed","handling"]}}}}},"parameters":[{"in":"path","name":"intentId","schema":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"expectedObserved":{"anyOf":[{"type":"object","properties":{"sourceType":{"const":"intent"},"sourceId":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"const":"blocked_denied_expired"},"sourceStatus":{"enum":["blocked","denied","expired"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"transaction"},"sourceId":{"type":"string","pattern":"^txn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_provider_create","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["pending_create","unknown","manual_review","failed","reversed"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"wallet_transaction"},"sourceId":{"type":"string","pattern":"^wtxn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_wallet_lifecycle","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["prepared","broadcast_pending","broadcast","reorged","manual_review","broadcast_failed","rejected"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false}]},"expectedHandlingUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"action":{"const":"assign"},"ownerMemberId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["expectedObserved","expectedHandlingUpdatedAt","action","ownerMemberId"],"additionalProperties":false},{"type":"object","properties":{"expectedObserved":{"anyOf":[{"type":"object","properties":{"sourceType":{"const":"intent"},"sourceId":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"const":"blocked_denied_expired"},"sourceStatus":{"enum":["blocked","denied","expired"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"transaction"},"sourceId":{"type":"string","pattern":"^txn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_provider_create","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["pending_create","unknown","manual_review","failed","reversed"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"wallet_transaction"},"sourceId":{"type":"string","pattern":"^wtxn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_wallet_lifecycle","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["prepared","broadcast_pending","broadcast","reorged","manual_review","broadcast_failed","rejected"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false}]},"expectedHandlingUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"action":{"const":"start_review"}},"required":["expectedObserved","expectedHandlingUpdatedAt","action"],"additionalProperties":false},{"type":"object","properties":{"expectedObserved":{"anyOf":[{"type":"object","properties":{"sourceType":{"const":"intent"},"sourceId":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"const":"blocked_denied_expired"},"sourceStatus":{"enum":["blocked","denied","expired"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"transaction"},"sourceId":{"type":"string","pattern":"^txn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_provider_create","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["pending_create","unknown","manual_review","failed","reversed"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"wallet_transaction"},"sourceId":{"type":"string","pattern":"^wtxn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_wallet_lifecycle","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["prepared","broadcast_pending","broadcast","reorged","manual_review","broadcast_failed","rejected"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false}]},"expectedHandlingUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"action":{"const":"resolve"},"disposition":{"enum":["action_completed","reviewed_no_action"],"type":"string"}},"required":["expectedObserved","expectedHandlingUpdatedAt","action","disposition"],"additionalProperties":false},{"type":"object","properties":{"expectedObserved":{"anyOf":[{"type":"object","properties":{"sourceType":{"const":"intent"},"sourceId":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"const":"blocked_denied_expired"},"sourceStatus":{"enum":["blocked","denied","expired"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"transaction"},"sourceId":{"type":"string","pattern":"^txn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_provider_create","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["pending_create","unknown","manual_review","failed","reversed"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"wallet_transaction"},"sourceId":{"type":"string","pattern":"^wtxn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_wallet_lifecycle","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["prepared","broadcast_pending","broadcast","reorged","manual_review","broadcast_failed","rejected"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false}]},"expectedHandlingUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"action":{"const":"dismiss"},"disposition":{"enum":["duplicate","not_actionable","superseded"],"type":"string"}},"required":["expectedObserved","expectedHandlingUpdatedAt","action","disposition"],"additionalProperties":false},{"type":"object","properties":{"expectedObserved":{"anyOf":[{"type":"object","properties":{"sourceType":{"const":"intent"},"sourceId":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"const":"blocked_denied_expired"},"sourceStatus":{"enum":["blocked","denied","expired"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"transaction"},"sourceId":{"type":"string","pattern":"^txn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_provider_create","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["pending_create","unknown","manual_review","failed","reversed"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false},{"type":"object","properties":{"sourceType":{"const":"wallet_transaction"},"sourceId":{"type":"string","pattern":"^wtxn_[0-9A-HJKMNP-TV-Z]{26}$"},"category":{"enum":["manual_review","stale_wallet_lifecycle","failed_reversed"],"type":"string"},"sourceStatus":{"enum":["prepared","broadcast_pending","broadcast","reorged","manual_review","broadcast_failed","rejected"],"type":"string"}},"required":["sourceType","sourceId","category","sourceStatus"],"additionalProperties":false}]},"expectedHandlingUpdatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"action":{"const":"reopen"}},"required":["expectedObserved","expectedHandlingUpdatedAt","action"],"additionalProperties":false}]}}}}}},"/audit/reports/exceptions":{"get":{"operationId":"getAuditReportsExceptions","summary":"List the operational exception report","tags":["Audit"],"responses":{"200":{"description":"A page of exception rows with period metadata and a summary","content":{"application/json":{"schema":{"type":"object","properties":{"reportType":{"const":"operational_exceptions"},"schemaVersion":{"const":"operational_exception_report.v3"},"canonicalizationVersion":{"const":"operational_exception_report.canon.v3"},"organizationId":{"type":"string"},"periodBasis":{"const":"hybrid_open_queue_terminal_window"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"generatedAt":{"type":"string","format":"date-time"},"asOf":{"type":"string","format":"date-time"},"total":{"type":"number"},"truncated":{"type":"boolean"},"limit":{"type":"number"},"offset":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"intentId":{"type":"string"},"category":{"enum":["manual_review","stale_provider_create","stale_wallet_lifecycle","failed_reversed","blocked_denied_expired"],"type":"string"},"openedAt":{"type":"string","format":"date-time"},"ageMs":{"type":"number"},"open":{"type":"boolean"},"agentId":{"type":"string"},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"policyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"enum":["send","transfer","x402","mpp"],"type":"string"},"sourceType":{"enum":["transaction","wallet_transaction","intent"],"type":"string"},"sourceStatus":{"type":"string"},"custodyProvider":{"enum":["bridge","turnkey","none"],"type":"string"},"evidenceLookup":{"type":"object","properties":{"key":{"enum":["intentId","transactionId","walletTransactionId"],"type":"string"},"id":{"type":"string"}},"required":["key","id"]},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"assetDecimals":{"anyOf":[{"type":"number"},{"type":"null"}]},"manifestStatus":{"enum":["present","not_generated"],"type":"string"},"missingEvidenceCodes":{"type":"array","items":{"enum":["not_applicable","source_row_missing","not_captured_legacy","correlator_absent","redacted","truncated","vertical_not_covered","ambiguous_source_rows"],"type":"string"}},"manifestId":{"anyOf":[{"type":"string"},{"type":"null"}]},"payloadHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"handling":{"type":"object","properties":{"status":{"enum":["unreviewed","open","in_review","resolved","dismissed"],"type":"string"},"disposition":{"anyOf":[{"enum":["action_completed","reviewed_no_action","duplicate","not_actionable","superseded"],"type":"string"},{"type":"null"}]},"ownerMemberId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reviewed":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"at":{"type":"string","format":"date-time"}},"required":["userId","email","role","at"]},{"type":"null"}]},"resolved":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"at":{"type":"string","format":"date-time"}},"required":["userId","email","role","at"]},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["status","disposition","ownerMemberId","reviewed","resolved","updatedAt"]}},"required":["intentId","category","openedAt","ageMs","open","agentId","agentName","accountId","policyId","action","sourceType","sourceStatus","custodyProvider","evidenceLookup","amount","assetDecimals","manifestStatus","missingEvidenceCodes","manifestId","payloadHash","handling"]}},"summary":{"type":"object","properties":{"rowCount":{"type":"number"},"missingEvidenceRowCount":{"type":"number"},"openCount":{"type":"number"},"oldestOpenAgeMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"byCategory":{"type":"object","properties":{"manual_review":{"type":"number"},"stale_provider_create":{"type":"number"},"stale_wallet_lifecycle":{"type":"number"},"failed_reversed":{"type":"number"},"blocked_denied_expired":{"type":"number"}},"required":["manual_review","stale_provider_create","stale_wallet_lifecycle","failed_reversed","blocked_denied_expired"]},"byCustodyProvider":{"type":"object","properties":{"bridge":{"type":"number"},"turnkey":{"type":"number"},"none":{"type":"number"}},"required":["bridge","turnkey","none"]},"byHandlingStatus":{"type":"object","properties":{"unreviewed":{"type":"number"},"open":{"type":"number"},"in_review":{"type":"number"},"resolved":{"type":"number"},"dismissed":{"type":"number"}},"required":["unreviewed","open","in_review","resolved","dismissed"]},"nativeAmounts":{"type":"array","items":{"type":"object","properties":{"asset_id":{"type":"string"},"affected":{"type":"string"},"rowCount":{"type":"number"}},"required":["asset_id","affected","rowCount"]}}},"required":["rowCount","missingEvidenceRowCount","openCount","oldestOpenAgeMs","byCategory","byCustodyProvider","byHandlingStatus","nativeAmounts"]}},"required":["reportType","schemaVersion","canonicalizationVersion","organizationId","periodBasis","periodStart","periodEnd","generatedAt","asOf","total","truncated","limit","offset","rows","summary"]}}}}},"parameters":[{"in":"query","name":"from","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"agentId","schema":{}},{"in":"query","name":"accountId","schema":{}},{"in":"query","name":"category","schema":{}},{"in":"query","name":"custodyProvider","schema":{}},{"in":"query","name":"handlingStatus","schema":{}},{"in":"query","name":"openOnly","schema":{"enum":["true","false"],"type":"string","default":"false"}},{"in":"query","name":"limit","schema":{"type":"integer","pattern":"^\\d+$","minimum":1,"maximum":9007199254740991,"default":"50"}},{"in":"query","name":"offset","schema":{"type":"integer","pattern":"^\\d+$","minimum":0,"maximum":9007199254740991,"default":"0"}}]}},"/audit/reports/exceptions/export":{"post":{"operationId":"postAuditReportsExceptionsExport","summary":"Export the operational exception report","description":"The response body is a CSV attachment, not JSON.","tags":["Audit"],"responses":{"200":{"description":"The report as a CSV attachment","content":{"text/csv":{"schema":{"type":"string"}}}}},"parameters":[{"in":"query","name":"from","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"to","schema":{"type":"string","format":"date-time"},"required":true},{"in":"query","name":"agentId","schema":{}},{"in":"query","name":"accountId","schema":{}},{"in":"query","name":"category","schema":{}},{"in":"query","name":"custodyProvider","schema":{}},{"in":"query","name":"handlingStatus","schema":{}},{"in":"query","name":"openOnly","schema":{"enum":["true","false"],"type":"string","default":"false"}}]}},"/audit/evidence":{"get":{"operationId":"getAuditEvidence","summary":"Get an audit evidence packet","description":"Provide exactly one of intentId, transactionId, or walletTransactionId.","tags":["Audit"],"responses":{"200":{"description":"The audit evidence packet for the referenced intent","content":{"application/json":{"schema":{"type":"object","properties":{"packetVersion":{"const":"agent_money_evidence_packet.v1"},"organizationId":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"asOf":{"type":"string","format":"date-time"},"payloadHash":{"type":"string"},"packet":{"type":"object","properties":{"target":{"type":"object","properties":{"type":{"const":"intent"},"id":{"type":"string"}},"required":["type","id"]},"suppression":{"type":"object","properties":{"sourceSystem":{"const":"catena"},"visibilityProfile":{"const":"internal_admin"},"safeReasonCode":{"const":"none"}},"required":["sourceSystem","visibilityProfile","safeReasonCode"]},"missingEvidence":{"type":"array","items":{"type":"object","properties":{"section":{"type":"string"},"code":{"enum":["not_applicable","source_row_missing","not_captured_legacy","correlator_absent","redacted","truncated","vertical_not_covered","ambiguous_source_rows"],"type":"string"},"detail":{"type":"string"}},"required":["section","code"]}},"identityAndAuthority":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"activeLinks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clientKind":{"enum":["mcp","cli","remote_mcp","service"],"type":"string"},"clientInstanceId":{"type":"string"},"clientLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"operatorUserId":{"type":"string"},"linkedAt":{"type":"string","format":"date-time"}},"required":["id","clientKind","clientInstanceId","clientLabel","operatorUserId","linkedAt"]}},"policyGrants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"policyId":{"type":"string"},"status":{"enum":["active","expired","revoked"],"type":"string"},"grantedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"grantedAt":{"type":"string","format":"date-time"},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revokedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","policyId","status","grantedByUserId","grantedAt","expiresAt","revokedAt","revokedByUserId"]}}},"required":["agent","activeLinks","policyGrants"]},"intent":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"agentName":{"type":"string"},"accountId":{"type":"string"},"action":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"state":{"type":"string"},"decision":{"anyOf":[{"enum":["approved","pending_approval","blocked"],"type":"string"},{"type":"null"}]},"reasons":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"}},"required":["id","agentId","agentName","action","state","decision","reasons","createdAt"]},"policyDecisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"policyId":{"type":"string"},"policyGrantId":{"anyOf":[{"type":"string"},{"type":"null"}]},"policyVersion":{"type":"number"},"trigger":{"enum":["intent_created","approval_decided"],"type":"string"},"result":{"enum":["approved","pending_approval","blocked"],"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"ruleSnapshot":{"anyOf":[{},{"type":"null"}]},"ruleSnapshotHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"spendingStateSnapshot":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","policyId","policyGrantId","policyVersion","trigger","result","reasons","ruleSnapshot","ruleSnapshotHash","spendingStateSnapshot","createdAt"]}},"approvalTrail":{"type":"object","properties":{"source":{"enum":["normalized","legacy","none"],"type":"string"},"actions":{"type":"array","items":{"type":"object","properties":{"actor":{"type":"object","properties":{"actorType":{"type":"string"}},"required":["actorType"]},"action":{"enum":["approve","deny"],"type":"string"},"source":{"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"}},"required":["actor","action","source","notes","createdAt"]}}},"required":["source","actions"]},"execution":{"anyOf":[{"type":"object","properties":{"status":{"const":"captured"},"transaction":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"status":{"type":"string"},"movementStatus":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","amount","fee","status","movementStatus","createdAt"]}},"required":["status","transaction"]},{"type":"object","properties":{"status":{"const":"captured"},"rail":{"const":"wallet"},"walletTransaction":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"accountId":{"type":"string"},"intentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"initiatedByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"initiatedByAgentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"transactionId":{"type":"string"},"idempotencyKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"providerName":{"type":"string"},"providerRequestHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"providerIdempotencyKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"providerActivityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"preparedBodyHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"turnkeyFingerprint":{"anyOf":[{"type":"string"},{"type":"null"}]},"creatorPubkeyHex":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["prepared","broadcast_pending","broadcast","confirmed","broadcast_failed","reorged","manual_review","rejected"],"type":"string"},"network":{"type":"string"},"assetContract":{"type":"string"},"assetDecimals":{"type":"number"},"amount":{"type":"string"},"toAddress":{"type":"string"},"txHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"nonce":{"anyOf":[{"type":"string"},{"type":"null"}]},"maxFeePerGas":{"anyOf":[{"type":"string"},{"type":"null"}]},"maxPriorityFeePerGas":{"anyOf":[{"type":"string"},{"type":"null"}]},"gasLimit":{"anyOf":[{"type":"string"},{"type":"null"}]},"gasUsed":{"anyOf":[{"type":"string"},{"type":"null"}]},"effectiveGasPrice":{"anyOf":[{"type":"string"},{"type":"null"}]},"feeNative":{"anyOf":[{"type":"string"},{"type":"null"}]},"blockNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"blockHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSeenBlockNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"failureReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"broadcastAttempts":{"anyOf":[{"type":"number"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"preparedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"broadcastAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"failedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","organizationId","accountId","intentId","initiatedByUserId","initiatedByAgentId","counterpartyId","transactionId","idempotencyKey","requestHash","providerName","providerRequestHash","providerIdempotencyKey","providerActivityId","preparedBodyHash","turnkeyFingerprint","creatorPubkeyHex","status","network","assetContract","assetDecimals","amount","toAddress","txHash","nonce","maxFeePerGas","maxPriorityFeePerGas","gasLimit","gasUsed","effectiveGasPrice","feeNative","blockNumber","blockHash","lastSeenBlockNumber","failureReason","broadcastAttempts","createdAt","preparedAt","broadcastAt","confirmedAt","failedAt"],"additionalProperties":false},"journalTransaction":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"status":{"type":"string"},"movementStatus":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","amount","fee","status","movementStatus","createdAt"]},{"type":"null"}]},"holdLifecycle":{"type":"object","properties":{"state":{"enum":["held","settled","released"],"type":"string"},"placedAt":{"type":"string","format":"date-time"},"settledAt":{"type":"string","format":"date-time"},"releasedAt":{"type":"string","format":"date-time"}},"required":["state","placedAt"],"additionalProperties":false},"outcome":{"type":"object","properties":{"kind":{"enum":["confirmed","failed","rejected","under_review","in_flight"],"type":"string"},"at":{"type":"string","format":"date-time"},"failureReason":{"type":"string"}},"required":["kind"],"additionalProperties":false}},"required":["status","rail","walletTransaction","journalTransaction","holdLifecycle","outcome"],"additionalProperties":false},{"type":"object","properties":{"status":{"const":"not_applicable"},"reason":{"type":"string"}},"required":["status","reason"]},{"type":"object","properties":{"status":{"const":"missing"},"reason":{"type":"string"}},"required":["status","reason"]}]},"providerEvidence":{"type":"object","properties":{"status":{"enum":["captured","not_collected","missing"],"type":"string"},"omittedRequestCount":{"type":"number"},"omittedRequestDigest":{"type":"string"},"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"responseCode":{"anyOf":[{"type":"number"},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"responseBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"correlators":{"type":"object","properties":{"intentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"transactionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"walletTransactionId":{"anyOf":[{"type":"string"},{"type":"null"}]},"providerPaymentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"providerRequestHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["intentId","transactionId","walletTransactionId","providerPaymentId","providerRequestHash","idempotencyKey"]}},"required":["id","provider","method","path","createdAt","updatedAt","responseCode","durationMs","error","requestBody","responseBody","correlators"]}}},"required":["status","requests"]},"provenance":{"type":"object","properties":{"sourceRowRefs":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"sourceHashes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["sourceRowRefs","sourceHashes"]}},"required":["target","suppression","missingEvidence","identityAndAuthority","intent","policyDecisions","approvalTrail","execution","providerEvidence","provenance"]},"chainOfCustody":{"type":"object","properties":{"manifestId":{"type":"string"},"accessEventId":{"type":"string"},"generatedByActor":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"authPath":{"enum":["cookie","bearer_oauth"],"type":"string"},"clientId":{"type":"string"}},"required":["userId","email","role","authPath"]}},"required":["manifestId","accessEventId","generatedByActor"]}},"required":["packetVersion","organizationId","generatedAt","asOf","payloadHash","packet","chainOfCustody"]}}}}},"parameters":[{"in":"query","name":"intentId","schema":{"type":"string","pattern":"^int_[0-9A-HJKMNP-TV-Z]{26}$"}},{"in":"query","name":"transactionId","schema":{"type":"string","pattern":"^txn_[0-9A-HJKMNP-TV-Z]{26}$"}},{"in":"query","name":"walletTransactionId","schema":{"type":"string","pattern":"^wtxn_[0-9A-HJKMNP-TV-Z]{26}$"}}]}},"/audit":{"get":{"operationId":"getAudit","summary":"List audit events","tags":["Audit"],"responses":{"200":{"description":"Audit events matching the filters, with a total count","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"policy_eval"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"agentName":{"type":"string"},"actor":{"type":"object","properties":{"actorType":{"enum":["agent","user","staff"],"type":"string"},"actorId":{"type":"string"}},"required":["actorType","actorId"]},"accountId":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"decision":{"enum":["approved","pending_approval","blocked"],"type":"string"},"reasons":{"type":"array","items":{"type":"string"}}},"required":["decision","reasons"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"state_transition"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time"},"evidenceLookup":{"type":"object","properties":{"key":{"enum":["intentId","transactionId","walletTransactionId"],"type":"string"},"id":{"type":"string"}},"required":["key","id"]},"data":{"type":"object","properties":{"intentId":{"type":"string"},"actor":{"type":"object","properties":{"actorType":{"enum":["agent","user","staff"],"type":"string"},"actorId":{"type":"string"}},"required":["actorType","actorId"]},"walletTransactionId":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"dwellMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"recoveryReason":{"type":"string"}},"required":["from","to","dwellMs"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"approval_action"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"evidenceLookup":{"type":"object","properties":{"key":{"enum":["intentId","transactionId","walletTransactionId"],"type":"string"},"id":{"type":"string"}},"required":["key","id"]},"data":{"type":"object","properties":{"intentId":{"type":"string"},"actorId":{"type":"string"},"actor":{"type":"string"},"action":{"enum":["approve","deny"],"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["intentId","actor","action","notes"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"policy_change"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"policyId":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"field":{"type":"string"},"oldValue":{"type":"string"},"newValue":{"type":"string"},"actor":{"type":"string"}},"required":["policyId","field","oldValue","newValue","actor"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"policy_grant"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"action":{"enum":["granted","revoked"],"type":"string"},"grantId":{"type":"string"},"policyId":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"policyName":{"type":"string"},"agentName":{"type":"string"},"actor":{"type":"string"},"actorUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["action","grantId","policyId","policyName","agentName","actor","actorUserId","expiresAt"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"agent_created"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"agentName":{"type":"string"},"actor":{"type":"object","properties":{"actorType":{"const":"user"},"actorId":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"}},"required":["actorType","actorId","email","role"]}},"required":["agentName","actor"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"agent_linked"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"agentName":{"type":"string"},"clientKind":{"enum":["mcp","cli","remote_mcp","service"],"type":"string"},"clientLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"operatorId":{"type":"string"}},"required":["agentName","operatorId"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"counterparty_payment_request"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"counterpartyId":{"type":"string"},"action":{"enum":["requested","resent","submitted"],"type":"string"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]},"railCount":{"type":"number"},"operatorId":{"type":"string"}},"required":["counterpartyId","action"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"device_link_decision"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"decision":{"enum":["approved","denied"],"type":"string"},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"requesterIp":{"anyOf":[{"type":"string"},{"type":"null"}]},"operatorId":{"type":"string"},"scope":{"enum":["agent:link","agent:connect"],"type":"string"},"agentCreated":{"type":"boolean"},"policyId":{"anyOf":[{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},{"type":"null"}]}},"required":["decision","agentName","operatorId"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"agent_key_created"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"agentName":{"type":"string"},"keyName":{"type":"string"},"keyThumbprint":{"type":"string"},"operatorId":{"type":"string"}},"required":["agentName","keyName","keyThumbprint","operatorId"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"agent_key_revoked"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"agentName":{"type":"string"},"keyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyThumbprint":{"type":"string"},"operatorId":{"type":"string"}},"required":["agentName","keyName","keyThumbprint","operatorId"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"agent_link_reauthorized"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"agentName":{"type":"string"},"agentLinkId":{"type":"string"},"clientKind":{"enum":["mcp","cli","remote_mcp","service"],"type":"string"},"clientLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"previousAuthorizerUserId":{"type":"string"},"newAuthorizerUserId":{"type":"string"},"previousAuthorizerEmail":{"type":"string"},"newAuthorizerEmail":{"type":"string"}},"required":["agentName","agentLinkId","clientKind","clientLabel","previousAuthorizerUserId","newAuthorizerUserId"]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"custody_topology"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{},"required":[]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"signer_lifecycle"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{},"required":[]}},"required":["type","id","agentId","timestamp","data"]},{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"version":{"type":"number"},"grantId":{"type":"string","pattern":"^grant_[0-9A-HJKMNP-TV-Z]{26}$"},"evaluationId":{"type":"string"}},"required":["id","name"]},"type":{"const":"wallet_signer_enrollment"},"id":{"type":"string","pattern":"^audit_[0-9A-HJKMNP-TV-Z]{26}$"},"agentId":{"type":"null"},"timestamp":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{},"required":[]}},"required":["type","id","agentId","timestamp","data"]}]}},"total":{"type":"number"}},"required":["events","total"]}}}}},"parameters":[{"in":"query","name":"type","schema":{"type":"array","items":{"enum":["policy_eval","state_transition","approval_action","policy_change","policy_grant","agent_created","agent_linked","agent_link_reauthorized","counterparty_payment_request","device_link_decision","agent_key_created","agent_key_revoked"],"type":"string"}}},{"in":"query","name":"agentId","schema":{"anyOf":[{"const":""},{"type":"string","pattern":"^agent_[0-9A-HJKMNP-TV-Z]{26}$"}]}},{"in":"query","name":"limit","schema":{"type":"integer","pattern":"^\\d+$","minimum":1,"maximum":9007199254740991,"default":"50"}},{"in":"query","name":"offset","schema":{"type":"integer","pattern":"^\\d+$","minimum":0,"maximum":9007199254740991,"default":"0"}}]}},"/counterparties":{"get":{"operationId":"getCounterparties","summary":"List counterparties","description":"Account numbers are masked to their last four digits.","tags":["Counterparties"],"responses":{"200":{"description":"Counterparties with the organization total","content":{"application/json":{"schema":{"type":"object","properties":{"counterparties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"rails":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]}},"status":{"enum":["ready","awaiting_details"],"type":"string"},"invite":{"type":"object","properties":{"state":{"enum":["outstanding","expired"],"type":"string"},"expiresAt":{"type":"string"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["state","expiresAt","methods"]}},"required":["id","name","createdAt","rails","status"]}},"total":{"type":"number"}},"required":["counterparties","total"]}}}}},"parameters":[{"in":"query","name":"limit","schema":{"type":"integer","pattern":"^\\d+$","minimum":1,"maximum":9007199254740991}},{"in":"query","name":"offset","schema":{"type":"integer","pattern":"^\\d+$","minimum":0,"maximum":10000}}]},"post":{"operationId":"postCounterparties","summary":"Create a counterparty","description":"The response reveals the account numbers the caller just submitted.","tags":["Counterparties"],"responses":{"201":{"description":"Counterparty created","content":{"application/json":{"schema":{"type":"object","properties":{"counterparty":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"rails":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]}},"status":{"enum":["ready","awaiting_details"],"type":"string"},"invite":{"type":"object","properties":{"state":{"enum":["outstanding","expired"],"type":"string"},"expiresAt":{"type":"string"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["state","expiresAt","methods"]}},"required":["id","name","createdAt","rails","status"]}},"required":["counterparty"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"email":{"type":"string","format":"email"},"rail":{"oneOf":[{"type":"object","properties":{"type":{"const":"bank"},"bankName":{"type":"string","minLength":1},"routingNumber":{"type":"string","pattern":"^\\d{9}$"},"accountNumber":{"type":"string","pattern":"^\\d{4,17}$"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string","minLength":3,"maxLength":35},"addressCity":{"type":"string","minLength":1},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"}},"required":["type","bankName","routingNumber","accountNumber","addressStreet","addressCity","addressState","addressPostalCode"]},{"type":"object","properties":{"type":{"const":"wallet"},"walletAddress":{"type":"string","minLength":1},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["type","walletAddress","network"]}]},"rails":{"type":"array","items":[{"oneOf":[{"type":"object","properties":{"type":{"const":"bank"},"bankName":{"type":"string","minLength":1},"routingNumber":{"type":"string","pattern":"^\\d{9}$"},"accountNumber":{"type":"string","pattern":"^\\d{4,17}$"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string","minLength":3,"maxLength":35},"addressCity":{"type":"string","minLength":1},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"}},"required":["type","bankName","routingNumber","accountNumber","addressStreet","addressCity","addressState","addressPostalCode"]},{"type":"object","properties":{"type":{"const":"wallet"},"walletAddress":{"type":"string","minLength":1},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["type","walletAddress","network"]}]}],"minItems":1,"additionalItems":{"oneOf":[{"type":"object","properties":{"type":{"const":"bank"},"bankName":{"type":"string","minLength":1},"routingNumber":{"type":"string","pattern":"^\\d{9}$"},"accountNumber":{"type":"string","pattern":"^\\d{4,17}$"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string","minLength":3,"maxLength":35},"addressCity":{"type":"string","minLength":1},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"}},"required":["type","bankName","routingNumber","accountNumber","addressStreet","addressCity","addressState","addressPostalCode"]},{"type":"object","properties":{"type":{"const":"wallet"},"walletAddress":{"type":"string","minLength":1},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["type","walletAddress","network"]}]},"maxItems":10}},"required":["name"]}}}}}},"/counterparties/{id}/invite":{"post":{"operationId":"postCounterpartiesByIdInvite","summary":"Request payment details from a counterparty","description":"Sends the first invite, resends a pending one, or replaces the outstanding ask.","tags":["Counterparties"],"responses":{"200":{"description":"Counterparty with its invite state","content":{"application/json":{"schema":{"type":"object","properties":{"counterparty":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"rails":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]}},"status":{"enum":["ready","awaiting_details"],"type":"string"},"invite":{"type":"object","properties":{"state":{"enum":["outstanding","expired"],"type":"string"},"expiresAt":{"type":"string"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["state","expiresAt","methods"]}},"required":["id","name","createdAt","rails","status"]}},"required":["counterparty"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["methods"]}}}}}},"/counterparties/{id}/rails":{"post":{"operationId":"postCounterpartiesByIdRails","summary":"Add a rail to a counterparty","tags":["Counterparties"],"responses":{"201":{"description":"Rail created, account numbers revealed","content":{"application/json":{"schema":{"type":"object","properties":{"rail":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]}},"required":["rail"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"const":"bank"},"bankName":{"type":"string","minLength":1},"routingNumber":{"type":"string","pattern":"^\\d{9}$"},"accountNumber":{"type":"string","pattern":"^\\d{4,17}$"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string","minLength":3,"maxLength":35},"addressCity":{"type":"string","minLength":1},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"}},"required":["type","bankName","routingNumber","accountNumber","addressStreet","addressCity","addressState","addressPostalCode"]},{"type":"object","properties":{"type":{"const":"wallet"},"walletAddress":{"type":"string","minLength":1},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["type","walletAddress","network"]}]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/counterparties/{id}/rails/{railId}":{"delete":{"operationId":"deleteCounterpartiesByIdRailsByRailId","summary":"Delete a counterparty rail","tags":["Counterparties"],"responses":{"200":{"description":"Rail deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"path","name":"railId","required":true}]}},"/counterparties/{id}":{"delete":{"operationId":"deleteCounterpartiesById","summary":"Delete a counterparty","tags":["Counterparties"],"responses":{"200":{"description":"Counterparty deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/deposits/crypto-address":{"get":{"operationId":"getDepositsCryptoAddress","summary":"Get a crypto deposit address","description":"Turnkey wallets return their existing address. Bridge-backed accounts may provision a liquidation address on first read, which requires KYB verification.","tags":["Deposits"],"responses":{"200":{"description":"Deposit address for the requested chain and currency","content":{"application/json":{"schema":{"type":"object","properties":{"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"liquidationAddressId":{"type":"string"},"source":{"enum":["wallet","liquidation"],"type":"string"}},"required":["address","source"]}}}}},"parameters":[{"in":"query","name":"chain","schema":{"enum":["base","base-sepolia","arc","solana"],"type":"string","default":"base"}},{"in":"query","name":"currency","schema":{"enum":["usdc"],"type":"string","default":"usdc"}},{"in":"query","name":"accountId","schema":{"type":"string","minLength":1},"required":true}]}},"/health":{"get":{"operationId":"getHealth","summary":"Service health check","description":"Liveness probe returning the deployed git SHA.","tags":["Health"],"security":[],"responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"ok"},"version":{"type":"string"}},"required":["status","version"]}}}}}}},"/kyb/start":{"post":{"operationId":"postKybStart","summary":"Start KYB verification","tags":["KYB"],"responses":{"200":{"description":"The organization's KYB snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"kyb":{"oneOf":[{"type":"object","properties":{"kind":{"const":"needs_type_selection"},"status":{"const":"pending"},"canSelectIndividual":{"type":"boolean"}},"required":["kind","status","canSelectIndividual"]},{"type":"object","properties":{"kind":{"const":"in_progress"},"status":{"enum":["pending","in_review"],"type":"string"},"tos":{"oneOf":[{"type":"object","properties":{"state":{"const":"actionable"},"url":{"type":"string"}},"required":["state","url"]},{"type":"object","properties":{"state":{"const":"submitted"}},"required":["state"]},{"type":"object","properties":{"state":{"const":"done"}},"required":["state"]},{"type":"object","properties":{"state":{"const":"blocked"}},"required":["state"]}]},"verification":{"oneOf":[{"type":"object","properties":{"state":{"const":"actionable"},"url":{"type":"string"}},"required":["state","url"]},{"type":"object","properties":{"state":{"const":"submitted"}},"required":["state"]},{"type":"object","properties":{"state":{"const":"done"}},"required":["state"]},{"type":"object","properties":{"state":{"const":"blocked"}},"required":["state"]}]}},"required":["kind","status","tos","verification"]},{"type":"object","properties":{"kind":{"const":"rejected"},"status":{"const":"rejected"},"reason":{"anyOf":[{"type":"object","properties":{"rejectionReasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"developerReason":{"type":"string"}},"required":["reason"]}},"endorsements":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string"},"issues":{"type":"array","items":{"type":"string"}},"missing":{"type":"array","items":{"type":"string"}},"additionalRequirements":{"type":"array","items":{"type":"string"}}},"required":["name","status"]}}},"required":["rejectionReasons","endorsements"]},{"type":"null"}]}},"required":["kind","status","reason"]},{"type":"object","properties":{"kind":{"const":"verified"},"status":{"const":"verified"}},"required":["kind","status"]}]}},"required":["kyb"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"enum":["individual","business"],"type":"string"}},"required":["type"]}}}}}},"/linked-accounts":{"get":{"operationId":"getLinkedAccounts","summary":"List linked accounts","tags":["Linked accounts"],"responses":{"200":{"description":"Linked bank and wallet accounts","content":{"application/json":{"schema":{"type":"object","properties":{"linkedAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["bank","wallet"],"type":"string"},"verificationStatus":{"enum":["verified","pending","failed"],"type":"string"},"createdAt":{"type":"string"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","name","type","verificationStatus","createdAt"]}}},"required":["linkedAccounts"]}}}}}},"post":{"operationId":"postLinkedAccounts","summary":"Create a linked account","description":"Bank account numbers are stored and returned masked (last four digits only).","tags":["Linked accounts"],"responses":{"201":{"description":"The created linked account","content":{"application/json":{"schema":{"type":"object","properties":{"linkedAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["bank","wallet"],"type":"string"},"verificationStatus":{"enum":["verified","pending","failed"],"type":"string"},"createdAt":{"type":"string"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","name","type","verificationStatus","createdAt"]}},"required":["linkedAccount"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"const":"bank"},"name":{"type":"string","minLength":1},"bankName":{"type":"string"},"routingNumber":{"type":"string","minLength":1},"accountNumber":{"type":"string","minLength":1},"accountType":{"enum":["checking","savings"],"type":"string"}},"required":["type","name","routingNumber","accountNumber"]},{"type":"object","properties":{"type":{"const":"wallet"},"name":{"type":"string","minLength":1},"walletAddress":{"type":"string","minLength":1},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["type","name","walletAddress","network"]}]}}}}}},"/linked-accounts/{id}":{"delete":{"operationId":"deleteLinkedAccountsById","summary":"Delete a linked account","tags":["Linked accounts"],"responses":{"200":{"description":"Linked account deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]}},"/organization":{"patch":{"operationId":"patchOrganization","summary":"Update the organization","tags":["Organization"],"responses":{"200":{"description":"The updated organization name and onboarding state","content":{"application/json":{"schema":{"type":"object","properties":{"organizationName":{"type":"string"},"onboarding":{"type":"object","properties":{"postSignupRequired":{"type":"boolean"},"organizationNameRequired":{"type":"boolean"},"nonCustodialTermsRequired":{"type":"boolean"},"nonCustodialWalletSecurityRequired":{"type":"boolean"},"passkeyWalletSecurityAvailable":{"type":"boolean"}},"required":["postSignupRequired","organizationNameRequired","nonCustodialTermsRequired","nonCustodialWalletSecurityRequired","passkeyWalletSecurityAvailable"]}},"required":["organizationName","onboarding"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40}},"required":["name"]}}}}}},"/organization/non-custodial-terms/accept":{"post":{"operationId":"postOrganizationNonCustodialTermsAccept","summary":"Accept the non-custodial terms","description":"Acceptance is recorded for the whole organization and the server stamps the current terms version, so the request has no body.","tags":["Organization"],"responses":{"200":{"description":"The recomputed onboarding state","content":{"application/json":{"schema":{"type":"object","properties":{"onboarding":{"type":"object","properties":{"postSignupRequired":{"type":"boolean"},"organizationNameRequired":{"type":"boolean"},"nonCustodialTermsRequired":{"type":"boolean"},"nonCustodialWalletSecurityRequired":{"type":"boolean"},"passkeyWalletSecurityAvailable":{"type":"boolean"}},"required":["postSignupRequired","organizationNameRequired","nonCustodialTermsRequired","nonCustodialWalletSecurityRequired","passkeyWalletSecurityAvailable"]}},"required":["onboarding"]}}}}}}},"/organization/sandbox":{"post":{"operationId":"postOrganizationSandbox","summary":"Open Sandbox Mode","description":"Idempotent: creates the paired Sandbox organization if it does not exist, then moves the active organization for the current session only.","tags":["Organization"],"security":[{"sessionCookie":[]}],"responses":{"200":{"description":"The Sandbox organization now active for this session","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"environment":{"enum":["live","sandbox","mainnet","testnet"],"type":"string"}},"required":["organizationId","environment"]}}}}}}},"/organization/switch":{"post":{"operationId":"postOrganizationSwitch","summary":"Switch the active organization","description":"Session-scoped: changes the active organization for the current session only.","tags":["Organization"],"security":[{"sessionCookie":[]}],"responses":{"200":{"description":"The organization now active for this session","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"environment":{"enum":["live","sandbox","mainnet","testnet"],"type":"string"}},"required":["organizationId","environment"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1}},"required":["organizationId"]}}}}}},"/overview":{"get":{"operationId":"getOverview","summary":"Get the organization overview","tags":["Overview"],"responses":{"200":{"description":"Balances, accounts, counts, and recent activity","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string"},"balance":{"type":"object","properties":{"total":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"currency":{"type":"string"}},"required":["total","currency"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["bankAccount","wallet"],"type":"string"},"status":{"enum":["pending","active","suspended","closed","archived","locked"],"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"heldBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"availableBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"pendingIncoming":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"currency":{"type":"string"},"policyAccess":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"}},"required":["id","name","type","status","balance","currency","policyAccess","createdAt"]}},"pendingApprovals":{"type":"number"},"agentCount":{"type":"number"},"hasPolicies":{"type":"boolean"},"hasCompletedDeposit":{"type":"boolean"},"hasAgentMoneyMovementIntents":{"type":"boolean"},"provisioningPending":{"type":"boolean"},"agentIntentDailyCounts":{"type":"array","items":{"type":"object","properties":{"agentId":{"type":"string"},"agentName":{"type":"string"},"date":{"type":"string"},"count":{"type":"number"}},"required":["agentId","agentName","date","count"]}},"recentActivity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"policyId":{"type":"string"},"agentName":{"type":"string"},"action":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"destinationAmount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"counterpartyName":{"type":"string"},"method":{"enum":["ach","wire","stablecoin"],"type":"string"},"direction":{"enum":["incoming","outgoing"],"type":"string"},"state":{"type":"string"},"movementStatus":{"type":"string"},"accountId":{"type":"string"},"accountName":{"type":"string"},"destinationAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"completedAt":{"type":"string"},"approvals":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"at":{"type":"string"},"notes":{"type":"string"},"name":{"type":"string"}},"required":["email","at"]}},"requiredApprovals":{"type":"number"},"deniedBy":{"type":"string"},"memo":{"type":"string"},"description":{"type":"string"},"providerTraceNumber":{"type":"string"},"providerSenderBankRoutingNumber":{"type":"string"},"failureReason":{"type":"string"},"txHash":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"},"requestType":{"const":"sandbox_faucet"}},"required":["id","agentName","action","state","accountId","accountName","destinationAccountId","createdAt"]}}},"required":["organizationId","balance","accounts","pendingApprovals","agentCount","hasPolicies","hasCompletedDeposit","hasAgentMoneyMovementIntents","provisioningPending","agentIntentDailyCounts","recentActivity"]}}}}}}},"/policies":{"get":{"operationId":"getPolicies","summary":"List policies","tags":["Policies"],"responses":{"200":{"description":"Policies with assigned agent counts","content":{"application/json":{"schema":{"type":"object","properties":{"policies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"counterpartyRules":{"type":"object","properties":{"mode":{"enum":["open","restricted"],"type":"string"},"allowedCounterparties":{"type":"array","items":{"type":"string"}},"createAction":{"enum":["allow","block","require_approval"],"type":"string"},"requestPaymentDetailsAction":{"enum":["allow","block","require_approval"],"type":"string"},"allowCreate":{"type":"boolean"}},"required":["mode"]},"tradingHours":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"timezone":{"type":"string"},"days":{"enum":["weekdays","every_day"],"type":"string"}},"required":["start","end","timezone","days"]},"accountRules":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"perTxLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"dailyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"weeklyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"monthlyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"approvalThreshold":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"hourlyTxCount":{"type":"number"},"dailyTxCount":{"type":"number"},"requiredApprovals":{"type":"number"},"spendingScope":{"enum":["per_agent","per_policy"],"type":"string"}},"required":["accountId"]}},"policyCapabilities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"policyId":{"type":"string"},"capability":{"enum":["query_balance","read","send","transfer"],"type":"string"},"accountId":{"type":"string"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ruleType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount","hourly_count","daily_count"],"type":"string"},"thresholdAmount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"thresholdCount":{"type":"number"},"action":{"enum":["block","require_approval"],"type":"string"},"requiredApprovals":{"type":"number"},"accountAggregationScope":{"enum":["per_account","across_accounts"],"type":"string"},"actorAggregationScope":{"enum":["per_agent","per_policy"],"type":"string"},"displayOrder":{"type":"number"}},"required":["id","ruleType","action","requiredApprovals","accountAggregationScope","actorAggregationScope","displayOrder"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","policyId","capability","accountId","rules","createdAt","updatedAt"]}},"approvalWindowSeconds":{"type":"number"},"kind":{"enum":["base","override"],"type":"string"},"override":{"type":"object","properties":{"scopedAgentId":{"type":"string"},"derivedFromPolicyId":{"type":"string"},"derivedFromVersion":{"type":"number"}},"required":["scopedAgentId","derivedFromPolicyId","derivedFromVersion"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"agentCount":{"type":"number"},"activeOverrides":{"type":"array","items":{"type":"object","properties":{"overridePolicyId":{"type":"string"},"agentId":{"type":"string"},"agentName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string"}},"required":["overridePolicyId","agentId","agentName","expiresAt"]}}},"required":["id","name","description","capabilities","counterpartyRules","accountRules","policyCapabilities","version","createdAt","updatedAt","agentCount","activeOverrides"]}}},"required":["policies"]}}}}}},"post":{"operationId":"postPolicies","summary":"Create a policy","tags":["Policies"],"responses":{"201":{"description":"The created policy","content":{"application/json":{"schema":{"type":"object","properties":{"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"counterpartyRules":{"type":"object","properties":{"mode":{"enum":["open","restricted"],"type":"string"},"allowedCounterparties":{"type":"array","items":{"type":"string"}},"createAction":{"enum":["allow","block","require_approval"],"type":"string"},"requestPaymentDetailsAction":{"enum":["allow","block","require_approval"],"type":"string"},"allowCreate":{"type":"boolean"}},"required":["mode"]},"tradingHours":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"timezone":{"type":"string"},"days":{"enum":["weekdays","every_day"],"type":"string"}},"required":["start","end","timezone","days"]},"accountRules":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"perTxLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"dailyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"weeklyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"monthlyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"approvalThreshold":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"hourlyTxCount":{"type":"number"},"dailyTxCount":{"type":"number"},"requiredApprovals":{"type":"number"},"spendingScope":{"enum":["per_agent","per_policy"],"type":"string"}},"required":["accountId"]}},"policyCapabilities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"policyId":{"type":"string"},"capability":{"enum":["query_balance","read","send","transfer"],"type":"string"},"accountId":{"type":"string"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ruleType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount","hourly_count","daily_count"],"type":"string"},"thresholdAmount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"thresholdCount":{"type":"number"},"action":{"enum":["block","require_approval"],"type":"string"},"requiredApprovals":{"type":"number"},"accountAggregationScope":{"enum":["per_account","across_accounts"],"type":"string"},"actorAggregationScope":{"enum":["per_agent","per_policy"],"type":"string"},"displayOrder":{"type":"number"}},"required":["id","ruleType","action","requiredApprovals","accountAggregationScope","actorAggregationScope","displayOrder"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","policyId","capability","accountId","rules","createdAt","updatedAt"]}},"approvalWindowSeconds":{"type":"number"},"kind":{"enum":["base","override"],"type":"string"},"override":{"type":"object","properties":{"scopedAgentId":{"type":"string"},"derivedFromPolicyId":{"type":"string"},"derivedFromVersion":{"type":"number"}},"required":["scopedAgentId","derivedFromPolicyId","derivedFromVersion"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","capabilities","counterpartyRules","accountRules","policyCapabilities","version","createdAt","updatedAt"]}},"required":["policy"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":280},"capabilities":{"type":"array","items":{"enum":["query_balance","read","send","transfer","create_counterparty","policy_override"],"type":"string"},"minItems":1},"counterpartyRules":{"type":"object","properties":{"mode":{"enum":["open","restricted"],"type":"string"},"allowedCounterparties":{"type":"array","items":{"type":"string"}},"createAction":{"enum":["allow","block","require_approval"],"type":"string"},"requestPaymentDetailsAction":{"enum":["allow","block","require_approval"],"type":"string"},"allowCreate":{"type":"boolean"}},"required":["mode"]},"tradingHours":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"timezone":{"type":"string"},"days":{"enum":["weekdays","every_day"],"type":"string"}},"required":["start","end","timezone","days"]},"approvalWindowSeconds":{"type":"integer","minimum":1}},"required":["name","capabilities"],"additionalProperties":false}}}}}},"/policies/{id}":{"delete":{"operationId":"deletePoliciesById","summary":"Delete a policy","tags":["Policies"],"responses":{"200":{"description":"The policy was deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}]},"patch":{"operationId":"patchPoliciesById","summary":"Update a policy","tags":["Policies"],"responses":{"200":{"description":"The updated policy","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"counterpartyRules":{"type":"object","properties":{"mode":{"enum":["open","restricted"],"type":"string"},"allowedCounterparties":{"type":"array","items":{"type":"string"}},"createAction":{"enum":["allow","block","require_approval"],"type":"string"},"requestPaymentDetailsAction":{"enum":["allow","block","require_approval"],"type":"string"},"allowCreate":{"type":"boolean"}},"required":["mode"]},"tradingHours":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"timezone":{"type":"string"},"days":{"enum":["weekdays","every_day"],"type":"string"}},"required":["start","end","timezone","days"]},"accountRules":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"perTxLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"dailyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"weeklyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"monthlyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"approvalThreshold":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"hourlyTxCount":{"type":"number"},"dailyTxCount":{"type":"number"},"requiredApprovals":{"type":"number"},"spendingScope":{"enum":["per_agent","per_policy"],"type":"string"}},"required":["accountId"]}},"policyCapabilities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"policyId":{"type":"string"},"capability":{"enum":["query_balance","read","send","transfer"],"type":"string"},"accountId":{"type":"string"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ruleType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount","hourly_count","daily_count"],"type":"string"},"thresholdAmount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"thresholdCount":{"type":"number"},"action":{"enum":["block","require_approval"],"type":"string"},"requiredApprovals":{"type":"number"},"accountAggregationScope":{"enum":["per_account","across_accounts"],"type":"string"},"actorAggregationScope":{"enum":["per_agent","per_policy"],"type":"string"},"displayOrder":{"type":"number"}},"required":["id","ruleType","action","requiredApprovals","accountAggregationScope","actorAggregationScope","displayOrder"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","policyId","capability","accountId","rules","createdAt","updatedAt"]}},"approvalWindowSeconds":{"type":"number"},"kind":{"enum":["base","override"],"type":"string"},"override":{"type":"object","properties":{"scopedAgentId":{"type":"string"},"derivedFromPolicyId":{"type":"string"},"derivedFromVersion":{"type":"number"}},"required":["scopedAgentId","derivedFromPolicyId","derivedFromVersion"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","capabilities","counterpartyRules","accountRules","policyCapabilities","version","createdAt","updatedAt"]}},"required":["success","policy"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","maxLength":280},"capabilities":{"type":"array","items":{"enum":["query_balance","read","send","transfer","create_counterparty","policy_override"],"type":"string"}},"counterpartyRules":{"type":"object","properties":{"mode":{"enum":["open","restricted"],"type":"string"},"allowedCounterparties":{"type":"array","items":{"type":"string"}},"createAction":{"enum":["allow","block","require_approval"],"type":"string"},"requestPaymentDetailsAction":{"enum":["allow","block","require_approval"],"type":"string"},"allowCreate":{"type":"boolean"}},"required":["mode"]},"tradingHours":{"anyOf":[{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"timezone":{"type":"string"},"days":{"enum":["weekdays","every_day"],"type":"string"}},"required":["start","end","timezone","days"]},{"type":"null"}]},"approvalWindowSeconds":{"type":"integer","minimum":1}},"required":[],"additionalProperties":false}}}}}},"/policies/{id}/configuration":{"put":{"operationId":"putPoliciesByIdConfiguration","summary":"Replace a policy's configuration","tags":["Policies"],"responses":{"200":{"description":"The policy with its updated configuration","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"policy":{"type":"object","properties":{"id":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"name":{"type":"string"},"description":{"type":"string"},"capabilities":{"type":"array","items":{"type":"string"}},"counterpartyRules":{"type":"object","properties":{"mode":{"enum":["open","restricted"],"type":"string"},"allowedCounterparties":{"type":"array","items":{"type":"string"}},"createAction":{"enum":["allow","block","require_approval"],"type":"string"},"requestPaymentDetailsAction":{"enum":["allow","block","require_approval"],"type":"string"},"allowCreate":{"type":"boolean"}},"required":["mode"]},"tradingHours":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"timezone":{"type":"string"},"days":{"enum":["weekdays","every_day"],"type":"string"}},"required":["start","end","timezone","days"]},"accountRules":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"},"perTxLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"dailyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"weeklyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"monthlyLimit":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"approvalThreshold":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"hourlyTxCount":{"type":"number"},"dailyTxCount":{"type":"number"},"requiredApprovals":{"type":"number"},"spendingScope":{"enum":["per_agent","per_policy"],"type":"string"}},"required":["accountId"]}},"policyCapabilities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"policyId":{"type":"string"},"capability":{"enum":["query_balance","read","send","transfer"],"type":"string"},"accountId":{"type":"string"},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ruleType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount","hourly_count","daily_count"],"type":"string"},"thresholdAmount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"thresholdCount":{"type":"number"},"action":{"enum":["block","require_approval"],"type":"string"},"requiredApprovals":{"type":"number"},"accountAggregationScope":{"enum":["per_account","across_accounts"],"type":"string"},"actorAggregationScope":{"enum":["per_agent","per_policy"],"type":"string"},"displayOrder":{"type":"number"}},"required":["id","ruleType","action","requiredApprovals","accountAggregationScope","actorAggregationScope","displayOrder"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","policyId","capability","accountId","rules","createdAt","updatedAt"]}},"approvalWindowSeconds":{"type":"number"},"kind":{"enum":["base","override"],"type":"string"},"override":{"type":"object","properties":{"scopedAgentId":{"type":"string"},"derivedFromPolicyId":{"type":"string"},"derivedFromVersion":{"type":"number"}},"required":["scopedAgentId","derivedFromPolicyId","derivedFromVersion"]},"version":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","capabilities","counterpartyRules","accountRules","policyCapabilities","version","createdAt","updatedAt"]}},"required":["success","policy"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","pattern":"^pol_[0-9A-HJKMNP-TV-Z]{26}$"},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1},"read":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"}},"required":["accountId"],"additionalProperties":false}}},"required":["accounts"],"additionalProperties":false},"send":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"}},"required":["accountId"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ruleType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount","hourly_count","daily_count"],"type":"string"},"thresholdAmount":{"anyOf":[{"type":"string"},{"type":"number"}]},"thresholdCount":{"type":"integer","minimum":0},"action":{"enum":["block","require_approval"],"type":"string"},"requiredApprovals":{"type":"integer","minimum":1},"accountAggregationScope":{"enum":["per_account","across_accounts"],"type":"string"},"actorAggregationScope":{"enum":["per_agent","per_policy"],"type":"string"},"displayOrder":{"type":"integer","minimum":0}},"required":["ruleType","action"],"additionalProperties":false}}},"required":["accounts"],"additionalProperties":false},"transfer":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string"}},"required":["accountId"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ruleType":{"enum":["per_transaction_amount","daily_amount","weekly_amount","monthly_amount","hourly_count","daily_count"],"type":"string"},"thresholdAmount":{"anyOf":[{"type":"string"},{"type":"number"}]},"thresholdCount":{"type":"integer","minimum":0},"action":{"enum":["block","require_approval"],"type":"string"},"requiredApprovals":{"type":"integer","minimum":1},"accountAggregationScope":{"enum":["per_account","across_accounts"],"type":"string"},"actorAggregationScope":{"enum":["per_agent","per_policy"],"type":"string"},"displayOrder":{"type":"integer","minimum":0}},"required":["ruleType","action"],"additionalProperties":false}}},"required":["accounts"],"additionalProperties":false},"counterpartyRules":{"type":"object","properties":{"mode":{"enum":["open","restricted"],"type":"string"},"allowedCounterparties":{"type":"array","items":{"type":"string"}},"createAction":{"enum":["allow","block","require_approval"],"type":"string"},"requestPaymentDetailsAction":{"enum":["allow","block","require_approval"],"type":"string"},"allowCreate":{"type":"boolean"}},"required":["mode"]},"allowOverrideRequests":{"type":"boolean"}},"required":["version","read","send","transfer"],"additionalProperties":false}}}}}},"/send/quote":{"post":{"operationId":"postSendQuote","summary":"Quote a send","tags":["Send"],"responses":{"200":{"description":"Fees, balances, and submit eligibility for the send","content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"total":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"heldBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"availableBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"canSubmit":{"type":"boolean"},"blockingReasons":{"type":"array","items":{"type":"string"}},"executionMode":{"enum":["provider_backed","local_only"],"type":"string"},"providerReady":{"type":"boolean"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"counterparty":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"rails":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]}},"status":{"enum":["ready","awaiting_details"],"type":"string"},"invite":{"type":"object","properties":{"state":{"enum":["outstanding","expired"],"type":"string"},"expiresAt":{"type":"string"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["state","expiresAt","methods"]}},"required":["id","name","createdAt","rails","status"]},"rail":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]}},"required":["amount","fee","total","balance","heldBalance","availableBalance","canSubmit","blockingReasons","executionMode","providerReady","account","counterparty","rail"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"},"counterpartyRailId":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"anyOf":[{"type":"string"},{"type":"number"}]},"asset_id":{"const":"USD"}},"required":["amount","asset_id"]},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string","maxLength":280},"description":{"type":"string","maxLength":280},"sendReceiptToCounterparty":{"type":"boolean"}},"required":["accountId","counterpartyRailId","amount","method"]}}}}}},"/send":{"post":{"operationId":"postSend","summary":"Execute a send","description":"A replayed Idempotency-Key returns the original result with the Idempotent-Replayed response header set.","tags":["Send"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"The created send transaction","headers":{"Idempotent-Replayed":{"description":"Present with value \"true\" when this response replays a previously executed request","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"type":{"enum":["operator-send","operator-transfer","operator-deposit","operator-refund","microdeposit"],"type":"string"},"accountId":{"type":"string"},"counterpartyId":{"type":"string"},"counterpartyRailId":{"type":"string"},"counterpartyName":{"type":"string"},"counterpartyRailSnapshot":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]},"destinationAccountId":{"type":"string"},"linkedAccountId":{"type":"string"},"relatedTransactionId":{"type":"string"},"relatedTransactionType":{"enum":["refund"],"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"currency":{"type":"string"},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string"},"description":{"type":"string"},"txHash":{"type":"string"},"status":{"enum":["pending","processing","completed","failed","reversed"],"type":"string"},"movementStatus":{"enum":["initiated","provider_pending","processing","completed","failed","reversed","manual_review"],"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"webhookEventId":{"type":"string"},"providerEventId":{"type":"string"},"providerPaymentId":{"type":"string"},"providerTraceNumber":{"type":"string"},"providerSenderBankRoutingNumber":{"type":"string"},"providerState":{"type":"string"},"cardId":{"type":"string"},"providerEventCreatedAt":{"type":"string","format":"date-time"},"providerDeveloperFeeAmount":{"type":"string"},"providerExchangeFeeAmount":{"type":"string"},"providerGasFee":{"type":"string"},"providerSubtotalAmount":{"type":"string"}},"required":["id","organizationId","type","accountId","amount","fee","currency","status","movementStatus","createdAt"]},"counterparty":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"rails":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]}},"status":{"enum":["ready","awaiting_details"],"type":"string"},"invite":{"type":"object","properties":{"state":{"enum":["outstanding","expired"],"type":"string"},"expiresAt":{"type":"string"},"methods":{"type":"object","properties":{"bank":{"type":"boolean"},"wallet":{"type":"boolean"}},"required":["bank","wallet"]}},"required":["state","expiresAt","methods"]}},"required":["id","name","createdAt","rails","status"]},"rail":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]}},"required":["transaction","counterparty","rail","fee"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string"},"counterpartyRailId":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"anyOf":[{"type":"string"},{"type":"number"}]},"asset_id":{"const":"USD"}},"required":["amount","asset_id"]},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string","maxLength":280},"description":{"type":"string","maxLength":280},"sendReceiptToCounterparty":{"type":"boolean"}},"required":["accountId","counterpartyRailId","amount","method"]}}}}}},"/settings":{"get":{"operationId":"getSettings","summary":"Get organization settings","tags":["Settings"],"responses":{"200":{"description":"The organization's settings","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"companyName":{"type":"string"},"contactEmail":{"type":"string"},"theme":{"enum":["light","dark","system"],"type":"string"},"notifications":{"type":"object","properties":{"approvalRequests":{"enum":["off","in-app","email","email-push"],"type":"string"},"agentActivity":{"enum":["off","real-time","daily","weekly"],"type":"string"},"largeTransactions":{"enum":["off","in-app","real-time"],"type":"string"},"alertThreshold":{"type":"number"}},"required":["approvalRequests","agentActivity","largeTransactions","alertThreshold"]},"sessionTimeout":{"enum":[0,15,30,60,240],"type":"number"}},"required":["companyName","contactEmail","theme","notifications","sessionTimeout"]}},"required":["settings"]}}}}}},"patch":{"operationId":"patchSettings","summary":"Update organization settings","tags":["Settings"],"responses":{"200":{"description":"The updated settings","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"companyName":{"type":"string"},"contactEmail":{"type":"string"},"theme":{"enum":["light","dark","system"],"type":"string"},"notifications":{"type":"object","properties":{"approvalRequests":{"enum":["off","in-app","email","email-push"],"type":"string"},"agentActivity":{"enum":["off","real-time","daily","weekly"],"type":"string"},"largeTransactions":{"enum":["off","in-app","real-time"],"type":"string"},"alertThreshold":{"type":"number"}},"required":["approvalRequests","agentActivity","largeTransactions","alertThreshold"]},"sessionTimeout":{"enum":[0,15,30,60,240],"type":"number"}},"required":["companyName","contactEmail","theme","notifications","sessionTimeout"]}},"required":["settings"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"companyName":{"type":"string","minLength":1},"contactEmail":{"type":"string","minLength":1,"format":"email"},"theme":{"enum":["light","dark","system"],"type":"string"},"sessionTimeout":{"enum":[0,15,30,60,240],"type":"number"}},"required":[],"additionalProperties":false}}}}}},"/settings/notifications":{"get":{"operationId":"getSettingsNotifications","summary":"Get notification preferences","description":"Scoped to the calling user's own preferences.","tags":["Settings"],"responses":{"200":{"description":"The caller's per-category channel preferences","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"category":{"enum":["transactions","approvals","agents"],"type":"string"},"channels":{"type":"object","propertyNames":{"enum":["email","slack"],"type":"string"},"additionalProperties":{"type":"boolean"}},"emailLocked":{"type":"boolean"}},"required":["category","channels","emailLocked"]}}},"required":["categories"]}}}}}},"patch":{"operationId":"patchSettingsNotifications","summary":"Update notification preferences","description":"Partial update of the calling user's own preferences: category-channel pairs the request does not mention are left unchanged.","tags":["Settings"],"responses":{"200":{"description":"The caller's preferences after the update","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"category":{"enum":["transactions","approvals","agents"],"type":"string"},"channels":{"type":"object","propertyNames":{"enum":["email","slack"],"type":"string"},"additionalProperties":{"type":"boolean"}},"emailLocked":{"type":"boolean"}},"required":["category","channels","emailLocked"]}}},"required":["categories"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"array","items":{"type":"object","properties":{"category":{"enum":["transactions","approvals","agents"],"type":"string"},"channel":{"enum":["email","slack"],"type":"string"},"enabled":{"type":"boolean"}},"required":["category","channel","enabled"],"additionalProperties":false}}},"required":["preferences"],"additionalProperties":false}}}}}},"/team/invite-info":{"get":{"operationId":"getTeamInviteInfo","summary":"Get invite details","description":"Looks up a pending invitation; exactly one of the invitation or token query parameters is required.","tags":["Team"],"parameters":[{"name":"invitation","in":"query","required":false,"description":"The invitation id from the invite link","schema":{"type":"string"}},{"name":"token","in":"query","required":false,"description":"Alias for invitation","schema":{"type":"string"}}],"security":[],"responses":{"200":{"description":"The pending invitation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"organizationName":{"type":"string"}},"required":["id","email","name","role","organizationName"]}}}}}}},"/team/accept-invite":{"post":{"operationId":"postTeamAcceptInvite","summary":"Accept a team invite","description":"The caller must be signed in with the invited email's account; membership is granted on acceptance and the caller's active organization switches to the inviting one.","tags":["Team"],"security":[{"sessionCookie":[]}],"responses":{"200":{"description":"The newly active membership","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"status":{"enum":["active","pending"],"type":"string"},"invitedAt":{"type":"string"},"joinedAt":{"type":"string"}},"required":["id","name","email","role","status","invitedAt"]}},"required":["member"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"invitationId":{"type":"string","minLength":1},"token":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":80}},"required":["invitationId"]},{"type":"object","properties":{"invitationId":{"type":"string","minLength":1},"token":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":80}},"required":["token"]}]}}}}}},"/team/audit":{"get":{"operationId":"getTeamAudit","summary":"List team audit events","tags":["Team"],"responses":{"200":{"description":"The organization's team audit events","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"actorEmail":{"type":"string"},"action":{"enum":["invite_sent","invite_accepted","invite_resent","invite_cancelled","role_changed","member_removed"],"type":"string"},"targetEmail":{"type":"string"},"targetRole":{"type":"string"},"metadata":{"type":"string"},"createdAt":{"type":"string"}},"required":["actorEmail","action","targetEmail","createdAt"]}}},"required":["events"]}}}}}}},"/team":{"get":{"operationId":"getTeam","summary":"List team members","description":"Active members and pending invitations in one list, distinguished by the status field.","tags":["Team"],"responses":{"200":{"description":"Members and pending invitations","content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"status":{"enum":["active","pending"],"type":"string"},"invitedAt":{"type":"string"},"joinedAt":{"type":"string"}},"required":["id","name","email","role","status","invitedAt"]}}},"required":["team"]}}}}}}},"/team/invite":{"post":{"operationId":"postTeamInvite","summary":"Invite a team member","tags":["Team"],"responses":{"201":{"description":"The pending invitation and its accept URL","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"status":{"enum":["active","pending"],"type":"string"},"invitedAt":{"type":"string"},"joinedAt":{"type":"string"}},"required":["id","name","email","role","status","invitedAt"]},"inviteUrl":{"type":"string"}},"required":["member","inviteUrl"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"name":{"type":"string"}},"required":["email","role"]}}}}}},"/team/{id}":{"delete":{"operationId":"deleteTeamById","summary":"Remove a team member","description":"The id may be a member id or a pending invitation id; a pending invite is cancelled.","tags":["Team"],"responses":{"200":{"description":"Removal confirmation","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]},"patch":{"operationId":"patchTeamById","summary":"Update a team member's role","description":"The id may be a member id or a pending invitation id; a pending invite's role is changed in place.","tags":["Team"],"responses":{"200":{"description":"The updated member or invitation","content":{"application/json":{"schema":{"type":"object","properties":{"member":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"status":{"enum":["active","pending"],"type":"string"},"invitedAt":{"type":"string"},"joinedAt":{"type":"string"}},"required":["id","name","email","role","status","invitedAt"]}},"required":["member"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"enum":["admin","operator","viewer"],"type":"string"}},"required":[]}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/team/{id}/resend":{"post":{"operationId":"postTeamByIdResend","summary":"Resend a team invite","tags":["Team"],"responses":{"200":{"description":"Resend confirmation with the invitation id","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"invitationId":{"type":"string"}},"required":["success","invitationId"]}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}]}},"/transactions/{id}":{"get":{"operationId":"getTransactionsById","summary":"Get a transaction","tags":["Transactions"],"responses":{"200":{"description":"The requested transaction","content":{"application/json":{"schema":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"type":{"enum":["operator-send","operator-transfer","operator-deposit","operator-refund","microdeposit"],"type":"string"},"accountId":{"type":"string"},"counterpartyId":{"type":"string"},"counterpartyRailId":{"type":"string"},"counterpartyName":{"type":"string"},"counterpartyRailSnapshot":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]},"destinationAccountId":{"type":"string"},"linkedAccountId":{"type":"string"},"relatedTransactionId":{"type":"string"},"relatedTransactionType":{"enum":["refund"],"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"currency":{"type":"string"},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string"},"description":{"type":"string"},"txHash":{"type":"string"},"status":{"enum":["pending","processing","completed","failed","reversed"],"type":"string"},"movementStatus":{"enum":["initiated","provider_pending","processing","completed","failed","reversed","manual_review"],"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"webhookEventId":{"type":"string"},"providerEventId":{"type":"string"},"providerPaymentId":{"type":"string"},"providerTraceNumber":{"type":"string"},"providerSenderBankRoutingNumber":{"type":"string"},"providerState":{"type":"string"},"cardId":{"type":"string"},"providerEventCreatedAt":{"type":"string","format":"date-time"},"providerDeveloperFeeAmount":{"type":"string"},"providerExchangeFeeAmount":{"type":"string"},"providerGasFee":{"type":"string"},"providerSubtotalAmount":{"type":"string"}},"required":["id","organizationId","type","accountId","amount","fee","currency","status","movementStatus","createdAt"]}},"required":["transaction"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}]},"patch":{"operationId":"patchTransactionsById","summary":"Update a transaction description","description":"Send an empty description to clear it.","tags":["Transactions"],"responses":{"200":{"description":"The updated transaction","content":{"application/json":{"schema":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"type":{"enum":["operator-send","operator-transfer","operator-deposit","operator-refund","microdeposit"],"type":"string"},"accountId":{"type":"string"},"counterpartyId":{"type":"string"},"counterpartyRailId":{"type":"string"},"counterpartyName":{"type":"string"},"counterpartyRailSnapshot":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]},"destinationAccountId":{"type":"string"},"linkedAccountId":{"type":"string"},"relatedTransactionId":{"type":"string"},"relatedTransactionType":{"enum":["refund"],"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"currency":{"type":"string"},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string"},"description":{"type":"string"},"txHash":{"type":"string"},"status":{"enum":["pending","processing","completed","failed","reversed"],"type":"string"},"movementStatus":{"enum":["initiated","provider_pending","processing","completed","failed","reversed","manual_review"],"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"webhookEventId":{"type":"string"},"providerEventId":{"type":"string"},"providerPaymentId":{"type":"string"},"providerTraceNumber":{"type":"string"},"providerSenderBankRoutingNumber":{"type":"string"},"providerState":{"type":"string"},"cardId":{"type":"string"},"providerEventCreatedAt":{"type":"string","format":"date-time"},"providerDeveloperFeeAmount":{"type":"string"},"providerExchangeFeeAmount":{"type":"string"},"providerGasFee":{"type":"string"},"providerSubtotalAmount":{"type":"string"}},"required":["id","organizationId","type","accountId","amount","fee","currency","status","movementStatus","createdAt"]}},"required":["transaction"]}}}}},"parameters":[{"in":"path","name":"id","schema":{"type":"string","minLength":1},"required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","maxLength":280}},"required":["description"]}}}}}},"/transfer/quote":{"post":{"operationId":"postTransferQuote","summary":"Quote a transfer","tags":["Transfer"],"responses":{"200":{"description":"Fees, balances, and submit eligibility for the transfer","content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"total":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"heldBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"availableBalance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"canSubmit":{"type":"boolean"},"blockingReasons":{"type":"array","items":{"type":"string"}},"executionMode":{"enum":["provider_backed","local_only"],"type":"string"},"providerReady":{"type":"boolean"},"fromAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]}},"required":["id","name","balance"]},"toAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]}},"required":["id","name","balance"]}},"required":["amount","fee","total","balance","heldBalance","availableBalance","canSubmit","blockingReasons","executionMode","providerReady","fromAccount","toAccount"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fromAccountId":{"type":"string"},"toAccountId":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"anyOf":[{"type":"string"},{"type":"number"}]},"asset_id":{"const":"USD"}},"required":["amount","asset_id"]},"memo":{"type":"string","maxLength":280},"description":{"type":"string","maxLength":280}},"required":["fromAccountId","toAccountId","amount"]}}}}}},"/transfer":{"post":{"operationId":"postTransfer","summary":"Execute a transfer between accounts","description":"A replayed Idempotency-Key returns the original result with the Idempotent-Replayed response header set.","tags":["Transfer"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"201":{"description":"The created transfer transaction","headers":{"Idempotent-Replayed":{"description":"Present with value \"true\" when this response replays a previously executed request","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"type":{"enum":["operator-send","operator-transfer","operator-deposit","operator-refund","microdeposit"],"type":"string"},"accountId":{"type":"string"},"counterpartyId":{"type":"string"},"counterpartyRailId":{"type":"string"},"counterpartyName":{"type":"string"},"counterpartyRailSnapshot":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"bank"},"bankName":{"type":"string"},"routingNumber":{"type":"string"},"accountNumber":{"type":"string"},"accountType":{"enum":["checking","savings"],"type":"string"},"address":{"type":"string"},"addressStreet":{"type":"string"},"addressCity":{"type":"string"},"addressState":{"type":"string"},"addressPostalCode":{"type":"string"},"addressCountry":{"type":"string"},"providerExternalAccountId":{"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","bankName","routingNumber","accountNumber"]},{"type":"object","properties":{"id":{"type":"string"},"counterpartyId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"source":{"enum":["platform","counterparty"],"type":"string"},"type":{"const":"wallet"},"walletAddress":{"type":"string"},"network":{"enum":["base","base-sepolia","arc","solana"],"type":"string"}},"required":["id","counterpartyId","createdAt","source","type","walletAddress","network"]}]},"destinationAccountId":{"type":"string"},"linkedAccountId":{"type":"string"},"relatedTransactionId":{"type":"string"},"relatedTransactionType":{"enum":["refund"],"type":"string"},"amount":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]},"currency":{"type":"string"},"method":{"enum":["ach","wire","on-chain"],"type":"string"},"memo":{"type":"string"},"description":{"type":"string"},"txHash":{"type":"string"},"status":{"enum":["pending","processing","completed","failed","reversed"],"type":"string"},"movementStatus":{"enum":["initiated","provider_pending","processing","completed","failed","reversed","manual_review"],"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time"},"webhookEventId":{"type":"string"},"providerEventId":{"type":"string"},"providerPaymentId":{"type":"string"},"providerTraceNumber":{"type":"string"},"providerSenderBankRoutingNumber":{"type":"string"},"providerState":{"type":"string"},"cardId":{"type":"string"},"providerEventCreatedAt":{"type":"string","format":"date-time"},"providerDeveloperFeeAmount":{"type":"string"},"providerExchangeFeeAmount":{"type":"string"},"providerGasFee":{"type":"string"},"providerSubtotalAmount":{"type":"string"}},"required":["id","organizationId","type","accountId","amount","fee","currency","status","movementStatus","createdAt"]},"fromAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]}},"required":["id","name","balance"]},"toAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"balance":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]}},"required":["id","name","balance"]},"fee":{"type":"object","properties":{"amount":{"type":"string"},"asset_id":{"type":"string"}},"required":["amount","asset_id"]}},"required":["transaction","fromAccount","toAccount","fee"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fromAccountId":{"type":"string"},"toAccountId":{"type":"string"},"amount":{"type":"object","properties":{"amount":{"anyOf":[{"type":"string"},{"type":"number"}]},"asset_id":{"const":"USD"}},"required":["amount","asset_id"]},"memo":{"type":"string","maxLength":280},"description":{"type":"string","maxLength":280}},"required":["fromAccountId","toAccountId","amount"]}}}}}},"/users/me":{"get":{"operationId":"getUsersMe","summary":"Get the current user","description":"Resolves before the two-factor step-up gate so a client can render enrollment and challenge states.","tags":["Users"],"responses":{"200":{"description":"The caller's profile and organization context","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"organizationId":{"type":"string"},"organizationName":{"type":"string"},"organizations":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string"},"name":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"},"environment":{"enum":["live","sandbox","mainnet","testnet"],"type":"string"}},"required":["organizationId","name","role","environment"]}},"memberships":{"type":"array","items":{"type":"object","properties":{"organizationId":{"type":"string"},"name":{"type":"string"},"role":{"enum":["admin","operator","viewer"],"type":"string"}},"required":["organizationId","name","role"]}},"email":{"type":"string"},"name":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"enum":["admin","operator","viewer"],"type":"string"},"kybStatus":{"enum":["pending","in_review","verified","rejected"],"type":"string"},"kybCustomerType":{"anyOf":[{"enum":["individual","business"],"type":"string"},{"type":"null"}]},"kyb":{"oneOf":[{"type":"object","properties":{"kind":{"const":"needs_type_selection"},"status":{"const":"pending"},"canSelectIndividual":{"type":"boolean"}},"required":["kind","status","canSelectIndividual"]},{"type":"object","properties":{"kind":{"const":"in_progress"},"status":{"enum":["pending","in_review"],"type":"string"},"tos":{"oneOf":[{"type":"object","properties":{"state":{"const":"actionable"},"url":{"type":"string"}},"required":["state","url"]},{"type":"object","properties":{"state":{"const":"submitted"}},"required":["state"]},{"type":"object","properties":{"state":{"const":"done"}},"required":["state"]},{"type":"object","properties":{"state":{"const":"blocked"}},"required":["state"]}]},"verification":{"oneOf":[{"type":"object","properties":{"state":{"const":"actionable"},"url":{"type":"string"}},"required":["state","url"]},{"type":"object","properties":{"state":{"const":"submitted"}},"required":["state"]},{"type":"object","properties":{"state":{"const":"done"}},"required":["state"]},{"type":"object","properties":{"state":{"const":"blocked"}},"required":["state"]}]}},"required":["kind","status","tos","verification"]},{"type":"object","properties":{"kind":{"const":"rejected"},"status":{"const":"rejected"},"reason":{"anyOf":[{"type":"object","properties":{"rejectionReasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"developerReason":{"type":"string"}},"required":["reason"]}},"endorsements":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string"},"issues":{"type":"array","items":{"type":"string"}},"missing":{"type":"array","items":{"type":"string"}},"additionalRequirements":{"type":"array","items":{"type":"string"}}},"required":["name","status"]}}},"required":["rejectionReasons","endorsements"]},{"type":"null"}]}},"required":["kind","status","reason"]},{"type":"object","properties":{"kind":{"const":"verified"},"status":{"const":"verified"}},"required":["kind","status"]}]},"onboarding":{"type":"object","properties":{"postSignupRequired":{"type":"boolean"},"organizationNameRequired":{"type":"boolean"},"nonCustodialTermsRequired":{"type":"boolean"},"nonCustodialWalletSecurityRequired":{"type":"boolean"},"passkeyWalletSecurityAvailable":{"type":"boolean"}},"required":["postSignupRequired","organizationNameRequired","nonCustodialTermsRequired","nonCustodialWalletSecurityRequired","passkeyWalletSecurityAvailable"]},"environment":{"enum":["live","sandbox","mainnet","testnet"],"type":"string"},"capabilities":{"type":"object","properties":{"fiat-rails":{},"onchain:arc":{},"onchain:base":{},"onchain:base-sepolia":{},"onchain:solana":{},"kyb":{}},"required":["fiat-rails","onchain:arc","onchain:base","onchain:base-sepolia","onchain:solana","kyb"]},"linkedSandbox":{"anyOf":[{"type":"object","properties":{"organizationId":{"type":"string"}},"required":["organizationId"]},{"type":"null"}]},"linkedLive":{"anyOf":[{"type":"object","properties":{"organizationId":{"type":"string"}},"required":["organizationId"]},{"type":"null"}]},"sandboxModeEnabled":{"type":"boolean"},"earnWaitlistJoinedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"wallets":{"type":"object","properties":{"topology":{"enum":["none","bootstrapping","failed","ready"],"type":"string"},"creationEnabled":{"type":"boolean"},"passkeyEnrolled":{"type":"boolean"},"rootMethods":{"type":"array","items":{"enum":["passkey","google"],"type":"string"}},"approvalMethods":{"type":"array","items":{"enum":["passkey","google"],"type":"string"}},"creationMethods":{"type":"array","items":{"enum":["passkey","google"],"type":"string"}},"signerStatus":{"enum":["not_applicable","setup_required","provisioning","active","revocation_pending","revoked","failed","reconciliation_required"],"type":"string"},"reconciliationRequired":{"type":"boolean"}},"required":["topology","creationEnabled","passkeyEnrolled","rootMethods","approvalMethods","creationMethods","signerStatus"]},"twoFactor":{"type":"object","properties":{"required":{"type":"boolean"},"enrolled":{"type":"boolean"},"totpEnrolled":{"type":"boolean"},"hasPasskey":{"type":"boolean"},"sessionVerified":{"type":"boolean"}},"required":["required","enrolled","totpEnrolled","hasPasskey","sessionVerified"]}},"required":["userId","organizationId","organizationName","organizations","memberships","email","name","firstName","lastName","role","kybStatus","kybCustomerType","kyb","onboarding","environment","capabilities","linkedSandbox","linkedLive","sandboxModeEnabled","earnWaitlistJoinedAt","wallets","twoFactor"]}}}}}},"patch":{"operationId":"patchUsersMe","summary":"Update the current user's name","tags":["Users"],"responses":{"200":{"description":"The updated name","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","firstName","lastName"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":100},"lastName":{"type":"string","minLength":1,"maxLength":100}},"required":["firstName","lastName"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]}]}}}}}}}}