WamSQLite

Authentication

The REST API is authenticated with bearer tokens. Every token is scoped to exactly one database — a token minted for one database can never be used against another, even by the same account.

Sending a token

Pass the token in the Authorization header on every request:

Authorization: Bearer wsq_1a2b3c4d5e6f...

Abilities

Each token has one of two access levels, chosen when it's created:

AbilityCan run
Read-onlyQueries only: SELECT, EXPLAIN, read-only PRAGMAs, and WITH (CTE) selects. The connection is opened read-only, so anything that would modify data fails.
Read & writeEverything — including INSERT, UPDATE, DELETE, and DDL like CREATE TABLE.

If a request includes even one statement that needs write access and the token is read-only, the entire request is rejected with a 403 before anything runs. Statements that look like reads but write anyway (for example WITH x AS (...) DELETE ...) are stopped by SQLite itself and come back as a 400 with attempt to write a readonly database.

Expiry

Tokens expire one year after they are created (configurable by the server via SANCTUM_TOKEN_EXPIRATION, in minutes). An expired token is rejected with 401 and the message This API token has expired. — generate a new token from the Tokens tab and update your app. Tokens created more than a year ago stop working once this change is deployed, so rotate them before then.

Errors

StatusMeaning
401Missing, invalid or expired token.
403Token is valid but not scoped to this database, or lacks the write ability.
429Too many requests — see limits.

Revoking access

Delete a token from the Tokens tab at any time. Revocation is immediate — the next request made with that token fails with 401.