{"openapi":"3.0.0","info":{"title":"Centrali Search Service API","version":"1.0.0","description":"API documentation for the Centrali Search Service - Full-text search powered by Meilisearch for records and content."},"servers":[{"url":"https://api.centrali.io/search/ws/{workspaceSlug}/api/v1","description":"Workspace-scoped Search API","variables":{"workspaceSlug":{"default":"demo","description":"The workspace slug"}}}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"SearchResult":{"type":"object","properties":{"hits":{"type":"array","items":{"type":"object"}},"query":{"type":"string"},"processingTimeMs":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"estimatedTotalHits":{"type":"integer"}}},"Index":{"type":"object","properties":{"uid":{"type":"string"},"primaryKey":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"status":{"type":"integer"},"error":{"type":"string"},"message":{"type":"string"}}}}},"security":[{"bearerAuth":[]}],"tags":[{"name":"Search","description":"Search operations"},{"name":"Indexes","description":"Search index management"},{"name":"Health","description":"Service health"}],"paths":{"/health":{"get":{"summary":"Health check","tags":["Health"],"security":[],"responses":{"200":{"description":"Service healthy"},"503":{"description":"Service unhealthy"}}}},"/version":{"get":{"summary":"Get service version","tags":["Health"],"security":[],"responses":{"200":{"description":"Service version information"}}}},"/search":{"post":{"summary":"Search records","tags":["Search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"q":{"type":"string","description":"Search query"},"structure_slug":{"type":"string","description":"Structure to search in"},"limit":{"type":"integer","default":20},"offset":{"type":"integer","default":0},"filter":{"type":"string","description":"Filter expression"},"sort":{"type":"array","items":{"type":"string"}},"facets":{"type":"array","items":{"type":"string"}},"attributesToRetrieve":{"type":"array","items":{"type":"string"}},"attributesToHighlight":{"type":"array","items":{"type":"string"}}},"required":["q"]}}}},"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}},"400":{"description":"Invalid search query"}}}},"/search/multi":{"post":{"summary":"Search across multiple structures","tags":["Search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"queries":{"type":"array","items":{"type":"object","properties":{"structure_slug":{"type":"string"},"q":{"type":"string"},"limit":{"type":"integer"}}}}}}}}},"responses":{"200":{"description":"Multi-search results"}}}},"/indexes":{"get":{"summary":"List search indexes","tags":["Indexes"],"responses":{"200":{"description":"List of indexes"}}}},"/indexes/{structure_slug}":{"get":{"summary":"Get index for structure","tags":["Indexes"],"parameters":[{"name":"structure_slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Index details"},"404":{"description":"Index not found"}}},"post":{"summary":"Create or update index for structure","tags":["Indexes"],"parameters":[{"name":"structure_slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"searchableAttributes":{"type":"array","items":{"type":"string"}},"filterableAttributes":{"type":"array","items":{"type":"string"}},"sortableAttributes":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Index created/updated"}}},"delete":{"summary":"Delete index for structure","tags":["Indexes"],"parameters":[{"name":"structure_slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Index deleted"}}}},"/indexes/{structure_slug}/documents":{"post":{"summary":"Index documents","tags":["Indexes"],"parameters":[{"name":"structure_slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"documents":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"202":{"description":"Documents queued for indexing"}}},"delete":{"summary":"Delete documents from index","tags":["Indexes"],"parameters":[{"name":"structure_slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"202":{"description":"Documents queued for deletion"}}}},"/reindex/{structure_slug}":{"post":{"summary":"Trigger full reindex for structure","tags":["Indexes"],"parameters":[{"name":"structure_slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"Reindex started"}}}}}}