Appearance
Litebase HTTP API
Litebase provides three main endpoint groups: Storage, Stream, and Namespace. Each endpoint group serves a specific purpose in managing and processing your data.
Endpoints
Storage
Storage provides a reliable and scalable way to store and retrieve Record - immutable key-value pair.
- Bulk Write - Write multiple records in a single request
- Bulk Read - Read multiple records in a single request
- Get - Get a single record
- Set - Set a single record
- Delete - Delete a single record
Stream
Stream is an append-only log that maintains ordered sequence of events with real-time subscription capability.
- Commit - Write new event to stream
- Get - Get a single event by transaction ID
- List - List events in a range
- SSE - Subscribe to stream events in real-time
Namespaces
Namespace is an isolated container for Storage or Stream data.
- List - List all namespaces of specified type
- Create - Create a new namespace
- Get - Get information about a specific namespace
- Delete - Delete a namespace and all its data
Auth
The HTTP API expects an API Key to be passed in the Authorization header using Bearer scheme. You can create and revoke tokens in Litebase Dashboard.
sh
curl --location 'https://api.litebase.io/v4/namespace/storage' \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Content-Type: application/json'Error
On error, all APIs will return Problem JSON as response:
json
HTTP/1.1 400 Bad Request
Content-Type: application/problem+json
{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}