Complete REST API reference for HeliosDB-Lite Cloud - featuring time-travel queries, database branching, vector search, and encryption.
HeliosDB-Lite Cloud provides a powerful PostgreSQL-compatible API with advanced features:
/api/v1/auth/signup/api/v1/auth/login to receive a JWT tokenHeliosDB-Lite Cloud is a next-generation database platform that extends PostgreSQL compatibility with powerful features for modern applications.
Query historical data at any point in time using AS OF TIMESTAMP, AS OF TRANSACTION, or AS OF SCN clauses.
Create isolated database branches for development, testing, or experimentation without duplicating storage.
Native VECTOR type with built-in similarity search for AI/ML applications and semantic search.
Multiple encryption modes to protect your data with industry-standard encryption algorithms.
All API endpoints are relative to:
https://cloud.heliosdb.com/api/v1
HeliosDB-Lite Cloud uses JWT (JSON Web Tokens) for authentication. Include the token in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN
Creates a new organization and user account. No authentication required.
| Field | Type | Required | Description |
|---|---|---|---|
| organization_name | string | Yes | Name of your organization (2-100 chars) |
| username | string | Yes | Your username (3-50 chars) |
| string | Yes | Valid email address | |
| password | string | Yes | Password (min 8 chars) |
curl -X POST "https://cloud.heliosdb.com/api/v1/auth/signup" \
-H "Content-Type: application/json" \
-d '{
"organization_name": "My Company",
"username": "admin_user",
"email": "admin@example.com",
"password": "securepassword123"
}'
Authenticate and receive a JWT token.
curl -X POST "https://cloud.heliosdb.com/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "admin@example.com",
"password": "securepassword123"
}'
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 86400,
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "admin@example.com",
"username": "admin_user",
"role": "admin"
},
"organization": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "My Company"
}
}
}
All API responses follow a consistent JSON format:
{
"success": true,
"data": { ... },
"timestamp": "2026-01-04T10:30:00Z"
}
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired token"
},
"timestamp": "2026-01-04T10:30:00Z"
}
| HTTP Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Invalid request parameters |
| 401 | UNAUTHORIZED | Missing or invalid authentication |
| 403 | FORBIDDEN | Insufficient permissions |
| 404 | NOT_FOUND | Resource not found |
| 409 | CONFLICT | Resource already exists |
| 422 | VALIDATION_ERROR | Request validation failed |
| 429 | RATE_LIMITED | Too many requests |
| 500 | INTERNAL_ERROR | Server error |
Execute standard SQL operations against your databases using the execute endpoint.
Execute a SQL statement against the database.
| Field | Type | Required | Description |
|---|---|---|---|
| sql | string | Yes | SQL statement to execute |
Create a new table with columns and constraints.
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name VARCHAR(100) NOT NULL,
email VARCHAR(200) UNIQUE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
status VARCHAR(20) DEFAULT 'active'
);
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "CREATE TABLE users (id INTEGER PRIMARY KEY, name VARCHAR(100) NOT NULL, email VARCHAR(200) UNIQUE)"
}'
Insert single or multiple rows into a table.
-- Single row insert
INSERT INTO users (id, name, email)
VALUES (1, 'John Doe', 'john@example.com');
-- Multiple rows insert
INSERT INTO users (id, name, email) VALUES
(2, 'Jane Smith', 'jane@example.com'),
(3, 'Bob Wilson', 'bob@example.com'),
(4, 'Alice Brown', 'alice@example.com');
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql": "INSERT INTO users (id, name, email) VALUES (1, '\''John Doe'\'', '\''john@example.com'\'')"}'
Query data with filtering, sorting, and pagination.
-- Basic select
SELECT * FROM users;
-- With WHERE clause
SELECT id, name, email
FROM users
WHERE status = 'active' AND created_at > '2026-01-01';
-- With ORDER BY and LIMIT
SELECT * FROM users
ORDER BY created_at DESC
LIMIT 10 OFFSET 0;
-- Aggregations with GROUP BY
SELECT status, COUNT(*) AS count
FROM users
GROUP BY status
HAVING COUNT(*) > 5;
{
"success": true,
"data": {
"columns": ["id", "name", "email", "created_at"],
"rows": [
[1, "John Doe", "john@example.com", "2026-01-01T00:00:00Z"],
[2, "Jane Smith", "jane@example.com", "2026-01-02T00:00:00Z"]
],
"row_count": 2,
"execution_time_ms": 5
}
}
Modify existing rows in a table.
UPDATE users
SET email = 'newemail@example.com',
status = 'updated'
WHERE id = 1;
Remove rows from a table.
DELETE FROM users
WHERE status = 'inactive'
AND created_at < '2025-01-01';
Combine data from multiple tables. Supports INNER JOIN, LEFT JOIN, RIGHT JOIN, and CROSS JOIN with table aliases and qualified column names.
-- INNER JOIN with table aliases
SELECT u.name, o.product, o.price
FROM users u
INNER JOIN orders o ON u.id = o.user_id
WHERE o.status = 'completed';
-- LEFT JOIN
SELECT u.name, COUNT(o.id) AS order_count
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
GROUP BY u.id, u.name;
-- Multi-table JOIN
SELECT p.name AS product, c.name AS category
FROM products p
JOIN product_categories pc ON p.id = pc.product_id
JOIN categories c ON pc.category_id = c.id
ORDER BY p.name;
-- CROSS JOIN (cartesian product)
SELECT * FROM colors CROSS JOIN sizes;
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/query" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql": "SELECT p.name, c.name FROM products p JOIN product_categories pc ON p.id = pc.product_id JOIN categories c ON pc.category_id = c.id"}'
SELECT * FROM users
WHERE id IN (
SELECT DISTINCT user_id
FROM orders
WHERE price > 100
);
Execute parameterized queries for better security against SQL injection.
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/query" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT * FROM users WHERE email = $1 AND status = $2",
"params": ["john@example.com", "active"]
}'
HeliosDB-Lite maintains a complete history of all changes, allowing you to query data as it existed at any point in time.
Query data as it existed at a specific timestamp.
-- Query users table as of a specific timestamp
SELECT * FROM users
AS OF TIMESTAMP '2026-01-01 12:00:00';
-- Query with timezone
SELECT * FROM users
AS OF TIMESTAMP '2026-01-01 12:00:00 UTC';
-- Query using interval (1 hour ago)
SELECT * FROM users
AS OF TIMESTAMP (CURRENT_TIMESTAMP - INTERVAL '1 hour');
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT * FROM users AS OF TIMESTAMP '\''2026-01-01 12:00:00'\''"
}'
Query data as it existed after a specific transaction completed.
-- Query data after transaction ID 12345
SELECT * FROM orders
AS OF TRANSACTION 12345;
-- Useful for auditing specific changes
SELECT id, amount, status
FROM payments
AS OF TRANSACTION 98765
WHERE status = 'processed';
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT * FROM orders AS OF TRANSACTION 12345"
}'
Query data at a specific system change number for precise point-in-time recovery.
-- Query at a specific SCN
SELECT * FROM inventory
AS OF SCN 1000000;
-- Get current SCN
SELECT CURRENT_SCN();
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT * FROM inventory AS OF SCN 1000000"
}'
# Get current SCN
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql": "SELECT CURRENT_SCN()"}'
Query all versions of rows that existed between two points in time.
-- Get all versions of a product between two timestamps
SELECT * FROM products
VERSIONS BETWEEN TIMESTAMP '2026-01-01 00:00:00'
AND TIMESTAMP '2026-01-02 00:00:00'
WHERE id = 1;
-- Returns all versions of the row including:
-- - Original inserted values
-- - Each update that occurred in the time range
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/query" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql": "SELECT * FROM products VERSIONS BETWEEN TIMESTAMP '\''2026-01-01 00:00:00'\'' AND TIMESTAMP '\''2026-01-02 00:00:00'\'' WHERE id = 1"}'
Track all changes to sensitive data with complete history of who changed what and when.
Recover accidentally deleted or modified data by querying historical versions.
Investigate issues by viewing database state at the time a bug occurred.
Meet regulatory requirements for data retention and change tracking.
Use time-travel queries with INSERT to restore deleted data:
-- Restore accidentally deleted user
INSERT INTO users (id, name, email, created_at)
SELECT id, name, email, created_at
FROM users AS OF TIMESTAMP '2026-01-01 11:59:00'
WHERE id = 42;
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "INSERT INTO users (id, name, email) SELECT id, name, email FROM users AS OF TIMESTAMP '\''2026-01-01 11:59:00'\'' WHERE id = 42"
}'
Create isolated copies of your database for development, testing, or experimentation without duplicating storage.
Create a new branch from the current database at a specific point in time.
-- Create a branch at current state
CREATE DATABASE BRANCH dev_branch
AS OF NOW;
-- Create a branch at a specific timestamp
CREATE DATABASE BRANCH testing_branch
AS OF TIMESTAMP '2026-01-01 00:00:00';
-- Create a branch at a specific SCN
CREATE DATABASE BRANCH debug_branch
AS OF SCN 50000;
-- Create a branch at a specific transaction
CREATE DATABASE BRANCH feature_xyz
AS OF TRANSACTION 12345;
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "CREATE DATABASE BRANCH dev_branch AS OF NOW"
}'
-- List branches via REST API
GET /api/v1/organizations/{org_id}/databases
# List all databases including branches
curl -X GET "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases" \
-H "Authorization: Bearer YOUR_TOKEN"
After creating a branch, it appears as a separate database that you can query independently.
-- Query the branch database
SELECT * FROM dev_branch.users;
-- Or connect to the branch database directly via the API
-- using the branch database ID
Merge changes from a branch back into the main database.
-- Merge branch into main (fast-forward if possible)
MERGE DATABASE BRANCH dev_branch
INTO main;
-- Merge feature branch into main
MERGE DATABASE BRANCH feature_branch
INTO main;
# Merge branch into main
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "MERGE DATABASE BRANCH dev_branch INTO main"
}'
-- Delete a branch (frees copy-on-write storage)
DROP DATABASE BRANCH dev_branch;
-- Force delete (even if branch has uncommitted changes)
DROP DATABASE BRANCH dev_branch FORCE;
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "DROP DATABASE BRANCH dev_branch"
}'
Give each developer their own database branch with real production data for realistic testing.
Create ephemeral branches for each pull request to run integration tests.
Test schema changes on a branch before applying them to production.
Create branches to experiment with data changes without affecting production.
-- 1. Create a feature branch at current state
CREATE DATABASE BRANCH feature_new_schema
AS OF NOW;
-- 2. Make changes on the branch
INSERT INTO users (id, name) VALUES (100, 'Test User');
-- 3. Test the changes
SELECT * FROM users LIMIT 10;
-- 4. If tests pass, merge back into main
MERGE DATABASE BRANCH feature_new_schema
INTO main;
-- 5. Clean up
DROP DATABASE BRANCH feature_new_schema;
Native support for vector embeddings with built-in similarity search for AI/ML applications.
Store high-dimensional vectors for embeddings, feature vectors, and more.
-- Create a table with a vector column
CREATE TABLE documents (
id INTEGER PRIMARY KEY,
title VARCHAR(200),
content TEXT,
embedding VECTOR(1536) -- OpenAI ada-002 dimension
);
-- Create table for image embeddings
CREATE TABLE images (
id INTEGER PRIMARY KEY,
filename VARCHAR(255),
embedding VECTOR(512) -- CLIP embedding dimension
);
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "CREATE TABLE documents (id INTEGER PRIMARY KEY, title VARCHAR(200), content TEXT, embedding VECTOR(1536))"
}'
-- Insert a vector as an array
INSERT INTO documents (id, title, embedding)
VALUES (
1,
'Introduction to AI',
'[0.1, 0.2, 0.3, ...]'::VECTOR(1536)
);
-- Insert using array syntax
INSERT INTO documents (id, title, embedding)
VALUES (
2,
'Machine Learning Basics',
ARRAY[0.15, 0.25, 0.35, ...]
);
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "INSERT INTO documents (id, title, embedding) VALUES (1, '\''Test Doc'\'', '\''[0.1, 0.2, 0.3, 0.4, 0.5]'\''::VECTOR(5))"
}'
Find similar vectors using built-in distance functions.
-- Cosine similarity search (higher is more similar)
SELECT
id,
title,
COSINE_SIMILARITY(embedding, '[0.1, 0.2, ...]') AS similarity
FROM documents
ORDER BY similarity DESC
LIMIT 10;
-- Euclidean distance search (lower is more similar)
SELECT
id,
title,
L2_DISTANCE(embedding, '[0.1, 0.2, ...]') AS distance
FROM documents
ORDER BY distance ASC
LIMIT 10;
-- Using vector operators
SELECT id, title, embedding <-> '[0.1, 0.2, ...]' AS l2_dist FROM documents; -- L2 distance
SELECT id, title, embedding <=> '[0.1, 0.2, ...]' AS cos_dist FROM documents; -- Cosine distance
# Search for similar documents using cosine similarity
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT id, title, COSINE_SIMILARITY(embedding, '\''[0.1, 0.2, 0.3, 0.4, 0.5]'\'') AS similarity FROM documents ORDER BY similarity DESC LIMIT 10"
}'
| Function | Description | Best For |
|---|---|---|
| COSINE_SIMILARITY(a, b) | Cosine similarity (0 to 1, higher is more similar) | Text embeddings, normalized vectors |
| COSINE_DISTANCE(a, b) | Cosine distance (0 to 2, lower is more similar) | Text embeddings |
| L2_DISTANCE(a, b) | Euclidean distance (lower is more similar) | Image embeddings, geographic data |
| EUCLIDEAN_DISTANCE(a, b) | Alias for L2_DISTANCE | Image embeddings |
| INNER_PRODUCT(a, b) | Inner product distance | Pre-normalized vectors |
| Operator | Description |
|---|---|
| a <-> b | L2 (Euclidean) distance |
| a <=> b | Cosine distance |
Create indexes for faster similarity search on large datasets.
-- HNSW index (SQLite style)
CREATE INDEX documents_embedding_idx
ON documents(embedding) USING hnsw;
-- HNSW index (PostgreSQL/pgvector style)
CREATE INDEX documents_embedding_idx
ON documents USING hnsw(embedding vector_l2_ops);
-- IVFFLAT index
CREATE INDEX documents_embedding_ivf
ON documents USING ivfflat(embedding vector_cosine_ops);
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "CREATE INDEX documents_embedding_idx ON documents(embedding) USING hnsw"
}'
Build intelligent search that understands meaning, not just keywords.
Find similar products, articles, or content based on embedding similarity.
Retrieval-Augmented Generation for LLMs using vector similarity.
Find visually similar images using CLIP or other image embeddings.
-- 1. Create documents table with embeddings
CREATE TABLE knowledge_base (
id INTEGER PRIMARY KEY,
content TEXT,
embedding VECTOR(1536)
);
-- 2. Create HNSW index for fast similarity search
CREATE INDEX kb_embedding_idx ON knowledge_base(embedding) USING hnsw;
-- 3. Insert documents with embeddings
INSERT INTO knowledge_base (id, content, embedding)
VALUES (
1,
'HeliosDB supports time-travel queries',
'[0.1, 0.2, 0.3, ...]'
);
-- 4. Search for similar documents
SELECT
id,
content,
COSINE_SIMILARITY(embedding, '[0.1, 0.2, ...]') AS relevance
FROM knowledge_base
ORDER BY relevance DESC
LIMIT 5;
# 1. Create knowledge base table
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql": "CREATE TABLE knowledge_base (id INTEGER PRIMARY KEY, content TEXT, embedding VECTOR(5))"}'
# 2. Create HNSW index for fast search
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql": "CREATE INDEX kb_embedding_idx ON knowledge_base(embedding) USING hnsw"}'
# 3. Insert document with embedding (embedding from your ML model)
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "INSERT INTO knowledge_base (id, content, embedding) VALUES (1, '\''HeliosDB supports time-travel queries'\'', '\''[0.1, 0.2, 0.3, 0.4, 0.5]'\'')"
}'
# 4. Search for relevant documents
curl -X POST "https://cloud.heliosdb.com/api/v1/organizations/{org_id}/databases/{db_id}/execute" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sql": "SELECT id, content, COSINE_SIMILARITY(embedding, '\''[0.1, 0.2, 0.3, 0.4, 0.5]'\'') AS relevance FROM knowledge_base ORDER BY relevance DESC LIMIT 5"
}'
HeliosDB-Lite provides multiple encryption modes to protect your data at rest and in transit.
Encrypt entire databases with AES-256-GCM. All data, indexes, metadata, and version history are encrypted at rest using Transparent Data Encryption (TDE).
Encrypt specific tables containing sensitive data while keeping others unencrypted for performance.
Encrypt individual columns (e.g., SSN, credit card numbers) with per-column keys.
Encrypt data before it leaves your application. HeliosDB never sees unencrypted data (Zero-Knowledge mode).
-- Create an encrypted database
CREATE DATABASE secure_db
WITH (
encryption = 'AES-256',
key_management = 'managed' -- or 'customer-managed'
);
-- Create a table with encrypted columns
CREATE TABLE customers (
id INTEGER PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(200),
ssn VARCHAR(11) ENCRYPTED,
credit_card VARCHAR(20) ENCRYPTED
);
-- Enable encryption on existing table
ALTER TABLE users
SET (encryption = TRUE);
-- Encrypt specific column
ALTER TABLE users
ALTER COLUMN ssn SET ENCRYPTED;
| Option | Description |
|---|---|
| Managed Keys | HeliosDB manages encryption keys automatically with secure key rotation |
| Customer-Managed Keys (BYOK) | Bring your own keys from AWS KMS, Google Cloud KMS, or Azure Key Vault |
| Hardware Security Module (HSM) | Keys stored in FIPS 140-2 Level 3 certified HSMs |
Encryption features are designed to help meet compliance requirements for:
HELIOSDB_ENCRYPTION_KEY) or a key file to enable database-level encryption.
HeliosDB-Lite Cloud API v1 - Last updated: 2026-01-06