Jump to API Section Browse ↓

TimesinkDB Living REST API Reference

The TimesinkDB REST API operates strictly over HTTPS (supporting both HTTP/1.1 and HTTP/2 multiplexed connections) and accepts schemaless JSON payloads. All data plane routes are database-scoped under /databases/{databaseId}/* with zero Data Definition Language (DDL) or schema migrations required.

// Zero Ingest Latency

Writes buffer in lock-free memory in sub-millisecond time. NVMe commits occur every 60s (or synchronously with ?requireCommit=true).

// Dynamic Deduplication

Replayed webhooks and cellular retries resolve at query time using monotonic Last-Write-Wins. Zero duplicate rows or index bloat.

// Zero-Egress Visuals

Turnkey HTML widgets and SVG vector charts render server-side for $0.00 egress under fair use. Ideal for customer SaaS portals.

1. Regional Endpoints & Base URLs

TimesinkDB runs storage engines directly against local NVMe volumes within regional compute clusters. Each database is provisioned in a dedicated geographic cloud region for single-digit millisecond latency and clear data residency. Client applications direct requests to the regional base URL corresponding to their database location:

// Canonical Regional URL Anatomy
Standard HTTPS: https://{region}.timesinkdb.com/databases/{databaseId}/*
Hardware mTLS: https://{region}-cert.timesinkdb.com/databases/{databaseId}/*
Send requests to your assigned region's base URL for lowest network latency and zero-hop ingestion.
fra1 (Frankfurt)
Europe West
Cloud Region: germanywestcentral
REST Base: https://fra1.timesinkdb.com
mTLS Base: https://fra1-cert.timesinkdb.com
iad1 (N. Virginia)
US East
Cloud Region: eastus2
REST Base: https://iad1.timesinkdb.com
mTLS Base: https://iad1-cert.timesinkdb.com
nrt1 (Tokyo)
Asia Pacific
Cloud Region: japaneast
REST Base: https://nrt1.timesinkdb.com
mTLS Base: https://nrt1-cert.timesinkdb.com
// Dedicated Nodes & Custom Azure Regions: Dedicated Node plans can be provisioned in any Azure region worldwide (e.g. westus2, swedencentral, uksouth, southeastasia, australiaeast) with isolated host infrastructure, private VNet peering, and custom CNAME routing.

2. Authentication, Credentials & mTLS

TimesinkDB authenticates requests via Bearer tokens passed in the standard HTTP Authorization header (or query parameter for embeds), or via mutual TLS client certificates on dedicated mTLS hostnames:

// 1. Secret Ingestion Key (Database-Scoped or Account-Scoped)
Authorization: Bearer sec_live_09f4b7a7019842a... or Bearer sec_acc_81b3c...
Database-scoped keys (sec_live_...) authenticate against the target database in the URL. Account-scoped keys (sec_acc_...) permit access to any database owned by the customer account. Use exclusively in secure backend runtimes.
// 2. Scoped Read-Only Token (Visual Embeds & Public Queries)
Authorization: Bearer tok_ro_81a4e2c079214b9... or ?token=tok_ro_81a4e2c...
Safe for browser iframe embeds and dashboards. Restricted to query and visual projection endpoints (.svg, .html); strictly blocks ingestion and write operations.
// 3. Zero-Secret Hardware mTLS (Dedicated Hostnames)
Endpoint: https://fra1-cert.timesinkdb.com/databases/{databaseId}/*
Hardware-bound client certificates registered with your database. Bypasses token rotation and bearer credential leaks for IoT gateways and microcontrollers.

3. Telemetry Metering & Capacity Pooling

TimesinkDB charges $0.00 in write API fees (no HTTP transaction fees, indexing surcharges, or request units). Usage reflects pure tiered NVMe storage, outbound query egress, and parallel query workers:

// Telemetry Metering (Zero Per-Write Ingest Fees)
Ingested Bytes • Synchronous stored binary volume
Egressed JSON Bytes • Raw uncompressed response body bytes
Writing telemetry is 100% free ($0.00 API transaction fee). Accounts operate under Account-Level Capacity Pooling with free multi-database splitting and a strict spend cap ($0 surprise overage).
// Capacity Napkin Math: 16 Bytes per Point Invariant Zero Guesswork

Numeric telemetry is stored as fixed 16-byte records (8-byte timestamp + 8-byte IEEE 754 double) arranged in contiguous columnar pages. There is zero compression guesswork or block-rounding padding: 1 GB storage = exactly 62,500,000 points. Raw JSON events (?mode=blob) store an 8-byte timestamp + 4-byte length prefix + raw UTF-8 bytes (12 + N bytes).

Sample Cadence Points / Sensor / Day Points / Sensor / Month (30d) Storage / Sensor / Month 100 Sensors / Month
1 sample / 10 min 144 4,320 ~69 KB ~6.9 MB
1 sample / 1 min 1,440 43,200 ~691 KB ~69.1 MB
1 sample / 10 sec 8,640 259,200 ~4.15 MB ~415 MB
1 sample / 1 sec (1 Hz) 86,400 2,592,000 ~41.5 MB ~4.15 GB
10 samples / sec (10 Hz) 864,000 25,920,000 ~414.7 MB ~41.5 GB

4. Zero-Driver HTTP Client Snippets

Zero Dependencies

TimesinkDB operates over standard HTTPS with pure UTF-8 JSON. Standard fetch() or your favorite HTTP client is all you need:

Production Runtime Quickstarts
const TSDB_URL = "https://fra1.timesinkdb.com/databases/42";
const TSDB_TOKEN = process.env.TIMESINKDB_KEY;

// 1. Ingest telemetry point
await fetch(`${TSDB_URL}/series/services.auth.latency_ms`, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${TSDB_TOKEN}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ value: 14.8, route: "/login", status: 200 })
});

// 2. Query downsampled 1-hour average buckets
const res = await fetch(`${TSDB_URL}/query?seriesKey=services.auth.latency_ms&from=-24h&interval=1h&fn=avg`, {
  headers: { "Authorization": `Bearer ${TSDB_TOKEN}` }
});
const { buckets } = await res.json();

Interactive API Request Simulator

Live Wire Sandbox

Test TimesinkDB HTTP requests directly in your browser. Inspect wire payloads, simulated response round-trips, and formatted JSON responses.

Request Configuration
POST https://fra1.timesinkdb.com/databases/42/ingest
Headers
Authorization: Bearer sec_live_09f4b7a7019842a...
Content-Type: application/json
JSON Payload Body
[
  {
    "seriesKey": "fleet.sensor-a.temp",
    "ts": 1788624900000,
    "value": 42.8
  },
  {
    "seriesKey": "fleet.sensor-b.speed",
    "ts": 1788624900000,
    "value": 88.5
  }
]
Simulated Wire Response
202 Accepted 1.8 ms
Response Headers
content-type: application/json; charset=utf-8
Response JSON Body
{
  "status": "accepted",
  "ingestedBytes": 32,
  "pointsIngested": 2
}
POST /databases/{databaseId}/series/{seriesKey}

High-performance scoped ingestion endpoint supporting versatile structured extraction and raw event storage modes:

  • extract (Default): Nested JSON numeric properties are flattened into dot-delimited columnar metric streams.
  • blob: Stores the entire raw UTF-8 JSON payload verbatim as an immutable event record under the series key.
  • blobArray: Treats the request body JSON array as multiple distinct blob events.
  • both: Dual persistence. Flattens numeric fields while preserving raw JSON payload verbatim.
  • bothArray: Applies dual persistence across each item in a JSON array.
Parameter In Type Description
databaseId Path integer Unique database identifier (e.g. 42).
seriesKey Path string Destination series key or namespace prefix up to 256 characters. Dots represent hierarchy.
mode Query string Ingestion mode: extract (default), blob, blobArray, both, or bothArray.
requireCommit Query boolean Optional (Pro+). When true, commits data synchronously to persistent NVMe before returning HTTP 200 OK (Zero RPO). Default is 202 Accepted.
Request Payload
{
  "ts": "2026-09-05T19:15:00.000Z",
  "usage": 84.2,
  "core": {
    "temp": 68.4,
    "frequency": 3400
  }
}
Response (202 Accepted)
{
  "status": "accepted",
  "ingestedBytes": 48,
  "pointsIngested": 3
}
POST /databases/{databaseId}/ingest

High-throughput batch ingest endpoint for dispatchers, edge aggregators, and proxy workers. Accepts a top-level JSON array of envelope items without artificial object wrappers (up to 5,000 items per request).

Batch Ingest Request Payload
[
  {
    "seriesKey": "fleet.sensor-a",
    "ts": 1788624900000,
    "value": { "temp": 21.8, "humidity": 45.2 }
  },
  {
    "seriesKey": "fleet.sensor-b",
    "ts": "2026-09-08T00:15:00Z",
    "value": { "temp": 23.1, "pressure": 101.3 }
  }
]
Standard Response (202 Accepted)
{
  "status": "accepted",
  "ingestedBytes": 64,
  "pointsIngested": 4
}
GUIDE

Series Keys, Escaping & Transport Safety

TimesinkDB guarantees that telemetry ingestion always succeeds as long as the payload is valid JSON. Upstream systems (IoT firmware, Kubernetes exporters, Stripe webhooks) never face rejection due to unconventional property naming.

Hierarchy Traversal vs. Literal Dot Escaping

In extract mode, unescaped dots (.) represent object depth hierarchy. Literal dots within property keys are escaped deterministically:

{"server": {"cpu": 80}} → server.cpu
{"network": {"eth0.1": 100}} → network.eth0\.1
Arbitrary Key Fidelity (Slashes, Spaces, Unicode)

Characters outside the standard metric set are preserved verbatim in the series catalog up to 256 characters:

{"disk/sda1": 45.2} → disk/sda1
{"sensors": {"room temp": 21.0}} → sensors.room temp
POST /databases/{databaseId}/webhooks/{webhookKey}
View Webhook Playbooks →

Turnkey webhook adapter that accepts raw HTTP webhook deliveries directly from third-party platforms (Stripe, GitHub, Shopify, Clerk) with zero intermediate glue code, lambdas, or queues. TimesinkDB verifies HMAC signatures at the edge and handles duplicate deliveries via monotonic Last-Write-Wins deduplication.

See the comprehensive Turnkey Webhook Playbooks Guide for copy-paste integration recipes for Stripe MRR, GitHub CI durations, Shopify GMV velocity, and custom HMAC signatures.
GET /databases/{databaseId}/series

Lists registered series keys and their assigned storage types for the database, or retrieves specific series data directly via the key query parameter.

Response (200 OK)
{
  "count": 2,
  "maxSeries": 65000,
  "series": [
    { "seriesKey": "fleet.sensor-a.temp", "type": "numeric" },
    { "seriesKey": "fleet.audit.logs", "type": "blob" }
  ]
}
GET /databases/{databaseId}/series/{seriesKey}[.json|.svg|.html|.csv]

Canonical endpoint for retrieving time-series data and multi-representation projections. Automatically distinguishes between instant constant-time latest point lookups and temporal range queries based on parameter presence:

  • O(1) Latest Point Retrieval (Default when from is omitted): Returns the most recent point in sub-millisecond time.
  • Chronological Range Query (When from is specified): Streams historical records over the specified time range.
  • Multi-Representation Projections: Append an extension (.svg, .html, .csv, .json) to render directly.
O(1) Latest Point (GET /databases/42/series/{key})
{
  "seriesKey": "fleet.sensor-a.temp",
  "type": "numeric",
  "ts": 1788624900000,
  "value": 21.8
}
Historical Range (GET /databases/42/series/{key}?from=-1h)
{
  "seriesKey": "fleet.sensor-a.temp",
  "count": 2,
  "points": [
    { "ts": 1788624900000, "value": 21.8 },
    { "ts": 1788621300000, "value": 21.2 }
  ]
}
POST | GET /databases/{databaseId}/query

Executes hardware-accelerated downsampling, multi-series joins, and mathematical expressions across raw points. Deduplication is resolved dynamically over matching series chunks.

Query Body (POST)
{
  "range": { "from": "-1h", "to": "now" },
  "interval": "15m",
  "queries": [
    {
      "id": "q1",
      "seriesKey": "fleet.*.temp",
      "field": "celsius",
      "fn": "avg"
    }
  ]
}
Downsampled Response (200 OK)
{
  "interval": "15m",
  "timestamps": [
    1788620400000,
    1788621300000
  ],
  "results": {
    "q1": {
      "values": [23.4, 24.1]
    }
  }
}
Ergonomic GET Query Format
GET /databases/42/query?seriesKey=fleet.*.temp&from=-1h&to=now&interval=15m&fn=avg
PROJ /databases/{databaseId}/query[.json|.svg|.html|.csv]
View Visual Embeds Guide →

Analytical queries can be projected directly into turnkey interactive visualizations or tabular export streams for Notion, GitHub READMEs, internal admin dashboards, and spreadsheet workflows.

Extension Content-Type Description
.svg image/svg+xml Clean vector line chart. Parameters: from, interval, theme, token.
.html text/html Turnkey responsive HTML iframe widget with hover tooltips and dynamic metric stats.
.csv text/csv RFC 4180 comma-separated values stream for spreadsheet import.
.json application/json Standard structured downsampling result.
GET | PUT /databases/{databaseId}/retention/rules

Inspects (GET) or configures (PUT) granular retention lifetimes per series pattern at day granularity (e.g. 30d, 365d). Default infinite retention preserves data until manually purged. Rules run daily in the background and apply retroactively without locks.

Configure Rule Request (PUT) / Response (200 OK)
{
  "rules": [
    { "pattern": "fleet.ephemeral.*", "retention": "30d" },
    { "pattern": "fleet.audit.*", "retention": "365d" }
  ]
}
PORTAL

Database Provisioning & Management Portal

Database lifecycle management, capacity partitioning, and API key generation are coordinated by the central TimesinkDB control plane.

Database Partition Credentials & Connectivity

Every TimesinkDB database operates as an isolated physical partition with dedicated NVMe storage and compute workers. To interact with the data plane REST API, you need three values:

Database ID 42 Numeric partition identifier
API Secret Key sec_live_9a7f2... Bearer token with write/read scopes
Regional Endpoint fra1.timesinkdb.com Nearest low-latency host node
Verify Node Liveness
curl -i https://fra1.timesinkdb.com/ping
Current Prelaunch Early Access Provisioning:

During the active prelaunch phase, databases and API keys are provisioned directly upon waitlist reservation or by emailing support@timesinkdb.com with your chosen region (fra1 Frankfurt, iad1 Virginia, or nrt1 Tokyo). Automated 1-click self-serve web management launches with general commercial availability in October 2026.

LIMITS

Engine Invariants & Enforced Limits

Hardware-enforced guardrails and architectural boundaries designed to guarantee deterministic single-digit millisecond latency:

Boundary Limit Behavior When Exceeded
Max Single Write Payload 10 MB Rejects immediately with HTTP 413 PayloadTooLarge.
Batch Ingest Envelope Limit 5,000 items Capped at 5,000 items per batch HTTP POST (/ingest).
SIMD Query Scan Chunks 65,536 pts (1 MB) Decoupled async I/O enables scans of millions of points without RAM spikes.
Series Catalog Quota 65,000 series Points and events appended to each named series are unlimited up to provisioned storage capacity.
JSON Decomposition Depth 5 levels Flattens up to 5 nested levels into metric streams; deeper levels remain raw JSON events.
Query Execution Timeout 4,000 ms Analytical scans exceeding 4.0 seconds return HTTP 408 QueryTimeoutExceeded.
Storage Quota Cap (Spend Cap) 100% Provisioned Default Strict Spend Cap rejects writes with 422 StorageQuotaExceeded (alerts at 80% & 90%). Read queries continue with 0% downtime.
PLANS

Plan Architectural Tiers & Technical Capabilities

Technical comparison of concurrency gates, persistence modes, network isolation, and feature availability. For commercial pricing, refer to the Pricing Catalog.

Technical Dimension Free Sandbox Starter Pro Scale Dedicated Node
Database Topology 1 Sandbox DB (Shared) 1 Dedicated DB Multi-DB (Up to 6 DBs) Multi-DB (Up to 12 DBs) Multi-DB (Unlimited DBs)
Account Concurrency Pool 1 Query Worker 4 Query Workers 12 Query Workers 24 Query Workers Uncapped Concurrency
Ingestion Persistence Async memory buffer (auto-flushed to disk every 60s) Async memory buffer (auto-flushed to disk every 60s) Async + Direct NVMe Commit (?requireCommit=true) Async + Direct NVMe Commit (?requireCommit=true) Async + Direct NVMe Commit (?requireCommit=true)
Authentication Schemes Secret API Key, Read-Only Token Secret API Key, Read-Only Token API Key, Account Key, Read Token API/Account Keys + Hardware mTLS Certs API/Account Keys + Hardware mTLS Certs
Visual Embeds (.html, .svg) Attributed ("Powered by") Attributed ("Powered by") Whitelabel (No watermark) + CSS Themes Whitelabel + CSS Themes + Custom CNAME Full Whitelabel + Custom Hostname
GET /healthz • /ready • /ping

Unauthenticated operational probes used by load balancers, container orchestrators, and latency checkers.

  • GET /healthz: Liveness probe returning 200 OK if API host process is alive.
  • GET /ready: Readiness probe returning 200 OK if instance manager is ready to serve traffic (or 503 during shutdown).
  • GET /ping: Minimal overhead latency ping returning plain text pong.

5. Error Codes & RFC 7807 Problem Details

All error responses follow the standard RFC 7807 problem details specification.

Status Code Name Condition
400 Bad Request InvalidPayload Payload failed JSON parsing or contained malformed series keys, data types, or intervals.
401 Unauthorized InvalidToken Bearer secret token is missing, expired, or invalid.
403 Forbidden FeatureNotPermitted Requested feature (e.g. requireCommit=true requires Pro+) is not permitted on this account plan tier, or a write operation was attempted using a scoped read-only token (tok_ro_...).
404 Not Found NotFound The requested series key, webhook key, or administrative resource was not found.
408 Request Timeout QueryTimeoutExceeded Analytical query took longer than the hard limit of 4.0 seconds. Shorten the range or increase the interval.
413 Payload Too Large InvalidPayload Ingestion payload size exceeded 10 MB limit.
422 Unprocessable SeriesQuotaExceeded Database exceeded maximum registered series quota (65,000 series per database).
422 Unprocessable StorageQuotaExceeded Configured database reached 100% of provisioned storage under Strict Spend Cap mode.
422 Unprocessable TypeMismatch Series data type conflicts with existing registered series schema.
429 Too Many Requests ConcurrencyLimitExceeded Parallel query worker queue capacity was exceeded or timed out while awaiting an available query worker slot. Consider upgrading worker concurrency or optimizing query intervals.