{"openapi":"3.1.0","info":{"title":"GET /api/v1/o2c/deals/owners","version":"1.0.0","description":"List sales reps with deals"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/o2c/deals/owners":{"get":{"tags":["deals"],"summary":"List sales reps with deals","description":"Every distinct sales rep / deal owner on the business's deals, with their deal counts, plus how many deals have no owner yet. Feeds the pipeline's owner filter chips, which need the full roster rather than whichever owners happen to be on the current page.","operationId":"list_deal_owners_api_v1_o2c_deals_owners_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/SuccessEnvelope_DealOwnersResponse_"}}}},"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"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DealOwnerSummary":{"properties":{"owner_name":{"type":"string","title":"Owner Name"},"deal_count":{"type":"integer","title":"Deal Count","default":0}},"type":"object","required":["owner_name"],"title":"DealOwnerSummary","description":"One distinct ``Deal.owner_name`` plus how many deals carry it."},"DealOwnersResponse":{"properties":{"owners":{"items":{"$ref":"#/components/schemas/DealOwnerSummary"},"type":"array","title":"Owners","default":[]},"unassigned_count":{"type":"integer","title":"Unassigned Count","default":0}},"type":"object","title":"DealOwnersResponse","description":"Response for ``GET /o2c/deals/owners``.\n\nFeeds the pipeline's owner filter chips: the chip row needs every rep\nwith a deal, not just the ones that happen to be on the current page.\n``unassigned_count`` covers deals with no ``owner_name`` yet so the UI\ncan offer an \"Unassigned\" chip without a second query."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_DealOwnersResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/DealOwnersResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[DealOwnersResponse]"},"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":[]}]}