{"openapi":"3.1.0","info":{"title":"POST /api/v1/customers/auto-categorize","version":"1.0.0","description":"Bulk AI auto-categorize uncategorized customers"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/customers/auto-categorize":{"post":{"tags":["customers"],"summary":"Bulk AI auto-categorize uncategorized customers","description":"Schedule AI categorization for every customer in the business that currently has no category. Returns immediately; the actual LLM calls and DB writes happen in a background task. Refresh the customer list to observe progress.","operationId":"auto_categorize_customers_api_v1_customers_auto_categorize_post","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":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerAutoCategorizeResponse"}}}},"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":{"CustomerAutoCategorizeResponse":{"properties":{"submitted":{"type":"integer","title":"Submitted","description":"Number of uncategorized customers submitted for AI categorization."},"status":{"type":"string","title":"Status","description":"`processing` if work was scheduled, `noop` if there was nothing to do.","default":"processing"}},"type":"object","required":["submitted"],"title":"CustomerAutoCategorizeResponse","description":"Response for the bulk auto-categorize endpoint.\n\nThe request returns immediately after scheduling; the AI categorization\nruns as a background task and writes results to the database. Clients\nshould refresh the customers list to observe progress."},"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"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}