{"openapi":"3.1.0","info":{"title":"NYA Interior Design Software API","version":"1.0.0","description":"The current public API for authenticated NYA workspace project and lead operations.","contact":{"name":"NYA support","email":"idan@nyainteriors.com","url":"https://nyainteriors.com/contact"}},"servers":[{"url":"https://nyainteriors.com"}],"security":[{"BearerAuth":[]}],"tags":[{"name":"Projects","description":"Workspace project operations"},{"name":"Leads","description":"Workspace lead operations"}],"paths":{"/api/v1/projects":{"get":{"tags":["Projects"],"operationId":"listProjects","summary":"List workspace projects","responses":{"200":{"description":"Projects available to the authenticated workspace","content":{"application/json":{"schema":{"type":"object","required":["projects"],"properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}}}}}},"400":{"description":"Invalid JSON or rejected input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Projects"],"operationId":"createProject","summary":"Create a workspace project","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1},"client_name":{"type":"string"},"address":{"type":"string"}}}}}},"responses":{"201":{"description":"Project created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"400":{"description":"Invalid JSON or rejected input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/leads":{"get":{"tags":["Leads"],"operationId":"listLeads","summary":"List workspace leads","responses":{"200":{"description":"Leads available to the authenticated workspace","content":{"application/json":{"schema":{"type":"object","required":["leads"],"properties":{"leads":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}}}}}}},"400":{"description":"Invalid JSON or rejected input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Leads"],"operationId":"createLead","summary":"Create a workspace lead","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string"},"phone":{"type":"string"},"project_type":{"type":"string"},"budget":{"type":"number"},"notes":{"type":"string","maxLength":4000},"source":{"type":"string","enum":["website","houzz","referral","other"],"default":"other"}}}}}},"responses":{"201":{"description":"Lead created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"400":{"description":"Invalid JSON or rejected input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"NYA API and Clipper token copied from the workspace Settings page."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Project":{"type":"object","description":"A project record returned by the authenticated workspace.","required":["id","name","client_name","stage","status","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"client_name":{"type":["string","null"]},"stage":{"type":["string","null"]},"status":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"}}},"Lead":{"type":"object","description":"A lead record returned by the authenticated workspace.","required":["id","name","email","phone","stage","source","project_type","budget_high","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"stage":{"type":["string","null"]},"source":{"type":["string","null"]},"project_type":{"type":["string","null"]},"budget_high":{"type":["number","null"]},"created_at":{"type":"string","format":"date-time"}}},"MutationResult":{"type":"object","required":["ok","id"],"properties":{"ok":{"const":true},"id":{"type":"string","format":"uuid"}}}}}}