{ "openapi": "3.0.3",
"info": {
"title": "O-Base REST API",
"version": "1.0.0",
"description": "Isomorphic RAM-first NoSQL database with AST-MD and JSON
support."
},
"servers": [ {
"url": "http://localhost:3001",
"description": "O-Base Worker Instance"
}
],
"paths": {
"/api/_meta/collections": {
"get": {
"summary": "List all collections",
"description": "Returns an array of all active collection names in the
database.",
"responses": {
"200": {
"description": "List of collections",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": { "type": "string" }
} } } } } }
},
"/api/{collection}": {
"get": {
"summary": "Get or search a collection",
"description": "Returns all objects in a collection. You can filter by
appending any object key as a query parameter (e.g. ?status=aktiivinen).",
"parameters": [
{
"name": "collection",
"in": "path",
"required": true,
"schema": { "type": "string" }
},
{
"name": "_limit",
"in": "query",
"description": "Maximum number of records to return",
"schema": { "type": "integer" }
}
],
"responses": {
"200": {
"description": "Collection data",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": { "type": "object" }
}
},
"text/markdown": {
"schema": { "type": "string" }
} } } } }
},
"/api/{collection}/{id}": {
"get": {
"summary": "Get a specific object",
"parameters": [
{ "name": "collection", "in": "path", "required": true, "schema": {
"type": "string" } },
{ "name": "id", "in": "path", "required": true, "schema": { "type":
"string" } }
],
"responses": {
"200": {
"description": "The object",
"content": {
"application/json": {
"schema": { "type": "object" }
} } } }
},
"put": {
"summary": "Create or replace an object",
"parameters": [
{ "name": "collection", "in": "path", "required": true, "schema": {
"type": "string" } },
{ "name": "id", "in": "path", "required": true, "schema": { "type":
"string" } }
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "type": "object" }
} }
},
"responses": {
"200": { "description": "Success" }
}
},
"patch": {
"summary": "Partially update an object",
"parameters": [
{ "name": "collection", "in": "path", "required": true, "schema": {
"type": "string" } },
{ "name": "id", "in": "path", "required": true, "schema": { "type":
"string" } }
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": { "type": "object" }
} }
},
"responses": {
"200": { "description": "Success" }
}
},
"delete": {
"summary": "Delete an object",
"parameters": [
{ "name": "collection", "in": "path", "required": true, "schema": {
"type": "string" } },
{ "name": "id", "in": "path", "required": true, "schema": { "type":
"string" } }
],
"responses": {
"200": { "description": "Success" }
} }
},
"/api/sync": {
"post": {
"summary": "Ingest AST-MD text",
"requestBody": {
"required": true,
"content": {
"text/markdown": {
"schema": { "type": "string" }
} }
},
"responses": {
"200": { "description": "Data synced" }
} }
},
"/api/admin/compact": {
"post": {
"summary": "Trigger background compaction",
"responses": {
"200": { "description": "Compaction started" }
} } } }}