{"openapi":"3.1.0","info":{"title":"Hostiaa API","version":"2025-02-10","description":"Public API for Hostiaa — the operations OS for short-term-rental concierges. A single capability router (`POST /data-hub`) exposes the AI capabilities (operations, communication, sales, finance, security, identity, IoT, data). Authenticate with a Bearer/`X-API-Key` key; responses use a success/error envelope.\n\n**Versioning.** The API is versioned in the URL path (`/api/v1`) and by a date-based `X-API-Version` header (current `2025-02-10`). Requests without the header use the current version.\n\n**Deprecation policy.** Breaking changes ship under a new version. A deprecated version or endpoint is announced at least 6 months ahead via the `Deprecation` and `Sunset` response headers (RFC 8594) and the changelog at https://www.hostiaa.com/developers; it keeps working until the `Sunset` date.\n\n**Rate limits.** Responses carry the `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` and `RateLimit-Policy` headers; a `429` response adds `Retry-After`.","contact":{"name":"Hostiaa API","email":"api@hostiaa.fr","url":"https://www.hostiaa.com/developers"},"license":{"name":"Proprietary","url":"https://www.hostiaa.com/terms"}},"servers":[{"url":"https://www.hostiaa.com/api/v1","description":"Production"}],"security":[{"apiKeyAuth":[]},{"bearerAuth":[]}],"tags":[{"name":"Capabilities","description":"Discover and invoke AI capabilities."}],"paths":{"/capabilities":{"get":{"tags":["Capabilities"],"operationId":"listCapabilities","summary":"List available capabilities","description":"Returns the live catalogue of capabilities (id, description, category, access level, required params). Public — no authentication required.","security":[],"responses":{"200":{"description":"The capability catalogue.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimitPolicy"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityList"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Error"}}}},"/data-hub":{"post":{"tags":["Capabilities"],"operationId":"invokeCapability","summary":"Invoke a capability","description":"Executes one capability for the authenticated account. Pass the capability id and its parameters. Use a key prefixed `hosti_test_` for sandbox (mock) responses. Supports `Idempotency-Key` and `X-API-Version` headers.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Up to 255 chars. Identical replays return the cached response for 24h.","schema":{"type":"string","maxLength":255}},{"name":"X-API-Version","in":"header","required":false,"description":"Pin the API version (default 2025-02-10).","schema":{"type":"string","default":"2025-02-10"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityRequest"}}}},"responses":{"200":{"description":"The capability result.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimitPolicy"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilitySuccess"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Your Hostiaa API key (`hosti_...`, or `hosti_test_...` for sandbox)."},"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Alternatively, a Supabase user JWT as `Authorization: Bearer <jwt>`."}},"headers":{"RateLimitLimit":{"description":"Request budget for the current window.","schema":{"type":"integer"}},"RateLimitRemaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"RateLimitReset":{"description":"Seconds until the window resets.","schema":{"type":"integer"}},"RateLimitPolicy":{"description":"The quota policy, e.g. `120;w=60`.","schema":{"type":"string"}},"RetryAfter":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"Deprecation":{"description":"Present when the endpoint is deprecated (RFC 8594).","schema":{"type":"string"}},"Sunset":{"description":"Date after which a deprecated endpoint may stop working (RFC 8594).","schema":{"type":"string"}}},"responses":{"Error":{"description":"A structured error envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"RateLimited":{"description":"Too many requests — the rate limit was exceeded.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimitPolicy"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"CapabilityRequest":{"type":"object","required":["capability"],"properties":{"capability":{"type":"string","description":"The capability to invoke.","enum":["operations.auto_assign","operations.quality_vision","operations.invoice_parser","communication.ghost_writer","communication.translate","communication.welcome_booklet","sales.optimize_listing","sales.upsell","sales.marketplace_ai","security.guest_risk","security.parse_booking_email","assistant.chat","finance.hostiscore","finance.marketplace_pricing","data.performance_metrics","ai.feedback","ai.emit_event","iot.ingest_event","identity.verify_hostiaa_id","identity.generate_hostiaa_id","data.weather_forecast","data.transport_disruptions","monitoring.hub_health","monitoring.capability_stats"]},"params":{"type":"object","description":"Capability-specific parameters. See GET /capabilities for required params.","additionalProperties":true},"source":{"type":"string","description":"Free-text caller label, for your own audit trail.","default":"api"}}},"CapabilityList":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","required":["capabilities","total"],"properties":{"capabilities":{"type":"array","items":{"$ref":"#/components/schemas/Capability"}},"total":{"type":"integer"}}},"meta":{"$ref":"#/components/schemas/Meta"}}},"CapabilitySuccess":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","description":"Capability-specific result.","additionalProperties":true},"usage":{"type":"object","properties":{"capability":{"type":"string"},"response_time_ms":{"type":"integer"},"access_level":{"type":"string"},"remaining_quota":{"type":["integer","null"]},"cache_hit":{"type":"boolean"}}},"meta":{"$ref":"#/components/schemas/Meta"}}},"ErrorResponse":{"type":"object","required":["success","error"],"description":"Returned for every non-2xx response. `code` is a machine-readable slug on proxy-level errors.","properties":{"success":{"const":false},"error":{"type":"string","description":"Human-readable error message."},"code":{"type":"string","description":"Machine-readable error code on proxy-level errors (e.g. invalid_request, payload_too_large, rate_limited, upstream_unavailable)."},"meta":{"$ref":"#/components/schemas/Meta"}}},"Meta":{"type":"object","properties":{"api_version":{"type":"string"},"test_mode":{"type":"boolean"},"request_id":{"type":"string"},"idempotent_replay":{"type":"boolean"}}},"Capability":{"type":"object","required":["id","description","category","access","required_params"],"properties":{"id":{"type":"string","example":"communication.translate"},"description":{"type":"string"},"category":{"type":"string"},"access":{"type":"string","enum":["read","read+assign","read+suggest","draft","alert-only"]},"required_params":{"type":"array","items":{"type":"string"}}}}}}}