curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/auth/rotate' \
-H 'Authorization: Bearer TOKEN'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const response = await turso.databases.rotateTokens("my-db");
{
"error": "could not find database with name [databaseName]: record not found"
}Databases
Invalidate All Database Auth Tokens
Invalidates all database-scoped authorization tokens for the specified database. On AWS, only tokens for this database are invalidated; group tokens and tokens for other databases in the group are not affected.
POST
/
v1
/
organizations
/
{organizationSlug}
/
databases
/
{databaseName}
/
auth
/
rotate
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/auth/rotate' \
-H 'Authorization: Bearer TOKEN'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const response = await turso.databases.rotateTokens("my-db");
{
"error": "could not find database with name [databaseName]: record not found"
}On AWS, this invalidates only the tokens created for this database. Group tokens and tokens for other databases in the group are not affected.
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/databases/{databaseName}/auth/rotate' \
-H 'Authorization: Bearer TOKEN'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const response = await turso.databases.rotateTokens("my-db");
Authorizations
Path Parameters
Response
Successful response (No Content)
Was this page helpful?