API Tokens

Personal Access Tokens (PATs) let you authenticate programmatically without using your main password.

Create token

POST /api/tokens
FieldTypeRequiredDescription
namestringYesToken name/label
scopestringNoPermission scope
expiresInDaysnumberNoDays until expiration

The plaintext token is returned only once on creation. Store it securely.

const result = await client.createApiToken({
  name: 'My CLI Token',
  scope: 'read',
  expiresInDays: 90,
})
// { id, name, token: "pat_...", scope, expiresAt, createdAt }
shadowob api-tokens create --name "My CLI Token" --scope read --expires-in-days 90 --json

List tokens

GET /api/tokens

Returns all tokens for the current user. The plaintext token is never included.

const tokens = await client.listApiTokens()
shadowob api-tokens list --json

Delete token

DELETE /api/tokens/:tokenId

Revoke and delete a token.

await client.deleteApiToken('token-id')
shadowob api-tokens delete <token-id>