{"openapi":"3.1.0","info":{"title":"GET /api/v1/ap-approval","version":"1.0.0","description":"Get AP approval workflow"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/ap-approval":{"get":{"tags":["ap-approval"],"summary":"Get AP approval workflow","description":"Get the AP approval workflow for the current business's firm.","operationId":"get_ap_approval_workflow_api_v1_ap_approval_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApApprovalGetResponse"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApApprovalGetResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"True when a published workflow exists for the firm."},"workflow":{"anyOf":[{"$ref":"#/components/schemas/ApApprovalWorkflowSummary"},{"type":"null"}],"description":"Workflow summary, or null when not enabled."}},"type":"object","required":["enabled"],"title":"ApApprovalGetResponse","description":"Response for ``GET /ap-approval``.\n\n``enabled=False`` means the firm hasn't provisioned a workflow yet; the\npage should offer a \"Set up approval policy\" CTA."},"ApApprovalWorkflowSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Workflow UUID."},"name":{"type":"string","title":"Name","description":"Human-readable workflow name."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Workflow description."},"graph":{"$ref":"#/components/schemas/WorkflowGraphSchema-Output","description":"Workflow graph (nodes + edges)."},"is_published":{"type":"boolean","title":"Is Published","description":"Whether the workflow is published."},"version":{"type":"integer","title":"Version","description":"Workflow version (monotonic)."},"auto_approve_max_cents":{"type":"integer","title":"Auto Approve Max Cents","description":"Max bill amount (cents) eligible for auto-approval."},"ops_approve_max_cents":{"type":"integer","title":"Ops Approve Max Cents","description":"Max bill amount (cents) routed to operations approval. Bills above this require advisor + owner sign-off."}},"type":"object","required":["id","name","graph","is_published","version","auto_approve_max_cents","ops_approve_max_cents"],"title":"ApApprovalWorkflowSummary","description":"Summary of a provisioned AP approval workflow."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"},"WorkflowGraphSchema-Output":{"properties":{"nodes":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Nodes"},"edges":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Edges"}},"additionalProperties":true,"type":"object","title":"WorkflowGraphSchema","description":"Loose schema for a custom workflow graph.\n\nThe full graph shape is governed elsewhere (custom workflow builder); this\nschema just types the top-level ``nodes`` / ``edges`` arrays so the\nfrontend gets a non-``unknown`` field."}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}