{"openapi":"3.1.0","info":{"title":"File Display API","version":"1.0.0","description":"Comprehensive REST API for File Display — submit reports, manage webhooks, run anomaly detection, perform semantic search, control the AI agent, manage custom tools, schedule recurring reports, export data, and execute batch operations.","contact":{"name":"File Display Support","url":"https://filedisplay.com"},"license":{"name":"Proprietary"}},"servers":[{"url":"{baseUrl}","description":"Your File Display instance","variables":{"baseUrl":{"default":"https://filedisplay.com"}}}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Reports","description":"Submit, track, download, and analyze reports"},{"name":"Analytics","description":"Historical report analytics by tool"},{"name":"Webhooks","description":"Manage webhook endpoints, test, and view deliveries"},{"name":"Anomalies","description":"Anomaly detection, listing, and management"},{"name":"Search","description":"Semantic natural language search"},{"name":"Agent","description":"AI agent chat, streaming, memory, and settings"},{"name":"Tools","description":"Custom HTML/JS tools with versioning and data persistence"},{"name":"Filters","description":"AI analysis context filters per tool"},{"name":"Schedules","description":"Recurring report schedules (cron or interval)"},{"name":"Export","description":"Bulk data export (JSON/CSV)"},{"name":"Batch","description":"Execute multiple API operations in one request"},{"name":"Files","description":"Browse and download stored files"},{"name":"Activity","description":"Team activity feed"}],"paths":{"/api/v1/reports":{"get":{"tags":["Reports"],"summary":"List reports","operationId":"listReports","parameters":[{"$ref":"#/components/parameters/toolFilter"},{"name":"status","in":"query","schema":{"type":"string"}},{"$ref":"#/components/parameters/limit100"},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"List of reports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportSummary"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Reports"],"summary":"Submit a report","operationId":"submitReport","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tool"],"properties":{"tool":{"type":"string","description":"Tool ID (e.g. forklift, picker)"},"file_name":{"type":"string"},"file_type":{"type":"string","enum":["csv","xlsx","json"]},"data":{"type":"string","description":"Base64-encoded file or JSON data"},"files":{"type":"array","items":{"type":"object","properties":{"file_name":{"type":"string"},"file_type":{"type":"string"},"data":{"type":"string"}},"required":["file_name","data"]},"description":"Multi-file mode"},"metadata":{"type":"object"},"idempotency_key":{"type":"string"},"sync":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Report completed (sync)"},"202":{"description":"Report accepted (async)"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"description":"Processing failed"}}}},"/api/v1/reports/{id}":{"get":{"tags":["Reports"],"summary":"Get report status","operationId":"getReport","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Report details"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/reports/{id}/download":{"get":{"tags":["Reports"],"summary":"Download processed report","operationId":"downloadReport","parameters":[{"$ref":"#/components/parameters/id"},{"name":"format","in":"query","schema":{"type":"string","enum":["binary","base64"],"default":"binary"}}],"responses":{"200":{"description":"File content"},"400":{"description":"Report not completed"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/reports/analyze":{"post":{"tags":["Reports"],"summary":"Generate AI analysis","operationId":"analyzeReport","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tool","data"],"properties":{"tool":{"type":"string"},"data":{"type":"string","description":"Report content (raw or base64)"},"is_base64":{"type":"boolean","default":false},"context_filter":{"type":"string"},"report_date":{"type":"string","format":"date"},"date_range_start":{"type":"string","format":"date"},"date_range_end":{"type":"string","format":"date"},"send_email":{"type":"boolean","default":true},"email_recipients":{"type":"array","items":{"type":"string","format":"email"}},"include_data_preview":{"type":"boolean","default":false},"metadata":{"type":"object"}}}}}},"responses":{"200":{"description":"Analysis completed"},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/api/v1/analytics":{"get":{"tags":["Analytics"],"summary":"Get historical analytics","operationId":"getAnalytics","parameters":[{"name":"tool","in":"query","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer","default":30,"maximum":365}},{"name":"include_test","in":"query","schema":{"type":"boolean","default":false}},{"name":"limit","in":"query","schema":{"type":"integer","default":100,"maximum":500}},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"Analytics data"},"400":{"description":"Missing or invalid tool"}}}},"/api/v1/activity":{"get":{"tags":["Activity"],"summary":"Get activity feed","operationId":"getActivity","parameters":[{"$ref":"#/components/parameters/toolFilter"},{"name":"action","in":"query","schema":{"type":"string"}},{"name":"user_id","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"days","in":"query","schema":{"type":"integer","default":7,"maximum":90}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"Activity feed"}}}},"/api/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","operationId":"listWebhooks","description":"Requires `webhooks` feature (Starter+).","parameters":[{"$ref":"#/components/parameters/limit100"},{"$ref":"#/components/parameters/offset"},{"name":"active","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"List of webhooks with available events"}}},"post":{"tags":["Webhooks"],"summary":"Create webhook","operationId":"createWebhook","description":"Returns the signing secret (shown only once). Requires `webhooks:manage` permission.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","url"],"properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["report.created","report.completed","report.failed","api_key.created","api_key.revoked"]},"default":["report.completed"]},"description":{"type":"string"},"tool_filter":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"timeout_seconds":{"type":"integer","default":30},"max_retries":{"type":"integer","default":3}}}}}},"responses":{"201":{"description":"Webhook created (includes secret)"},"409":{"description":"Max webhooks reached for tier"}}}},"/api/v1/webhooks/{id}":{"get":{"tags":["Webhooks"],"summary":"Get webhook details","operationId":"getWebhook","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Webhook with stats and recent deliveries"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Webhooks"],"summary":"Update webhook","operationId":"updateWebhook","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"tool_filter":{"type":"string"},"headers":{"type":"object"},"timeout_seconds":{"type":"integer"},"max_retries":{"type":"integer"},"description":{"type":"string"},"is_active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Webhook updated"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Webhooks"],"summary":"Delete webhook","operationId":"deleteWebhook","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Webhook deleted"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send test event","operationId":"testWebhook","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Test result with response code and timing"},"502":{"description":"Delivery failed"}}}},"/api/v1/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List webhook deliveries","operationId":"listWebhookDeliveries","parameters":[{"$ref":"#/components/parameters/id"},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"$ref":"#/components/parameters/offset"},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Delivery history"}}}},"/api/v1/anomalies":{"get":{"tags":["Anomalies"],"summary":"List anomalies","operationId":"listAnomalies","description":"Requires `ai_analysis` feature (Starter+).","parameters":[{"$ref":"#/components/parameters/toolFilter"},{"name":"severity","in":"query","schema":{"type":"string","enum":["low","medium","high","critical"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["new","acknowledged","dismissed"]}},{"name":"days","in":"query","schema":{"type":"integer","default":7,"maximum":90}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"$ref":"#/components/parameters/offset"},{"name":"stats","in":"query","schema":{"type":"boolean","default":false},"description":"Include aggregate stats"}],"responses":{"200":{"description":"Anomaly list with optional stats"}}},"patch":{"tags":["Anomalies"],"summary":"Acknowledge or dismiss anomaly","operationId":"updateAnomaly","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["anomaly_id","action"],"properties":{"anomaly_id":{"type":"string","format":"uuid"},"action":{"type":"string","enum":["acknowledge","dismiss"]},"notes":{"type":"string"}}}}}},"responses":{"200":{"description":"Anomaly updated"}}}},"/api/v1/anomalies/detect":{"post":{"tags":["Anomalies"],"summary":"Run anomaly detection","operationId":"detectAnomalies","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tool","metrics","report_date"],"properties":{"tool":{"type":"string"},"metrics":{"type":"array","items":{"type":"object","required":["employeeName","metricName","value"],"properties":{"employeeName":{"type":"string"},"metricName":{"type":"string"},"value":{"type":"number"}}}},"report_date":{"type":"string","format":"date"},"report_id":{"type":"string","format":"uuid"},"notify":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Detected anomalies"}}}},"/api/v1/search":{"post":{"tags":["Search"],"summary":"Semantic search","operationId":"semanticSearch","description":"Natural language search across reports and analyses. Requires `semantic_search` feature (Pro+).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","maxLength":2000},"tool_filter":{"type":"array","items":{"type":"string"}},"limit":{"type":"integer","default":10,"maximum":50},"similarity_threshold":{"type":"number","default":0.5,"minimum":0,"maximum":1}}}}}},"responses":{"200":{"description":"Search results with similarity scores"}}}},"/api/v1/search/history":{"get":{"tags":["Search"],"summary":"Search history","operationId":"getSearchHistory","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"Past search queries"}}}},"/api/v1/agent":{"post":{"tags":["Agent"],"summary":"Chat with AI agent","operationId":"chatAgent","description":"Send a message to the AI agent. Returns full response (non-streaming). Requires `ai_analysis` feature (Starter+).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"conversationHistory":{"type":"array","items":{"type":"object"},"default":[]}}}}}},"responses":{"200":{"description":"Agent response with text, UI, tool calls, memory updates"}}}},"/api/v1/agent/stream":{"post":{"tags":["Agent"],"summary":"Stream AI agent response","operationId":"streamAgent","description":"Returns NDJSON stream of real-time agent events (text chunks, tool calls, memory updates).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string","maxLength":10000},"conversationHistory":{"type":"array","items":{"type":"object"},"default":[]},"session_id":{"type":"string"}}}}}},"responses":{"200":{"description":"NDJSON stream","content":{"application/x-ndjson":{"schema":{"type":"string"}}}}}}},"/api/v1/agent/memory":{"get":{"tags":["Agent"],"summary":"List agent memory","operationId":"listAgentMemory","parameters":[{"name":"category","in":"query","schema":{"type":"string","enum":["insight","pattern","preference","context","correction"]}},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"Memory entries with stats"}}},"post":{"tags":["Agent"],"summary":"Add memory entry","operationId":"addAgentMemory","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["category","content"],"properties":{"category":{"type":"string","enum":["insight","pattern","preference","context","correction"]},"content":{"type":"string"},"importance":{"type":"integer","default":3},"source_ref":{"type":"string"}}}}}},"responses":{"201":{"description":"Memory entry created"}}},"delete":{"tags":["Agent"],"summary":"Delete memory entry","operationId":"deleteAgentMemory","parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Memory entry deleted"}}}},"/api/v1/agent/settings":{"get":{"tags":["Agent"],"summary":"Get agent settings","operationId":"getAgentSettings","responses":{"200":{"description":"Agent configuration"}}},"put":{"tags":["Agent"],"summary":"Update agent settings","operationId":"updateAgentSettings","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["settings"],"properties":{"settings":{"type":"object","properties":{"enabled_data_sources":{"type":"array","items":{"type":"string"}},"enabled_roles":{"type":"array","items":{"type":"string"}},"memory_retention_days":{"type":"integer"},"max_memory_entries":{"type":"integer"},"auto_summarize":{"type":"boolean"},"auto_email_digest":{"type":"boolean"},"digest_recipients":{"type":"array","items":{"type":"string"}},"digest_day_of_week":{"type":"string"},"custom_instructions":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Settings updated"}}}},"/api/v1/tools":{"get":{"tags":["Tools"],"summary":"List custom tools","operationId":"listTools","description":"Requires `ai_analysis` feature (Starter+).","parameters":[{"$ref":"#/components/parameters/limit100"},{"$ref":"#/components/parameters/offset"},{"name":"visibility","in":"query","schema":{"type":"string","enum":["private","shared","all"],"default":"all"}}],"responses":{"200":{"description":"List of tools"}}},"post":{"tags":["Tools"],"summary":"Create custom tool","operationId":"createTool","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","code"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string","default":"🔧"},"color":{"type":"string","default":"violet"},"code":{"type":"string","description":"HTML/CSS/JS code"},"is_public":{"type":"boolean","default":false}}}}}},"responses":{"201":{"description":"Tool created with v1 version"}}}},"/api/v1/tools/{id}":{"get":{"tags":["Tools"],"summary":"Get tool details","operationId":"getTool","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Tool with code and version count"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Tools"],"summary":"Update tool","operationId":"updateTool","description":"Auto-creates a new version if code changes.","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"icon":{"type":"string"},"color":{"type":"string"},"code":{"type":"string"},"is_public":{"type":"boolean"},"skip_version":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Tool updated (with new version if code changed)"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Tools"],"summary":"Delete tool","operationId":"deleteTool","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Tool deleted"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/tools/{id}/versions":{"get":{"tags":["Tools"],"summary":"List tool versions","operationId":"listToolVersions","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Version history"}}},"post":{"tags":["Tools"],"summary":"Create tool version","operationId":"createToolVersion","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"label":{"type":"string"},"set_as_default":{"type":"boolean","default":true}}}}}},"responses":{"201":{"description":"Version created"}}}},"/api/v1/tools/{id}/data":{"get":{"tags":["Tools"],"summary":"Read tool data","operationId":"getToolData","parameters":[{"$ref":"#/components/parameters/id"},{"name":"key","in":"query","schema":{"type":"string"},"description":"Specific key (omit for all)"}],"responses":{"200":{"description":"Tool data entries"}}},"post":{"tags":["Tools"],"summary":"Write tool data","operationId":"setToolData","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"key":{"type":"string","default":"_default"},"data":{}}}}}},"responses":{"200":{"description":"Data saved"}}},"delete":{"tags":["Tools"],"summary":"Delete tool data","operationId":"deleteToolData","parameters":[{"$ref":"#/components/parameters/id"},{"name":"key","in":"query","schema":{"type":"string"},"description":"Specific key (omit to delete all)"}],"responses":{"200":{"description":"Data deleted"}}}},"/api/v1/tools/generate":{"post":{"tags":["Tools"],"summary":"AI-generate tool code and host it","operationId":"generateTool","description":"Generates HTML/CSS/JS code from a prompt, auto-saves it as a custom tool, and returns a live public URL. The tool is immediately accessible at the share_url.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","maxLength":5000,"description":"Natural language description of the tool to build"},"needs_backend":{"type":"boolean","default":false,"description":"Enable ToolAPI data persistence (cloud save/load)"}}}}}},"responses":{"200":{"description":"Generated tool with live URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"code":{"type":"string","description":"Generated HTML/CSS/JS code"},"complexity":{"type":"string","enum":["simple","medium","complex"]},"passes":{"type":"array","items":{"type":"string"},"description":"AI generation phases used"},"needs_backend":{"type":"boolean"},"tool_id":{"type":"string","format":"uuid","description":"UUID of the saved custom tool"},"share_url":{"type":"string","format":"uri","description":"Public URL where the tool is live (e.g. https://filedisplay.com/t/abc123xyz456)"}}}}}}}}}}},"/api/v1/filters":{"get":{"tags":["Filters"],"summary":"List AI filters","operationId":"listFilters","description":"Requires `ai_analysis` feature (Starter+).","parameters":[{"$ref":"#/components/parameters/toolFilter"}],"responses":{"200":{"description":"Active filters"}}},"post":{"tags":["Filters"],"summary":"Create or update filter","operationId":"upsertFilter","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tool","filter_prompt"],"properties":{"tool":{"type":"string"},"filter_prompt":{"type":"string"}}}}}},"responses":{"200":{"description":"Filter updated"},"201":{"description":"Filter created"}}},"delete":{"tags":["Filters"],"summary":"Delete filter","operationId":"deleteFilter","parameters":[{"name":"tool","in":"query","schema":{"type":"string"}},{"name":"id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Filter deleted"}}}},"/api/v1/filters/changelog":{"get":{"tags":["Filters"],"summary":"Filter change history","operationId":"getFilterChangelog","parameters":[{"$ref":"#/components/parameters/toolFilter"},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200}},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"Changelog entries"}}}},"/api/v1/schedules":{"get":{"tags":["Schedules"],"summary":"List schedules","operationId":"listSchedules","description":"Requires `batch_uploads` feature (Pro+).","parameters":[{"name":"active","in":"query","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/toolFilter"},{"$ref":"#/components/parameters/limit100"},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"List of schedules"}}},"post":{"tags":["Schedules"],"summary":"Create schedule","operationId":"createSchedule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","tool"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"tool":{"type":"string"},"cron":{"type":"string","description":"5-field cron (minute hour day month weekday)"},"timezone":{"type":"string","default":"UTC"},"interval_seconds":{"type":"integer","minimum":300,"maximum":2592000,"description":"Alternative to cron (5 min – 30 days)"},"payload":{"type":"object"}}}}}},"responses":{"201":{"description":"Schedule created"}}}},"/api/v1/schedules/{id}":{"get":{"tags":["Schedules"],"summary":"Get schedule with run history","operationId":"getSchedule","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Schedule details with recent jobs"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Schedules"],"summary":"Update schedule","operationId":"updateSchedule","parameters":[{"$ref":"#/components/parameters/id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"cron":{"type":"string"},"timezone":{"type":"string"},"interval_seconds":{"type":"integer"},"is_active":{"type":"boolean"},"payload":{"type":"object"}}}}}},"responses":{"200":{"description":"Schedule updated"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"tags":["Schedules"],"summary":"Delete schedule","operationId":"deleteSchedule","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Schedule deleted"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/export":{"get":{"tags":["Export"],"summary":"List exports","operationId":"listExports","description":"Requires `ai_analysis` feature (Starter+).","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":20,"maximum":100}},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"Export job list"}}},"post":{"tags":["Export"],"summary":"Request data export","operationId":"createExport","description":"Small datasets (<1000 rows) return synchronously. Large datasets create a background job (HTTP 202).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tool"],"properties":{"tool":{"type":"string"},"format":{"type":"string","enum":["json","csv"],"default":"json"},"days":{"type":"integer","default":30,"maximum":365},"include_analyses":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Export data (sync)"},"202":{"description":"Export job started (async)"}}}},"/api/v1/export/{id}":{"get":{"tags":["Export"],"summary":"Get export status","operationId":"getExport","parameters":[{"$ref":"#/components/parameters/id"}],"responses":{"200":{"description":"Export status and result (if completed)"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/batch":{"post":{"tags":["Batch"],"summary":"Batch operations","operationId":"batchOperations","description":"Execute multiple API operations in parallel. Max 50 (Pro) / 500 (Enterprise). Requires `batch_uploads` feature (Pro+).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["operations"],"properties":{"operations":{"type":"array","items":{"type":"object","required":["method","path"],"properties":{"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"]},"path":{"type":"string","description":"API path (e.g. /api/v1/reports)"},"body":{"type":"object"}}}}}}}}},"responses":{"200":{"description":"Array of results with summary counts"}}}},"/api/v1/ai/chat":{"post":{"tags":["Agent"],"summary":"AI chat completion","operationId":"aiChatCompletion","description":"Gateway-backed completion endpoint for AI bundle keys. Supports structured patch responses.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"messages":{"type":"array","items":{"type":"object"}},"model":{"type":"string"},"temperature":{"type":"number","minimum":0,"maximum":2},"max_tokens":{"type":"integer","minimum":1,"maximum":8192},"request_type":{"type":"string","description":"Usage labeling, e.g. chat/rewrite/explain"},"response_format":{"type":"string","enum":["text","patch"],"default":"text"}}}}}},"responses":{"200":{"description":"AI completion response"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/v1/ai/chat/stream":{"post":{"tags":["Agent"],"summary":"AI chat stream","operationId":"aiChatStream","description":"Returns NDJSON stream events: start, delta, done.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"messages":{"type":"array","items":{"type":"object"}},"model":{"type":"string"},"request_type":{"type":"string"}}}}}},"responses":{"200":{"description":"NDJSON stream","content":{"application/x-ndjson":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/api/v1/files":{"get":{"tags":["Files"],"summary":"List files","operationId":"listFiles","parameters":[{"name":"type","in":"query","schema":{"type":"string","enum":["input","output"]}},{"$ref":"#/components/parameters/toolFilter"},{"name":"days","in":"query","schema":{"type":"integer","default":30,"maximum":365}},{"$ref":"#/components/parameters/limit100"},{"$ref":"#/components/parameters/offset"}],"responses":{"200":{"description":"File list"}}}},"/api/v1/files/{id}":{"get":{"tags":["Files"],"summary":"Download file","operationId":"getFile","parameters":[{"$ref":"#/components/parameters/id"},{"name":"format","in":"query","schema":{"type":"string","enum":["binary","base64"],"default":"binary"}}],"responses":{"200":{"description":"File content"},"404":{"$ref":"#/components/responses/NotFound"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key with `fd_live_` or `fd_test_` prefix"}},"parameters":{"id":{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"offset":{"name":"offset","in":"query","schema":{"type":"integer","default":0}},"limit100":{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":100}},"toolFilter":{"name":"tool","in":"query","schema":{"type":"string"},"description":"Filter by tool ID"}},"schemas":{"Pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"has_more":{"type":"boolean"}}},"ReportSummary":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"tool":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","failed"]},"created_at":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}},"responses":{"BadRequest":{"description":"Invalid request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Insufficient permissions or feature not available for tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Rate limit exceeded. Check X-RateLimit-* headers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}