{"openapi":"3.1.0","info":{"title":"GET /api/v1/inventory/import/analyze/{task_id}","version":"1.0.0","description":"Poll analysis status"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/inventory/import/analyze/{task_id}":{"get":{"tags":["inventory:import"],"summary":"Poll analysis status","description":"Returns 'pending', 'completed' (with result), or 'failed'.","operationId":"get_analyze_status_api_v1_inventory_import_analyze__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"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/AnalyzeStatusResponse"}}}},"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":{"AnalyzeResponse":{"properties":{"file_id":{"type":"string","title":"File Id","description":"Temporary ID to reference the cached file."},"sheets":{"items":{"$ref":"#/components/schemas/SheetAnalysis"},"type":"array","title":"Sheets"},"detected_entities":{"$ref":"#/components/schemas/DetectedEntities"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Top-level warnings (e.g. AI analysis returned empty results)."}},"type":"object","required":["file_id"],"title":"AnalyzeResponse","description":"Response from POST /inventory/import/analyze."},"AnalyzeStatusResponse":{"properties":{"status":{"type":"string","enum":["pending","completed","failed"],"title":"Status","default":"pending"},"result":{"anyOf":[{"$ref":"#/components/schemas/AnalyzeResponse"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"AnalyzeStatusResponse","description":"Polling response from GET /analyze/{task_id}."},"ColumnMapping":{"properties":{"column_index":{"type":"integer","title":"Column Index","description":"0-based column index in the sheet."},"column_header":{"type":"string","title":"Column Header","description":"Header text from the source column.","default":""},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"AI confidence score.","default":0.0}},"type":"object","required":["column_index"],"title":"ColumnMapping","description":"AI-detected mapping of a source column to a standard inventory field."},"DetectedEntities":{"properties":{"locations":{"items":{"$ref":"#/components/schemas/DetectedLocation"},"type":"array","title":"Locations"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories"},"products":{"items":{"$ref":"#/components/schemas/DetectedProduct"},"type":"array","title":"Products"}},"type":"object","title":"DetectedEntities"},"DetectedLocation":{"properties":{"name":{"type":"string","title":"Name"},"source_sheets":{"items":{"type":"string"},"type":"array","title":"Source Sheets"},"type":{"type":"string","title":"Type","default":"warehouse"}},"type":"object","required":["name"],"title":"DetectedLocation"},"DetectedProduct":{"properties":{"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"appears_in_sheets":{"type":"integer","title":"Appears In Sheets","default":1},"skus":{"items":{"type":"string"},"type":"array","title":"Skus"}},"type":"object","required":["name"],"title":"DetectedProduct"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SheetAnalysis":{"properties":{"sheet_name":{"type":"string","title":"Sheet Name"},"row_count":{"type":"integer","title":"Row Count","default":0},"recommended":{"type":"boolean","title":"Recommended","default":true},"mapping":{"additionalProperties":{"$ref":"#/components/schemas/ColumnMapping"},"type":"object","title":"Mapping"},"headers":{"items":{"type":"string"},"type":"array","title":"Headers","description":"All column headers parsed from this sheet (for the column picker)."},"data_start_row":{"type":"integer","title":"Data Start Row","description":"1-based row where data begins.","default":2},"exclude_rows":{"items":{"type":"integer"},"type":"array","title":"Exclude Rows"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Warnings such as unresolved formula cells."},"sample_rows":{"items":{"items":{},"type":"array"},"type":"array","title":"Sample Rows"}},"type":"object","required":["sheet_name"],"title":"SheetAnalysis","description":"Per-sheet analysis returned by the AI."},"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":[]}]}