Serverless
Get the account’s Cron Jobs
Section titled “Get the account’s Cron Jobs”GET /v1/serverless/cron · scope serverless:read
It takes no id: there is one Cron tenant per account. Returns the plan, its limits, how many schedules exist, and the month’s executions. Schedules themselves are managed against the service’s data plane with the tenant token.
curl https://api.truo.cloud/v1/serverless/cron \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless cron getawait truo.serverless.cron.get();truo_serverless({ "action": "cron_get"})operationId: serverless.cron.get
Rotate the Cron token
Section titled “Rotate the Cron token”POST /v1/serverless/cron/keys/rotate · scope serverless:keys · destructive — cannot be undone · idempotent
Issues a new crt_… token and returns it, exactly once. With grace_seconds the previous token keeps working that long; with 0 (the default) it dies immediately. Schedules keep firing through a rotation — the token only authenticates management.
curl https://api.truo.cloud/v1/serverless/cron/keys/rotate \ -X POST \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless cron key rotateawait truo.serverless.cron.keys.rotate();truo_serverless({ "action": "cron_key_rotate"})operationId: serverless.cron.keys.rotate
Get the Cron period’s usage and billable line
Section titled “Get the Cron period’s usage and billable line”GET /v1/serverless/cron/usage · scope serverless:read
Webhook executions against the plan for the period, the overage, the total in USD, and the daily series. On the free plan, deliveries past the quota are skipped (visible in the execution log) instead of billed.
curl https://api.truo.cloud/v1/serverless/cron/usage \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless cron usageawait truo.serverless.cron.usage.get();truo_serverless({ "action": "cron_usage"})operationId: serverless.cron.usage.get
Get the account’s Serverless DB
Section titled “Get the account’s Serverless DB”GET /v1/serverless/db · scope serverless:read
It takes no id: there is one Serverless DB tenant per account. Returns the plan, its limits, the live namespaces and the month’s usage. This is not DBaaS (/v1/databases, managed database VMs): this is the serverless SQL primitive, D1-compatible, one SQLite database per namespace.
curl https://api.truo.cloud/v1/serverless/db \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless db getawait truo.serverless.db.get();truo_serverless({ "action": "db_get"})operationId: serverless.db.get
Rotate the DB token
Section titled “Rotate the DB token”POST /v1/serverless/db/keys/rotate · scope serverless:keys · destructive — cannot be undone · idempotent
Issues a new dbt_… token and returns it, exactly once. With grace_seconds the previous token keeps working that long — rotate with a grace window and redeploy your apps before it closes, or every query they run dies at the instant of rotation.
curl https://api.truo.cloud/v1/serverless/db/keys/rotate \ -X POST \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless db key rotateawait truo.serverless.db.keys.rotate();truo_serverless({ "action": "db_key_rotate"})operationId: serverless.db.keys.rotate
Get the DB period’s usage and billable line
Section titled “Get the DB period’s usage and billable line”GET /v1/serverless/db/usage · scope serverless:read
Rows read/written and the storage peak against the plan for the period, the overage, the total in USD, and the daily series. exec (multi-statement DDL) does not report rows and is not metered, same as D1.
curl https://api.truo.cloud/v1/serverless/db/usage \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless db usageawait truo.serverless.db.usage.get();truo_serverless({ "action": "db_usage"})operationId: serverless.db.usage.get
Get the account’s Serverless Functions
Section titled “Get the account’s Serverless Functions”GET /v1/serverless/functions · scope serverless:read
It takes no id: there is one Functions tenant per account. Returns the plan, its limits, how many functions are deployed, and the month’s invocations. Deploys and invocations go through the service’s data plane, not this API.
curl https://api.truo.cloud/v1/serverless/functions \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless functions getawait truo.serverless.functions.get();truo_serverless({ "action": "functions_get"})operationId: serverless.functions.get
Rotate the Functions token
Section titled “Rotate the Functions token”POST /v1/serverless/functions/keys/rotate · scope serverless:keys · destructive — cannot be undone · idempotent
Issues a new fnt_… token and returns it, exactly once. With grace_seconds the previous token keeps working that long. Deployed functions keep serving through a rotation — the token only authenticates deploys and management, not the public invocation URLs.
curl https://api.truo.cloud/v1/serverless/functions/keys/rotate \ -X POST \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless functions key rotateawait truo.serverless.functions.keys.rotate();truo_serverless({ "action": "functions_key_rotate"})operationId: serverless.functions.keys.rotate
Get the Functions period’s usage and billable line
Section titled “Get the Functions period’s usage and billable line”GET /v1/serverless/functions/usage · scope serverless:read
Invocations, errors and total execution time against the plan for the period, the overage, the total in USD, and the daily series.
curl https://api.truo.cloud/v1/serverless/functions/usage \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless functions usageawait truo.serverless.functions.usage.get();truo_serverless({ "action": "functions_usage"})operationId: serverless.functions.usage.get
Get the account’s Serverless KV
Section titled “Get the account’s Serverless KV”GET /v1/serverless/kv · scope serverless:read
It takes no id: there is one KV tenant per account. Returns the plan, its limits, and the month’s usage. If the account does not have the service, it returns 404.
curl https://api.truo.cloud/v1/serverless/kv \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless kv getawait truo.serverless.kv.get();truo_serverless({ "action": "kv_get"})operationId: serverless.kv.get
Create an additional KV token
Section titled “Create an additional KV token”POST /v1/serverless/kv/keys · scope serverless:keys · reversible · idempotent
Mints a new kvt_… token without invalidating the existing ones — KV is the only primitive that supports several live tokens per tenant (one per app or environment). The token is returned exactly once: only its hash is stored.
It does not work against this API: it authenticates the data plane at {api_endpoint}/v1/ns/…. It requires serverless:keys because holding it is the ability to read, write and bill against the account’s tenant.
curl https://api.truo.cloud/v1/serverless/kv/keys \ -X POST \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless kv key createawait truo.serverless.kv.keys.create();truo_serverless({ "action": "kv_key_create"})operationId: serverless.kv.keys.create
Rotate the KV tokens
Section titled “Rotate the KV tokens”POST /v1/serverless/kv/keys/rotate · scope serverless:keys · destructive — cannot be undone · idempotent
Issues a new token and returns it. All previous tokens of the tenant are affected: with grace_seconds they keep working that long; with 0 (the default) they die immediately. There is no going back.
curl https://api.truo.cloud/v1/serverless/kv/keys/rotate \ -X POST \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless kv key rotateawait truo.serverless.kv.keys.rotate();truo_serverless({ "action": "kv_key_rotate"})operationId: serverless.kv.keys.rotate
Get the KV period’s usage and billable line
Section titled “Get the KV period’s usage and billable line”GET /v1/serverless/kv/usage · scope serverless:read
Reads, writes and the storage peak against the plan for the period, the overage, the total in USD, and the daily series. On a hard-capped plan (included.hard_cap) the overage is never billed: the service stops at the quota instead.
curl https://api.truo.cloud/v1/serverless/kv/usage \ -H "Authorization: Bearer $TRUO_TOKEN"truo serverless kv usageawait truo.serverless.kv.usage.get();truo_serverless({ "action": "kv_usage"})operationId: serverless.kv.usage.get