{"openapi":"3.1.0","info":{"title":"SpendNod API","description":"Human authorization gateway for AI agent transactions. Agents submit requests; humans approve or deny via the dashboard.","version":"0.1.0"},"paths":{"/v1/authorize":{"post":{"tags":["authorization"],"summary":"Submit an authorization request","description":"Agent submits a transaction for authorization. Returns 200 with status=auto_approved or status=denied for immediate decisions. Returns 202 Accepted with status=pending if human review is required.","operationId":"create_authorization_request_v1_authorize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/authorize/{request_id}":{"get":{"tags":["authorization"],"summary":"Poll authorization request status","description":"Agent polls for the current status of a pending authorization request.","operationId":"get_authorization_request_v1_authorize__request_id__get","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["authorization"],"summary":"Cancel a pending authorization request","description":"Agent cancels a request it previously submitted that is still pending.","operationId":"cancel_authorization_request_v1_authorize__request_id__delete","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Request Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents":{"get":{"tags":["agents"],"summary":"List my agents","operationId":"list_agents_v1_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AgentResponse"},"type":"array","title":"Response List Agents V1 Agents Get"}}}}}},"post":{"tags":["agents"],"summary":"Register a new agent","description":"Creates a new agent and returns its API key. The API key is only returned once — store it securely.","operationId":"create_agent_v1_agents_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}":{"patch":{"tags":["agents"],"summary":"Update an agent","operationId":"update_agent_v1_agents__agent_id__patch","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agents"],"summary":"Revoke an agent","description":"Sets the agent's status to 'revoked'. The record is preserved for audit history.","operationId":"revoke_agent_v1_agents__agent_id__delete","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rules/templates":{"get":{"tags":["rules"],"summary":"List rule templates","description":"Returns preset rule configurations: Conservative, Moderate, Permissive, Online Shopping, Procurement, and Ad Spending.","operationId":"list_rule_templates_v1_rules_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RuleTemplate"},"type":"array","title":"Response List Rule Templates V1 Rules Templates Get"}}}}}}},"/v1/agents/{agent_id}/rules":{"get":{"tags":["rules"],"summary":"List rules for an agent","operationId":"list_rules_v1_agents__agent_id__rules_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleResponse"},"title":"Response List Rules V1 Agents  Agent Id  Rules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rules"],"summary":"Add a rule to an agent","operationId":"create_rule_v1_agents__agent_id__rules_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rules/{rule_id}":{"patch":{"tags":["rules"],"summary":"Update a rule","operationId":"update_rule_v1_rules__rule_id__patch","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rules"],"summary":"Delete a rule","operationId":"delete_rule_v1_rules__rule_id__delete","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/rules/template":{"post":{"tags":["rules"],"summary":"Apply a rule template to an agent","description":"Backs up the agent's current rules, then replaces them with the named template.","operationId":"apply_template_v1_agents__agent_id__rules_template_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleResponse"},"title":"Response Apply Template V1 Agents  Agent Id  Rules Template Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/rules/backup":{"get":{"tags":["rules"],"summary":"Get the most recent rule backup for an agent","operationId":"get_rule_backup_v1_agents__agent_id__rules_backup_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleBackupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/{agent_id}/rules/restore":{"post":{"tags":["rules"],"summary":"Restore rules from the most recent backup","description":"Deletes current rules and recreates them from the most recent backup.","operationId":"restore_rules_v1_agents__agent_id__rules_restore_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleResponse"},"title":"Response Restore Rules V1 Agents  Agent Id  Rules Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests":{"get":{"tags":["requests"],"summary":"List pending and recent requests","description":"Returns the human's view of recent authorization requests, newest first.","operationId":"list_requests_v1_requests_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RequestStatus"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuthorizeResponse"},"title":"Response List Requests V1 Requests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{request_id}/approve":{"post":{"tags":["requests"],"summary":"Approve a pending request","operationId":"approve_request_v1_requests__request_id__approve_post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{request_id}/deny":{"post":{"tags":["requests"],"summary":"Deny a pending request","operationId":"deny_request_v1_requests__request_id__deny_post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/dashboard/stats":{"get":{"tags":["dashboard"],"summary":"Spending summary and approval rate stats","operationId":"get_stats_v1_dashboard_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStats"}}}}}}},"/v1/dashboard/activity":{"get":{"tags":["dashboard"],"summary":"Recent activity feed","operationId":"get_activity_v1_dashboard_activity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ActivityItem"},"type":"array","title":"Response Get Activity V1 Dashboard Activity Get"}}}}}}},"/v1/usage":{"get":{"tags":["usage"],"summary":"Get current usage","description":"Returns the authenticated user's current monthly request count and active agent count.","operationId":"get_usage_v1_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}}}}},"/v1/activity/export":{"get":{"tags":["activity","activity"],"summary":"Export activity log","description":"Download authorization activity as CSV or JSON. Scoped to the authenticated user's agents only. Rate limited to 10 exports per hour.","operationId":"export_activity_v1_activity_export_get","parameters":[{"name":"format","in":"query","required":true,"schema":{"type":"string","pattern":"^(csv|json)$","description":"Export format: 'csv' or 'json'","title":"Format"},"description":"Export format: 'csv' or 'json'"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO 8601 start datetime (inclusive)","title":"Start Date"},"description":"ISO 8601 start datetime (inclusive)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO 8601 end datetime (inclusive)","title":"End Date"},"description":"ISO 8601 end datetime (inclusive)"},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by agent UUID","title":"Agent Id"},"description":"Filter by agent UUID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by spending category","title":"Category"},"description":"Filter by spending category"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["oauth"],"summary":"Oauth Metadata","operationId":"oauth_metadata__well_known_oauth_authorization_server_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/authorize":{"get":{"tags":["oauth"],"summary":"Oauth Authorize Form","operationId":"oauth_authorize_form_oauth_authorize_get","parameters":[{"name":"response_type","in":"query","required":false,"schema":{"type":"string","default":"code","title":"Response Type"}},{"name":"client_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Client Id"}},{"name":"redirect_uri","in":"query","required":false,"schema":{"type":"string","default":"","title":"Redirect Uri"}},{"name":"code_challenge","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code Challenge"}},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string","default":"S256","title":"Code Challenge Method"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"authorize","title":"Scope"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/login":{"post":{"tags":["oauth"],"summary":"Oauth Login","operationId":"oauth_login_oauth_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth_login_oauth_login_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/consent":{"get":{"tags":["oauth"],"summary":"Oauth Consent Form","operationId":"oauth_consent_form_oauth_consent_get","parameters":[{"name":"lp","in":"query","required":false,"schema":{"type":"string","default":"","title":"Lp"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["oauth"],"summary":"Oauth Consent Submit","operationId":"oauth_consent_submit_oauth_consent_post","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth_consent_submit_oauth_consent_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/forgot-password":{"post":{"tags":["oauth"],"summary":"Oauth Forgot Password","operationId":"oauth_forgot_password_oauth_forgot_password_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth_forgot_password_oauth_forgot_password_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/token":{"post":{"tags":["oauth"],"summary":"Oauth Token","operationId":"oauth_token_oauth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth_token_oauth_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/register":{"post":{"tags":["oauth"],"summary":"Oauth Register","operationId":"oauth_register_oauth_register_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"tags":["meta"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"ActivityItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_type":{"type":"string","title":"Event Type"},"agent_name":{"type":"string","title":"Agent Name"},"action":{"type":"string","title":"Action"},"amount":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount"},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_type","agent_name","action","amount","vendor","description","created_at"],"title":"ActivityItem"},"AgentCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","required":["name"],"title":"AgentCreate"},"AgentCreateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"api_key_prefix":{"type":"string","title":"Api Key Prefix"},"status":{"$ref":"#/components/schemas/AgentStatus"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["id","name","api_key_prefix","status","metadata","created_at","api_key"],"title":"AgentCreateResponse"},"AgentResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"api_key_prefix":{"type":"string","title":"Api Key Prefix"},"status":{"$ref":"#/components/schemas/AgentStatus"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","api_key_prefix","status","metadata","created_at"],"title":"AgentResponse"},"AgentStatus":{"type":"string","enum":["active","paused","revoked"],"title":"AgentStatus"},"AgentUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"status":{"anyOf":[{"$ref":"#/components/schemas/AgentStatus"},{"type":"null"}]}},"type":"object","title":"AgentUpdate"},"ApplyTemplateRequest":{"properties":{"template_name":{"type":"string","title":"Template Name"}},"type":"object","required":["template_name"],"title":"ApplyTemplateRequest"},"ApproveRequest":{"properties":{"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"ApproveRequest"},"AuthorizeRequest":{"properties":{"action":{"type":"string","maxLength":100,"minLength":1,"title":"Action"},"amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount"},"currency":{"type":"string","maxLength":3,"title":"Currency","default":"USD"},"vendor":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Vendor"},"category":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Category"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"}},"type":"object","required":["action"],"title":"AuthorizeRequest"},"AuthorizeResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"amount":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Amount"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"$ref":"#/components/schemas/RequestStatus"},"approval_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Token"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"},"rule_evaluation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Rule Evaluation"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"plan_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Warning"}},"type":"object","required":["id","status","created_at"],"title":"AuthorizeResponse"},"Body_oauth_consent_submit_oauth_consent_post":{"properties":{"login_proof":{"type":"string","title":"Login Proof"},"action":{"type":"string","title":"Action","default":"approve"}},"type":"object","required":["login_proof"],"title":"Body_oauth_consent_submit_oauth_consent_post"},"Body_oauth_forgot_password_oauth_forgot_password_post":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"Body_oauth_forgot_password_oauth_forgot_password_post"},"Body_oauth_login_oauth_login_post":{"properties":{"client_id":{"type":"string","title":"Client Id"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"code_challenge":{"type":"string","title":"Code Challenge"},"code_challenge_method":{"type":"string","title":"Code Challenge Method","default":"S256"},"scope":{"type":"string","title":"Scope","default":"authorize"},"state":{"type":"string","title":"State","default":""},"response_type":{"type":"string","title":"Response Type","default":"code"},"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["client_id","redirect_uri","code_challenge","email","password"],"title":"Body_oauth_login_oauth_login_post"},"Body_oauth_token_oauth_token_post":{"properties":{"grant_type":{"type":"string","title":"Grant Type"},"code":{"type":"string","title":"Code"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"client_id":{"type":"string","title":"Client Id"},"code_verifier":{"type":"string","title":"Code Verifier"}},"type":"object","required":["grant_type","code","redirect_uri","client_id","code_verifier"],"title":"Body_oauth_token_oauth_token_post"},"DashboardStats":{"properties":{"total_requests":{"type":"integer","title":"Total Requests"},"auto_approved":{"type":"integer","title":"Auto Approved"},"pending":{"type":"integer","title":"Pending"},"approved":{"type":"integer","title":"Approved"},"denied":{"type":"integer","title":"Denied"},"expired":{"type":"integer","title":"Expired"},"total_spend":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Spend"},"approval_rate":{"type":"number","title":"Approval Rate"},"agents_active":{"type":"integer","title":"Agents Active"}},"type":"object","required":["total_requests","auto_approved","pending","approved","denied","expired","total_spend","approval_rate","agents_active"],"title":"DashboardStats"},"DenyRequest":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"DenyRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"RequestStatus":{"type":"string","enum":["auto_approved","pending","approved","denied","expired","cancelled"],"title":"RequestStatus"},"RuleBackupResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"rules_json":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rules Json"},"template_applied":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Applied"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","agent_id","user_id","rules_json","template_applied","created_at"],"title":"RuleBackupResponse"},"RuleCreate":{"properties":{"rule_type":{"$ref":"#/components/schemas/RuleType"},"value":{"additionalProperties":true,"type":"object","title":"Value","description":"Rule value payload. Examples: {\"amount\": 50.0} for amount rules, {\"vendors\": [\"AWS\", \"GCP\"]} for vendor rules."}},"type":"object","required":["rule_type","value"],"title":"RuleCreate"},"RuleResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"rule_type":{"$ref":"#/components/schemas/RuleType"},"value":{"additionalProperties":true,"type":"object","title":"Value"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","agent_id","rule_type","value","is_active","created_at"],"title":"RuleResponse"},"RuleTemplate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"rules":{"items":{"$ref":"#/components/schemas/RuleTemplateRule"},"type":"array","title":"Rules"},"risk_level":{"type":"string","title":"Risk Level"}},"type":"object","required":["name","description","rules","risk_level"],"title":"RuleTemplate"},"RuleTemplateRule":{"properties":{"rule_type":{"$ref":"#/components/schemas/RuleType"},"value":{"additionalProperties":true,"type":"object","title":"Value"}},"type":"object","required":["rule_type","value"],"title":"RuleTemplateRule"},"RuleType":{"type":"string","enum":["max_per_transaction","max_per_day","max_per_month","allowed_vendors","blocked_vendors","allowed_categories","blocked_categories","require_approval_above","auto_approve_below"],"title":"RuleType"},"RuleUpdate":{"properties":{"value":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Value"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"RuleUpdate"},"UsageResponse":{"properties":{"plan":{"type":"string","title":"Plan"},"authorizations_this_month":{"type":"integer","title":"Authorizations This Month"},"requests_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requests Limit"},"agents_active":{"type":"integer","title":"Agents Active"},"agents_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agents Limit"},"available_upgrades":{"items":{"type":"string"},"type":"array","title":"Available Upgrades"},"has_billing_account":{"type":"boolean","title":"Has Billing Account"}},"type":"object","required":["plan","authorizations_this_month","requests_limit","agents_active","agents_limit","available_upgrades","has_billing_account"],"title":"UsageResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}