{ "openapi": "3.0.1", "info": { "title": "Sailhouse Public Schema", "description": "", "license": { "name": "MIT" }, "version": "1.0.0" }, "servers": [ { "url": "https://api.sailhouse.dev" } ], "security": [ { "bearerAuth": [], "apiKey": [] } ], "paths": { "/topics/{topic}/events": { "post": { "description": "Posts an event to a topic", "security": [ { "apiKey": [] } ], "parameters": [ { "name": "topic", "in": "path", "description": "The topic to post to", "required": true, "schema": { "type": "string" } } ], "requestBody": { "description": "Event to post", "content": { "application/json": { "schema": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object" }, "metadata": { "type": "object" } } } } }, "required": true }, "responses": { "200": { "description": "Event posted", "content": {} }, "400": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/topics/{topic}/subscriptions/{subscription}/events": { "get": { "description": "Gets events from a subscription", "security": [ { "apiKey": [] } ], "parameters": [ { "name": "topic", "in": "path", "description": "The topic to get events from", "required": true, "schema": { "type": "string" } }, { "name": "subscription", "in": "path", "description": "The subscription to get events from", "required": true, "schema": { "type": "string" } }, { "name": "limit", "in": "query", "description": "The maximum number of events to return", "required": false, "schema": { "type": "integer" } }, { "name": "offset", "in": "query", "description": "The number of events to skip", "required": false, "schema": { "type": "integer" } } ], "responses": { "200": { "description": "Events retrieved", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The event ID" }, "topic_id": { "type": "string", "description": "The ID of the topic the event was posted to" }, "timestamp": { "type": "string", "description": "The timestamp the event was posted" }, "data": { "type": "object", "description": "The data of the event" }, "metadata": { "type": "object", "description": "The metadata of the event" } } } } } } }, "400": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/topics/{topic}/subscriptions/{subscription}/events/pull": { "get": { "description": "Pulls a single unacknowledged event from a pull subscription, and locks it for 30 seconds.", "security": [ { "apiKey": [] } ], "parameters": [ { "name": "topic", "in": "path", "description": "The topic to pull events from", "required": true, "schema": { "type": "string" } }, { "name": "subscription", "in": "path", "description": "The subscription to pull events from", "required": true, "schema": { "type": "string" } }, { "name": "time_window", "in": "query", "description": "The time window for event hydration (e.g. '1h', '30m')", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Event successfully pulled", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "The event ID" }, "topic_id": { "type": "string", "description": "The ID of the topic the event was posted to" }, "timestamp": { "type": "string", "description": "The timestamp the event was posted" }, "data": { "type": "object", "description": "The decrypted data of the event" }, "metadata": { "type": "object", "description": "The metadata of the event" } } } } } }, "204": { "description": "No unacknowledged events available" }, "400": { "description": "Invalid request parameters or subscription type", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized - invalid or missing authentication", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "403": { "description": "Forbidden - app is blocked", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "schemas": { "Error": { "required": [ "error", "message" ], "type": "object", "properties": { "error": { "type": "integer", "format": "int32" }, "message": { "type": "string" } } } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer" }, "apiKey": { "type": "apiKey", "in": "header", "name": "Authorization" } } } }