Public API Beta
This page documents API v1 (/api/v1, Beta). The older single endpoint POST /api/ingest has its own page: /docs. The two use different keys.
Push a table (CSV, TSV, JSON, NDJSON or XML) and read back deterministic insights. Every number is computed by code. No call on this page uses AI or the shared AI quota.
5-minute quickstart
Sign in, then create a key below. Use a sandbox key first: it runs the same calculations but stores nothing. The key is shown once.
# sandbox key: same calculations, nothing is stored curl -X POST "https://calerio.wazayef-callcenter.workers.dev/api/v1/results?pack=retail&name=Quickstart" \ -H "Authorization: Bearer cal_test_YOUR_KEY" \ -H "Content-Type: text/csv" \ -H "Idempotency-Key: quickstart-0001" \ --data-binary $'date,customer,item,qty,amount,status\n2026-01-05,Mina,Cable,2,100,unpaid\n2026-02-05,Omar,Case,1,250,paid'
curl "https://calerio.wazayef-callcenter.workers.dev/api/v1/results/sbx_sample/insights" \ -H "Authorization: Bearer cal_test_YOUR_KEY" # with a live key use the id returned by step 2: /api/v1/results//insights
import json, urllib.request, urllib.error
KEY = "cal_test_YOUR_KEY" # or cal_live_...
BASE = "https://calerio.wazayef-callcenter.workers.dev/api/v1"
def call(method, path, body=None, ctype="application/json"):
data = body.encode() if isinstance(body, str) else body
req = urllib.request.Request(BASE + path, data=data, method=method,
headers={"Authorization": "Bearer " + KEY, "Content-Type": ctype,
"User-Agent": "calerio-quickstart/1.0"}) # urllib's default User-Agent is blocked by the CDN
try:
with urllib.request.urlopen(req) as r: return r.status, json.load(r)
except urllib.error.HTTPError as e: return e.code, json.load(e) # 409 needs_confirmation, 429, ...
csv = "date,customer,item,qty,amount,status\n2026-01-05,Mina,Cable,2,100,unpaid\n2026-02-05,Omar,Case,1,250,paid"
status, res = call("POST", "/results?pack=retail&name=Quickstart", csv, "text/csv")
print(status, res)
rid = "sbx_sample" if res["data"].get("sandbox") else res["data"]["id"] # sandbox keys store nothing
print(call("GET", "/results/" + rid + "/insights"))
API keys
...
Try it
Response
The response appears here after you press Send.
Rules that match the app
- Ambiguity: if a file has an unanswered number-format question (1.234 as 1234 or 1.234), the API answers HTTP 409 needs_confirmation and saves nothing. Resend with decimal set to "." or ",".
- Limits: 20 saved results on the free plan, more on paid plans when they exist (409 workspace_full, nothing is deleted for you). Results are deleted after 180 days without activity. Bodies up to 600 KB. 120 requests per minute per key (30 for sandbox keys), see the X-RateLimit headers.
- AI quota: v1 never calls AI. Asking for an explanation (explain: true) returns 400 explain_not_available.
- Idempotency: send Idempotency-Key on POST requests. Retrying with the same key and body returns the stored answer. Only successful responses are stored, for 24 hours.
- Isolation: a key belongs to one workspace and can never read or write another one. A key can be limited to one source.
- Errors always look like {"error":{"code","message","status"}} with an X-Request-Id header.
Troubleshooting
- Python gets HTTP 403 with the plain text "error code: 1010" (not our JSON error format): the network in front of the API blocks the default Python user agent. Send your own header, for example User-Agent: my-app/1.0. The Python example above already does this. Other clients with a default or empty user agent can hit the same block.
- HTTP 409 needs_confirmation: the file has a column where 1.234 could mean 1234 or 1.234, and we do not guess. Nothing was saved. Read error.questions, then resend the same file with decimal set to "." or "," (or decimal_cols per column). The same file with the same answer gives the same numbers every time.
- HTTP 429 rate_limited: the key went over its per-minute limit (120 per minute, 30 for sandbox keys). Wait the number of seconds in the Retry-After header (also error.retry_after_s), then retry. Retry a POST with the same Idempotency-Key so a request that did go through is not saved twice. Do not retry in a tight loop.
- Other codes you may see: 401 unauthorized (missing, wrong or revoked key), 403 insufficient_scope (the key lacks read or write), 409 workspace_full (delete old results or upgrade, nothing is deleted for you), 400 not_a_table (the body is not a table). Include the X-Request-Id header value when you report a problem.
Connectors (Beta)
A connector reads a source for you and saves it as a result. GET /api/v1/connectors lists them with their status. Only connectors marked beta can be created; the others say coming_soon and are not available. Every connection is read once when you create it (if it cannot be read, nothing is kept), can be synced again with POST /connections/{id}/sync, and replaces its own previous result. At most 3 connections per workspace and 20 reads per day.
- Google Sheets: share the sheet as "Anyone with the link: Viewer" and send its link. Private sheets are not supported yet (no Google login is used).
- PostgreSQL (switched off by default, the owner turns it on): one SELECT query, up to 5000 rows, TLS only, SCRAM-SHA-256 or cleartext-over-TLS password login (MD5 logins are not supported). Use a read-only database user: Calerio refuses a user that can write or create anything, and runs your query inside a READ ONLY transaction. The host must be a public host name (no IP addresses, no private networks) on a port from 1024 to 65535. The password is stored encrypted and is never returned. Other databases are not supported yet.
- Zapier, Make and n8n: no special connector is needed. Use their HTTP step to send POST /api/v1/results (Content-Type text/csv or application/json) with your key, and a webhook step to receive events. These tools were not tested from inside their own editors; the HTTP call itself is the one covered by our tests.
- Other connectors are not available yet. Tell us which ones you need through the feedback form (/feedback).
# 1) dry run: reads the sheet, stores nothing
curl -X POST "https://calerio.wazayef-callcenter.workers.dev/api/v1/connections/test" -H "Authorization: Bearer cal_live_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"connector":"google_sheets","config":{"url":"https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID/edit"}}'
# 2) create it (reads once, saves a result, can sync again later)
curl -X POST "https://calerio.wazayef-callcenter.workers.dev/api/v1/connections" -H "Authorization: Bearer cal_live_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"connector":"sql_postgres","name":"Shop DB","every_hours":24,"config":{"host":"db.example.com","database":"shop","user":"calerio_ro","password":"...","query":"SELECT order_date AS date, customer, total AS amount, status FROM orders"}}'
# 3) read it again now
curl -X POST "https://calerio.wazayef-callcenter.workers.dev/api/v1/connections/cn_YOUR_ID/sync" -H "Authorization: Bearer cal_live_YOUR_KEY"
SDKs and Postman (Beta)
Copy one file, no packages needed. Python: /sdk/calerio.py. JavaScript (ES module): /sdk/calerio.mjs. Postman collection: /sdk/calerio.postman_collection.json (set the variable calerio_key).
# Python (copy sdk/calerio.py next to your script)
from calerio import Calerio, CalerioError
c = Calerio("cal_test_YOUR_KEY")
r = c.create_result(open("sales.csv").read(), name="Sales", pack="retail")
print(c.insights(r["id"])["summary"])
// JavaScript (copy sdk/calerio.mjs)
import { Calerio } from "./calerio.mjs";
const c = new Calerio(process.env.CALERIO_KEY);
const r = await c.createResult(csvText, { name: "Sales", pack: "retail" });
console.log((await c.insights(r.id)).summary);
Webhooks
Events: insight.new, alert.fired, action.awaiting_approval, webhook.test. Each POST is signed. Check the signature before you trust it:
Signature header: Calerio-Signature: t=
import hmac, hashlib
def verify(secret, header, raw_body, tolerance=300):
parts = dict(p.split("=", 1) for p in header.split(","))
expected = hmac.new(secret.encode(), (parts["t"] + "." + raw_body.decode()).encode(), hashlib.sha256).hexdigest()
import time
return hmac.compare_digest(expected, parts["v1"]) and abs(time.time() - int(parts["t"])) <= tolerance
// Node 18+ (Express: use express.raw({type: "application/json"}) so req.body is the raw Buffer)
import crypto from "node:crypto";
export function verify(secret, header, rawBody, tolerance = 300) {
const p = Object.fromEntries(header.split(",").map((x) => x.split("=", 2)));
const expected = crypto.createHmac("sha256", secret).update(p.t + "." + rawBody.toString("utf8")).digest("hex");
const ok = expected.length === p.v1.length && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(p.v1));
return ok && Math.abs(Date.now() / 1000 - Number(p.t)) <= tolerance;
}
Retries: one quick retry, then up to four more on a schedule that runs every 3 hours on the free plan (5 attempts in total). The signing secret is shown once when you create the webhook.
Other ways to send data
- File upload: PUT to a signed, single-use URL from POST /upload-urls (expires in 1 to 15 minutes). No key needed on the device.
- Devices and sensors: POST JSON or NDJSON to /ingest (up to 200 readings per call). Readings add up in one rolling result per source (last 1000 kept).
- Scheduled pull from a company URL exists for companies in the app (checked every 3 hours).
Not offered
- SFTP: free hosting here cannot run an SFTP server, so it is not available.
- Email-in address per workspace: needs a mail domain we do not own on the free plan, so it is not available.