API Tokens
Personal Access Tokens (PATs) let you authenticate programmatically without using your main password.
Create token
| Field | Type | Required | Description |
|---|
name | string | Yes | Token name/label |
scope | string | No | Permission scope |
expiresInDays | number | No | Days 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
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>