{"openapi":"3.0.0","info":{"title":"Centrali AI Service API","version":"1.0.0","description":"AI-powered features including natural language search parsing, schema inference, data validation, and anomaly detection.","contact":{"name":"Centrali Support"}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token obtained from the IAM service"}},"schemas":{"def-0":{"type":"object","required":["error","message","status","timestamp","path"],"properties":{"error":{"type":"string","example":"VALIDATION_ERROR","description":"Machine-readable error code"},"message":{"type":"string","example":"Invalid request body","description":"Human-readable error message"},"status":{"type":"integer","example":400,"description":"HTTP status code"},"timestamp":{"type":"string","format":"date-time","example":"2026-03-02T10:00:00.000Z"},"path":{"type":"string","example":"/workspace/my-ws/api/v1/parse-search","description":"Request path"},"requestId":{"type":"string","description":"Optional request ID for tracing"}},"title":"Error"}}},"paths":{"/workspace/{workspaceSlug}/api/v1/infer-schema":{"post":{"tags":["Schema"],"description":"Submit schema inference job for sample JSON data","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["samples"],"properties":{"samples":{"type":"array","description":"Array of sample JSON objects (1-100)","minItems":1,"maxItems":100,"items":{"type":"object"}},"nameHint":{"type":"string","description":"Optional hint for structure name"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"statusUrl":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/jobs/{jobId}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true},{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/workspace/{workspaceSlug}/api/v1/jobs/queue/stats":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workspace/{workspaceSlug}/api/v1/parse-search":{"post":{"tags":["Search"],"description":"Parse natural language search query into Meilisearch filter","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query","schema"],"properties":{"query":{"type":"string","description":"Natural language search query","minLength":1,"maxLength":500},"schema":{"type":"array","description":"Structure field schema for context","items":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","datetime","reference","array","object"]},"required":{"type":"boolean"}}}},"structureSlug":{"type":"string","description":"Optional structure slug for context"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"filter":{"type":"string"},"sort":{"type":"string"},"explanation":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/parse-record":{"post":{"tags":["Record"],"description":"Submit a job to parse natural language text into structured record data","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","schema","structureSlug"],"properties":{"text":{"type":"string","description":"Natural language description of the record to create","minLength":1,"maxLength":2000},"schema":{"type":"array","description":"Structure field schema for mapping","items":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","datetime","reference","array","object"]},"required":{"type":"boolean"}}}},"structureSlug":{"type":"string","description":"Structure slug for context"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"statusUrl":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/parse-record/complete":{"post":{"tags":["Record"],"description":"Complete a partially parsed record by adding clarifications","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["records","clarifications","schema"],"properties":{"records":{"type":"array","description":"Previously parsed record data","items":{"type":"object","properties":{"data":{"type":"object"},"fieldConfidences":{"type":"object"}}}},"clarifications":{"type":"object","description":"User-provided values for missing fields"},"schema":{"type":"array","description":"Structure field schema for validation","items":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","date","datetime","reference","array","object"]},"required":{"type":"boolean"}}}}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"type":"array"},"explanation":{"type":"string"},"overallConfidence":{"type":"string","enum":["high","medium","low"]},"missingFields":{"type":"array"},"isComplete":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/compute/generate":{"post":{"tags":["Compute"],"description":"Generate a new compute function from natural language","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","maxLength":12000},"context":{"type":"object","properties":{"structures":{"type":"array"},"existingFunctions":{"type":"array","items":{"type":"string"}}}},"userId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"statusUrl":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/compute/edit":{"post":{"tags":["Compute"],"description":"Edit an existing compute function based on natural language","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt","currentCode"],"properties":{"prompt":{"type":"string","maxLength":12000},"currentCode":{"type":"string"},"currentName":{"type":"string"},"currentDescription":{"type":"string"},"draftId":{"type":"string"},"context":{"type":"object","properties":{"structures":{"type":"array"},"existingFunctions":{"type":"array","items":{"type":"string"}}}},"userId":{"type":"string"}}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"},"statusUrl":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/compute/active-jobs":{"get":{"tags":["Compute"],"description":"Get active compute AI jobs for session recovery","parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"type":{"type":"string"},"draftId":{"type":"string"},"prompt":{"type":"string"},"createdAt":{"type":"string"},"status":{"type":"string"}}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/compute/active-jobs/{jobId}":{"delete":{"tags":["Compute"],"description":"Dismiss an active job from session tracking","parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true},{"schema":{"type":"string"},"in":"path","name":"jobId","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"dismissed":{"type":"boolean"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/structures/context":{"get":{"tags":["Structures"],"description":"Get structure context for a workspace, trigger rebuild if needed","parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"ready":{"type":"boolean"},"structures":{"type":"array"},"requestId":{"type":"string"},"status":{"type":"string"},"progress":{"type":"object","properties":{"count":{"type":"number"},"total":{"type":"number"}}}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/structures/rebuild-status":{"get":{"tags":["Structures"],"description":"Get the status of a structure index rebuild","parameters":[{"schema":{"type":"string"},"in":"query","name":"requestId","required":true},{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"number"},"total":{"type":"number"},"error":{"type":"string"},"structures":{"type":"array"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/def-0"}}}}}}},"/workspace/{workspaceSlug}/api/v1/validate/scan":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/workspace/{workspaceSlug}/api/v1/validate/scan/{batchId}":{"get":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"workspaceSlug","required":true},{"schema":{"type":"string"},"in":"path","name":"batchId","required":true}],"responses":{"200":{"description":"Default Response"}}}}},"servers":[{"url":"https://api.centrali.io/ai/ai","description":"AI Service API"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Search","description":"Natural language search parsing"},{"name":"Schema","description":"Schema inference from sample data"},{"name":"Validation","description":"AI-powered data validation and batch scanning"},{"name":"Records","description":"Natural language record creation"},{"name":"Compute","description":"AI-assisted compute function generation"},{"name":"Structures","description":"Structure management and AI configuration"},{"name":"Jobs","description":"AI job queue management"}]}