{"openapi":"3.1.0","info":{"title":"POST /api/v1/dashboards/models/import","version":"1.0.0","description":"Import a reference workbook as a model plan"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/dashboards/models/import":{"post":{"tags":["dashboards"],"summary":"Import a reference workbook as a model plan","description":"Parse an uploaded .xlsx into a draft model and return it for review. **Nothing is persisted** — the importer cannot know which ledgers feed the workbook's data rows, and guessing would produce a model that renders a clean grid of wrong numbers. The response carries a `confidence` score, the sheets skipped as raw data exports, and the formulas that could not be translated, so the caller can resolve them before calling `/models/build`.","operationId":"import_model_workbook_api_v1_dashboards_models_import_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"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_model_workbook_api_v1_dashboards_models_import_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_ImportWorkbookResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"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":{"Body_import_model_workbook_api_v1_dashboards_models_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"title":{"type":"string","title":"Title","default":""}},"type":"object","required":["file"],"title":"Body_import_model_workbook_api_v1_dashboards_models_import_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImportWorkbookResponse":{"properties":{"draft_id":{"type":"string","title":"Draft Id"},"plan":{"additionalProperties":true,"type":"object","title":"Plan"},"headline":{"type":"string","title":"Headline","default":""},"confidence":{"type":"number","title":"Confidence","default":0.0},"skipped_sheets":{"items":{"type":"string"},"type":"array","title":"Skipped Sheets"},"unresolved":{"items":{"type":"string"},"type":"array","title":"Unresolved"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"additionalProperties":false,"type":"object","required":["draft_id"],"title":"ImportWorkbookResponse","description":"A plan derived from an uploaded reference workbook.\n\nCarries the importer's own honesty fields so the caller can show what was\nskipped or could not be translated, rather than presenting a partial\nimport as a complete one."},"SuccessEnvelope_ImportWorkbookResponse_":{"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/ImportWorkbookResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ImportWorkbookResponse]"},"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":[]}]}