curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/groups/{groupName}/auth/tokens?expiration=2w&authorization=full-access' \
-H 'Authorization: Bearer TOKEN'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const token = await turso.groups.createToken("default", {
expiration: "2w",
authorization: "full-access",
});
{
"jwt": "TOKEN"
}
Groups
Create Group Auth Token
Generates an authorization token for the specified group.
POST
/
v1
/
organizations
/
{organizationSlug}
/
groups
/
{groupName}
/
auth
/
tokens
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/groups/{groupName}/auth/tokens?expiration=2w&authorization=full-access' \
-H 'Authorization: Bearer TOKEN'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const token = await turso.groups.createToken("default", {
expiration: "2w",
authorization: "full-access",
});
{
"jwt": "TOKEN"
}
Tokens cannot be retrieved once created, and cannot be revoked individually.
curl -L -X POST 'https://api.turso.tech/v1/organizations/{organizationSlug}/groups/{groupName}/auth/tokens?expiration=2w&authorization=full-access' \
-H 'Authorization: Bearer TOKEN'
import { createClient } from "@tursodatabase/api";
const turso = createClient({
org: "...",
token: "",
});
const token = await turso.groups.createToken("default", {
expiration: "2w",
authorization: "full-access",
});
{
"jwt": "TOKEN"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The slug of the organization or user account.
The name of the group.
Query Parameters
Expiration time for the token (e.g., 2w1d30m).
Authorization level for the token (full-access or read-only).
Available options:
full-access, read-only Body
application/json
Additional context such as claims required for the token.
The permissions for the token.
Show child attributes
Show child attributes
Response
Successful response
The generated authorization token (JWT).
Was this page helpful?