Skip to main content
Inspector

Execute SQL

Run a SQL statement against the actor's SQLite database.

The inspector API powers the Rivet dashboard and is subject to change without notice. Do not build production integrations on it.

SQL executes directly against actor storage. Use bind parameters for values.

POST https://api.rivet.dev/gateway/{actor}/inspector/database/execute

Examples

Authentication

Inspector endpoints do not accept namespace tokens. Send the actor’s inspector token as a bearer token in the Authorization header. Each actor generates its own inspector token on first start and stores it in its KV storage under the single byte 0x03. Read it through the control plane with GET /actors/{actor_id}/kv/keys/Aw==?namespace={namespace} using a namespace token; the response value is the token, base64-encoded. The dashboard does this for you.

Path Parameters

NameTypeRequiredDescription
actorstringYesActor ID, actor ID with an inline token ({actor_id}@{token}), or actor name combined with the rvt-* query parameters.

Headers

NameTypeRequiredDescription
AuthorizationstringNoBearer token for inspector authentication. Required in production, optional in development.

Request Body

Content type: application/json.

FieldTypeRequiredDescription
sqlstringYesSQL statement to run against the actor’s SQLite database.
argsany[]NoPositional arguments passed to the action, in order.
propertiesobjectNoDriver-specific execution options.

Responses

200

Rows returned by the statement.

FieldTypeDescription
rowsobject[]
{
  "rows": [
    {}
  ]
}

401

The inspector token is missing or invalid.