Observability operations

Function logs, thrown errors, usage and limits.

Docs menu

account

account.audit.list

Read an account's audit trail (its keys, members, invites, apps and clients), newest first; the filters, limit and cursor of audit.list.

Route
GET /v1/_accounts/{id}/audit
Auth
Account key account
MCP tool
substrio_account_audit_list
CLI
substrio op account.audit.list

Parameters

NameInTypeRequiredDescription
idpathintegerYesMinimum 1.
orderquery"asc" | "desc"Noasc lists oldest first; desc (the default) newest first.
sincequeryinteger (0 or more)Noonly entries at or after this Unix time, in seconds.
limitqueryinteger (0 or more)Nothe most items per page (positive); absent returns every item.
cursorquerystringNoresume after the previous page: its next_cursor.
untilqueryinteger (0 or more)Noonly entries at or before this Unix time, in seconds.
actionquerystringNoonly records of this action, such as function.deploy, secret.set, key.revoke or promote.
actor_kindquerystringNoonly records made by this kind of actor (system_key, tenant_key, account_key, user, agent_token, agent_session, client_ipv4, client_ipv6, server); give actor with it.
actorquerystringNoonly records made by this actor: a key id (16 hex digits), a user id, an agent session id or an address; give actor_kind with it.
target_kindquerystringNoonly records that changed this kind of thing (function, secret, setting, key, token, hostname, collection, index, config, tenant, account, user, ...); give target with it.
targetquerystringNoonly records that changed this one thing, by its name (a function name, a setting key) or key id; give target_kind with it.
outcomequerystringNoonly change records that ended this way: applied, refused, failed, interrupted or pending.

Response

FieldTypePresentDescription
recordsarray of objectWhen set
countintegerWhen set
next_cursorstring or nullWhen setpass it as cursor for the next page; null on the last.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_accounts/$ID/audit" \
  -H "Authorization: Bearer $SUBSTRIO_ACCOUNT_KEY"

audit

audit.export

Stream the app's audit trail, oldest first, as one JSON object per line (application/x-ndjson): every record of audit.list plus its chained (whether it carries a digest) and digest (hex, when chained) fields, and a final {chain_head_seq, chain_head_digest} line on the last page. Filters: since and until (Unix seconds); limit (default 1000) and cursor (the X-Substrio-Next-Cursor response header) page it; a page keeps the chain order, so a customer can verify a kept export later without substrio.

Route
GET /v1/_audit/export
Auth
App key tenant
MCP tool
substrio_audit_export
CLI
substrio op audit.export

Parameters

NameInTypeRequiredDescription
sincequeryinteger (0 or more)Noonly entries at or after this Unix time, in seconds.
limitqueryinteger (0 or more)Nothe most items per page (positive); absent returns every item.
cursorquerystringNoresume after the previous page: its next_cursor.
untilqueryinteger (0 or more)Noonly entries at or before this Unix time, in seconds.
sincequeryintegerNoUnix seconds, at or after. Minimum 0.
untilqueryintegerNoUnix seconds, at or before. Minimum 0.
limitqueryintegerNothe most records per page (default 1000). Minimum 1.
cursorquerystringNothe previous page's X-Substrio-Next-Cursor header; absent for the first page.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_audit/export" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

audit.get

Read one audit record of the app's trail by its seq (the number audit.list shows for it).

Route
GET /v1/_audit/{seq}
Auth
App key tenant
MCP tool
substrio_audit_get
CLI
substrio op audit.get

Parameters

NameInTypeRequiredDescription
seqpathintegerYesMinimum 1.

Response

FieldTypePresentDescription
seqintegerWhen setorders the whole trail; never reused.
timeintegerWhen setUnix milliseconds.
actionstringWhen set
operationstringWhen setthe registry operation that made the change.
scope"tenant" | "account" | "platform"When set
actorobjectWhen set
targetobjectWhen set
beforestringWhen setfingerprint of the state before, hex; absent when unknown.
afterstringWhen setfingerprint of the state after, hex; absent when unknown.
outcome"applied" | "refused" | "failed" | "interrupted" | "pending"When set
statusintegerWhen setthe HTTP status the change answered.
errorintegerWhen setthe substrio error code, 0 when none.
clientstringWhen setthe caller's address when known.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_audit/$SEQ" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

audit.list

Read the app's audit trail, newest first: every deploy, promote, rollback, secret, key, token, setting, rule, collection, index and domain change, and every agent request, each with its actor, target, before and after fingerprints and outcome (applied, refused, failed, interrupted, or pending while it runs). Filters: action, actor_kind with actor, target_kind with target, outcome, since and until (Unix seconds), order; limit and cursor page it. Answers records, count and next_cursor. A record is never removed or changed; a change has its record before it runs.

Route
GET /v1/_audit
Auth
App key tenant
MCP tool
substrio_audit_list
CLI
substrio op audit.list

Parameters

NameInTypeRequiredDescription
orderquery"asc" | "desc"Noasc lists oldest first; desc (the default) newest first.
sincequeryinteger (0 or more)Noonly entries at or after this Unix time, in seconds.
limitqueryinteger (0 or more)Nothe most items per page (positive); absent returns every item.
cursorquerystringNoresume after the previous page: its next_cursor.
untilqueryinteger (0 or more)Noonly entries at or before this Unix time, in seconds.
actionquerystringNoonly records of this action, such as function.deploy, secret.set, key.revoke or promote.
actor_kindquerystringNoonly records made by this kind of actor (system_key, tenant_key, account_key, user, agent_token, agent_session, client_ipv4, client_ipv6, server); give actor with it.
actorquerystringNoonly records made by this actor: a key id (16 hex digits), a user id, an agent session id or an address; give actor_kind with it.
target_kindquerystringNoonly records that changed this kind of thing (function, secret, setting, key, token, hostname, collection, index, config, tenant, account, user, ...); give target with it.
targetquerystringNoonly records that changed this one thing, by its name (a function name, a setting key) or key id; give target_kind with it.
outcomequerystringNoonly change records that ended this way: applied, refused, failed, interrupted or pending.

Response

FieldTypePresentDescription
recordsarray of objectWhen set
countintegerWhen set
next_cursorstring or nullWhen setpass it as cursor for the next page; null on the last.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_audit" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

audit.verify

Walk the app's audit trail over [from, to] (default: the whole trail) and answer whether every record's digest chains from the one before it to the chain head: intact, or the first seq where it breaks and how (digest_mismatch, gap, or head_mismatch). Reads each record once, in order; records_read is the rows it touched.

Route
GET /v1/_audit/verify
Auth
App key tenant
MCP tool
substrio_audit_verify
CLI
substrio op audit.verify

Parameters

NameInTypeRequiredDescription
fromqueryinteger (0 or more)Nothe first seq to verify (default 1).
toqueryinteger (0 or more)Nothe last seq to verify (default the newest written).
fromqueryintegerNothe first seq to verify; default 1. Minimum 1.
toqueryintegerNothe last seq to verify; default the newest written. Minimum 1.

Response

FieldTypePresentDescription
status"intact" | "digest_mismatch" | "gap" | "head_mismatch"Always
atinteger or nullAlwaysthe first seq where it breaks; null when intact.
records_readintegerAlways

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_audit/verify" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

function

function.errors

Read the errors the app's functions threw, newest first: each has an id (also a cursor), function, revision (the function's newest revision when it threw), request_id, timestamp, error name, message and the stack as frames (function, file, line, column). Options: function, request_id, revision (only errors of one deploy), since and until (Unix seconds), limit and cursor. Answers errors, count and next_cursor. Check the revision against version.log with the function path: a deploy that fixed a bug stops adding errors under the new revision.

Route
GET /v1/_function_errors
Auth
App key tenant
MCP tool
substrio_function_errors
CLI
substrio op function.errors

Parameters

NameInTypeRequiredDescription
sincequeryinteger (0 or more)Noonly entries at or after this Unix time, in seconds.
functionquerystringNoonly entries of this function (its id, tenant/name, or its name).
limitqueryinteger (0 or more)Nothe most items per page (positive); absent returns every item.
cursorquerystringNoresume after the previous page: its next_cursor.
request_idquerystringNoonly entries of this function call (its request id).
untilqueryinteger (0 or more)Noonly entries at or before this Unix time, in seconds.
revisionqueryinteger (0 or more)Noonly errors thrown while this revision of the function was its newest (the deploy counter every entry carries, so this narrows a page to one deploy).

Response

FieldTypePresentDescription
errorsarray of objectAlways
countintegerAlways
next_cursorstring or nullAlways

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_function_errors" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

function.logs

Read the app's function logs: options function (id, tenant/name or name), level, request_id (every line of one call), since and until (Unix seconds), limit, and cursor to continue after a next_cursor; wait_ms with a cursor long-polls for new lines (at most 30000 ms). Answers logs, count, next_cursor and latest_cursor. A line records no function revision, so to tell what a deploy changed use function.errors with its revision option, or version.log with the function path.

Route
GET /v1/_logs
Auth
App key tenant
MCP tool
substrio_function_logs
CLI
substrio op function.logs

Parameters

NameInTypeRequiredDescription
limitqueryinteger (0 or more)Nothe most items to return.
skipqueryinteger (0 or more)Noitems to skip before the first one returned.
sincequeryinteger (0 or more)Noonly entries at or after this Unix time, in seconds.
qquerystringNothe text to find: in the function source (function.source.search, required), or the words every returned log line's message holds (function.logs).
levelquerystringNoonly log entries of this level.
functionquerystringNoonly entries of this function (its id, tenant/name, or its name).
cursorquerystringNoresume after the previous page: its next_cursor.
request_idquerystringNoonly entries of this function call (its request id).
untilqueryinteger (0 or more)Noonly entries at or before this Unix time, in seconds.
wait_msqueryinteger (0 or more)Nofunction.logs long poll: with a cursor, and no matching line stored past it yet, wait up to this many milliseconds (at most 30000; more is refused) and answer with the first non-empty page, or empty at the deadline; an app holds at most 64 waits at once (the next is SERVER_BUSY).

Response

FieldTypePresentDescription
logsarray of objectAlways
countintegerAlways
has_morebooleanWhen set
next_cursorstringWhen setpresent on a full page: pass it as cursor for the entries after it.
latest_cursorstringWhen setthe newest stored line when this was answered: tail from here with cursor and wait_ms; every line up to it was considered by this answer.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_logs" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

function.logs.clear

Purge the stored function log lines of the app; answers {success, purged}.

Route
DELETE /v1/_logs
Auth
App key tenant
MCP tool
substrio_function_logs_clear
CLI
substrio op function.logs.clear

Parameters

No parameters.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl -X DELETE "$SUBSTRIO_URL/v1/_logs" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

function.logs.stream

Tail function logs live over WebSocket: connect with ?function=, ?request_id=, ?level= (as function.logs) and ?cursor= (default: only new lines); the first frame is {type:connected,cursor}, then {type:logs,cursor,logs:[...]}; a slow socket gets {type:lagged,cursor} and continues from that cursor, or reconnect with it.

Route
GET /v1/_logs/ws
Auth
App key tenant
CLI
substrio op function.logs.stream

Parameters

No parameters.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_logs/ws" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

log_alert

log_alert.create

Add a log alert that publishes the app event log.alert (scope: the alert's id) when its condition first holds in a window, once per window; the webhooks that take log.alert (webhook.create with event log.alert) store, sign, retry and dead-letter it: error_count (function errors reach threshold), error_rate (errors over calls reach rate_percent, with min_calls calls) or log_match (log lines whose message holds every word of match, optionally of one function and level, reach threshold). Windows are fixed slots of unix time of window_ms. Answers the alert with its id.

Route
POST /v1/_log_alerts
Auth
App key tenant
MCP tool
substrio_log_alert_create
CLI
substrio op log_alert.create

Parameters

NameInTypeRequiredDescription
namebodystringNoa label shown in the notification.
kindbody"error_count" | "error_rate" | "log_match"Yeserror_count: function errors in the window reach threshold; error_rate: errors / calls in the window reach rate_percent, with at least min_calls calls; log_match: log lines matching match (and function, level) in the window reach threshold.
functionbodystringNoonly this function (its name); empty: every function.
levelbodystringNolog_match: only lines of this level.
matchbodystringNolog_match: the words every counted line's message holds.
window_msbodyintegerNothe window length; windows are fixed slots of unix time (default 60000). Minimum 1.
thresholdbodyintegerNoerror_count and log_match: the count that fires the alert (default 1). Minimum 1.
rate_percentbodynumberNoerror_rate: the error percentage that fires the alert. Maximum 100.
min_callsbodyintegerNoerror_rate: calls the window needs before the rate counts (default 1). Minimum 1.
enabledbodybooleanNofalse pauses the alert (default true).

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl -X POST "$SUBSTRIO_URL/v1/_log_alerts" \
  -H "Authorization: Bearer $SUBSTRIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"error_count"}'

log_alert.delete

Delete one log alert by its id (the route's {id}, as log_alert.list shows it).

Route
DELETE /v1/_log_alerts/{id}
Auth
App key tenant
MCP tool
substrio_log_alert_delete
CLI
substrio op log_alert.delete

Parameters

NameInTypeRequiredDescription
idpathstringYesThe log alert's id (16 hex digits), as log_alert.list returned it.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl -X DELETE "$SUBSTRIO_URL/v1/_log_alerts/$ID" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

log_alert.list

List the app's log alerts: each with its kind, filters, window, threshold, the window it last fired in, when, and how many webhooks took that notification.

Route
GET /v1/_log_alerts
Auth
App key tenant
MCP tool
substrio_log_alert_list
CLI
substrio op log_alert.list

Parameters

No parameters.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_log_alerts" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

log_alert.update

Change one log alert by id: any of its settings; the window it last fired in is kept, so a change never notifies twice for one window.

Route
PATCH /v1/_log_alerts/{id}
Auth
App key tenant
MCP tool
substrio_log_alert_update
CLI
substrio op log_alert.update

Parameters

NameInTypeRequiredDescription
idpathstringYesthe alert's id (16 hex digits), as log_alert.list shows it.
namebodystringNoa label shown in the notification.
kindbody"error_count" | "error_rate" | "log_match"Noerror_count: function errors in the window reach threshold; error_rate: errors / calls in the window reach rate_percent, with at least min_calls calls; log_match: log lines matching match (and function, level) in the window reach threshold.
functionbodystringNoonly this function (its name); empty: every function.
levelbodystringNolog_match: only lines of this level.
matchbodystringNolog_match: the words every counted line's message holds.
window_msbodyintegerNothe window length; windows are fixed slots of unix time (default 60000). Minimum 1.
thresholdbodyintegerNoerror_count and log_match: the count that fires the alert (default 1). Minimum 1.
rate_percentbodynumberNoerror_rate: the error percentage that fires the alert. Maximum 100.
min_callsbodyintegerNoerror_rate: calls the window needs before the rate counts (default 1). Minimum 1.
enabledbodybooleanNofalse pauses the alert (default true).

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl -X PATCH "$SUBSTRIO_URL/v1/_log_alerts/$ID" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

log_drain

log_drain.create

Add a log drain: every log line and every function error is POSTed, as NDJSON in batches, in order and at least once (a line carries its log_seq, so a receiver can drop a repeat), signed like a webhook when a secret is set. Answers the drain with its id. start now (default) delivers lines stored from now on, start delivers everything stored.

Route
POST /v1/_log_drains
Auth
App key tenant
MCP tool
substrio_log_drain_create
CLI
substrio op log_drain.create

Parameters

NameInTypeRequiredDescription
urlbodystringYeswhere the lines are POSTed: an http:// or https:// URL.
secretbodystringNosigns every delivery like a webhook's secret; empty: unsigned.
headersbodyobjectNoheaders sent with every delivery.
batch_linesbodyintegerNolines per request, at most (default 500). Minimum 1.
retry_msbodyintegerNowait after a failed delivery; doubles on each failure in a row (default 1000). Minimum 1.
max_retry_msbodyintegerNothe longest wait between attempts (default 60000). Minimum 1.
enabledbodybooleanNofalse pauses the drain, which resumes from its cursor (default true).
startbody"now" | "start"Nonow (default): lines stored from now on; start: everything already stored too.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl -X POST "$SUBSTRIO_URL/v1/_log_drains" \
  -H "Authorization: Bearer $SUBSTRIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"url"}'

log_drain.delete

Delete one log drain by its id (the route's {id}, as log_drain.list shows it); its undelivered lines are not delivered.

Route
DELETE /v1/_log_drains/{id}
Auth
App key tenant
MCP tool
substrio_log_drain_delete
CLI
substrio op log_drain.delete

Parameters

NameInTypeRequiredDescription
idpathstringYesThe log drain's id (16 hex digits), as log_drain.list returned it.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl -X DELETE "$SUBSTRIO_URL/v1/_log_drains/$ID" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

log_drain.list

List the app's log drains: each with its url, settings, acked (the cursor of the last line its endpoint accepted), latest (the newest stored line's cursor), the failures in a row and the endpoint's last HTTP status. A drain whose endpoint is down shows acked behind latest and catches up in order when the endpoint answers.

Route
GET /v1/_log_drains
Auth
App key tenant
MCP tool
substrio_log_drain_list
CLI
substrio op log_drain.list

Parameters

No parameters.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_log_drains" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

log_drain.update

Change one log drain by id: any of url, secret, headers, batch_lines, retry_ms, max_retry_ms, enabled; its progress is kept. A disabled drain stops delivering and resumes from its cursor when enabled.

Route
PATCH /v1/_log_drains/{id}
Auth
App key tenant
MCP tool
substrio_log_drain_update
CLI
substrio op log_drain.update

Parameters

NameInTypeRequiredDescription
idpathstringYesthe drain's id (16 hex digits), as log_drain.list shows it.
urlbodystringNowhere the lines are POSTed: an http:// or https:// URL.
secretbodystringNosigns every delivery like a webhook's secret; empty: unsigned.
headersbodyobjectNoheaders sent with every delivery.
batch_linesbodyintegerNolines per request, at most (default 500). Minimum 1.
retry_msbodyintegerNowait after a failed delivery; doubles on each failure in a row (default 1000). Minimum 1.
max_retry_msbodyintegerNothe longest wait between attempts (default 60000). Minimum 1.
enabledbodybooleanNofalse pauses the drain, which resumes from its cursor (default true).

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl -X PATCH "$SUBSTRIO_URL/v1/_log_drains/$ID" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

meta

meta.gc

Inspect or reclaim the app database's deferred-free space. GET answers limbo_entries, allocated_bytes and file_size_bytes; POST drains the deferred frees into the allocator and answers {triggered: true}. It frees space for reuse and never deletes data, and the file does not shrink. Pick the method with http_method.

Route
GET /v1/_meta/gc
POST /v1/_meta/gc
Auth
App key tenant
MCP tool
substrio_meta_gc
CLI
substrio op meta.gc

Parameters

No parameters.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_meta/gc" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

observability

observability.metrics

Read process metrics.

Route
GET /v1/_metrics
Auth
None none
CLI
substrio op observability.metrics

Parameters

NameInTypeRequiredDescription
rangequeryintegerNoseconds of history to report (default 3600, at most 604800).

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_metrics"

tenant

tenant.storage

Read what this app's folder holds on disk (disk_bytes, as of the last fold, each second) by kind (database, files, logs, backups, code, other), its storage limit and the room left (null while no limit is set). The storage limit is held against disk_bytes; tenant.usage's used_bytes and blob_bytes count only document and file bytes.

Route
GET /v1/_storage
Auth
App key tenant
MCP tool
substrio_tenant_storage
CLI
substrio op tenant.storage

Parameters

No parameters.

Response

FieldTypePresentDescription
tenant_idintegerAlways
slugstringAlways
disk_bytesintegerAlwayswhat the app's folder holds on disk as of the last fold (each second): the figure the storage limit is held against.
kindsobjectAlwaysdisk_bytes by kind.
limit_bytesinteger or nullAlwaysthe app's storage limit; null while none is set.
available_bytesinteger or nullAlwayslimit_bytes less disk_bytes, at least 0; null while no limit is set.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_storage" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

tenant.usage.history

Read this app's KPI history, oldest first: one point per finished minute (step=minute, the default; kept two days) or hour (step=hour; kept 90 days), each with what the app's function calls added in it (calls, status classes, latency buckets and percentiles, refusals, CPU and wall time) and its stored documents and bytes at its end. since and until are Unix seconds (default: the last hour of minutes, or the last two days of hours); limit caps the points. Counted on the node that answers.

Route
GET /v1/_usage/history
Auth
App key tenant
MCP tool
substrio_tenant_usage_history
CLI
substrio op tenant.usage.history

Parameters

NameInTypeRequiredDescription
limitqueryinteger (0 or more)Nothe most items to return.
sincequeryinteger (0 or more)Noonly entries at or after this Unix time, in seconds.
untilqueryinteger (0 or more)Noonly entries at or before this Unix time, in seconds.
stepquery"minute" | "hour"Nominute (the default) or hour: one point per minute, or per hour.

Response

FieldTypePresentDescription
step"minute" | "hour"When set
sinceintegerWhen setUnix seconds, the start of the range asked.
untilintegerWhen setUnix seconds, the end of the range asked.
pointsarray of objectWhen setoldest first; a minute or hour with no point had no counter written (the database was closed).

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_usage/history" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

tenant.usage.self

Read this tenant's own exact usage and limits: storage bytes, documents, requests per minute (a limit is null until one is set) and the function limits (cpu, memory, concurrency, timeout, body and value sizes), for the tenant the key belongs to.

Route
GET /v1/_usage
Auth
App key tenant
MCP tool
substrio_tenant_usage_self
CLI
substrio op tenant.usage.self

Parameters

No parameters.

Response

FieldTypePresentDescription
tenant_idintegerAlways
slugstringAlways
storageobjectAlways
documentsobjectAlways
requestsobjectAlways
functionsobjectAlways
callsobjectAlwayswhat the tenant's function calls used since the server counted them (in memory: a restart starts the window again).
limits_explicitbooleanAlwaystrue once a storage, document or request limit was set; only then are they enforced.
activebooleanAlways
mcp_toolsobjectWhen settools/call runs of each of the app's own MCP tools on its /mcp, by tool name, kept in the app's database (APP-MCP).
this_monthobjectAlwaysthe app's function calls, API requests and their 5xx this month (UTC, the plan's metering month): durable totals kept in the app's record, reset when the month turns.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_usage" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"

webhook

webhook.logs

Read the delivery log of one webhook route by id: options limit.

Route
GET /v1/_webhooks/{id}/logs
Auth
App key tenant
MCP tool
substrio_webhook_logs
CLI
substrio op webhook.logs

Parameters

NameInTypeRequiredDescription
idpathstring or integerYesThe webhook's id, as webhook.list returned it.
limitqueryinteger (0 or more)Nothe most items to return.

Response

A JSON object.

Errors

A failed call answers the error envelope with a typed code.

Example

curl "$SUBSTRIO_URL/v1/_webhooks/$ID/logs" \
  -H "Authorization: Bearer $SUBSTRIO_KEY"