Developer Access Tokens
Developer Access Tokens (Personal Access Tokens) allow you to authenticate with the Lordbase API programmatically.
Difference from Database Credentials
Developer Access Tokens are personal tokens linked to your developer account. They grant access to the Management API to manage all your workspaces, databases, and configuration.
Database Credentials are per-database usernames/passwords used to connect directly to your database instances for running queries.
Overview
Use Developer Access Tokens to automate:
- Workspace Management: Create and configure workspaces via API.
- Database Provisioning: Programmatically create and manage databases.
- Backup Management: Schedule and trigger backups.
- CI/CD Integration: Automate deployment of database infrastructure.
Authentication
All requests to the Lordbase API must include the Authorization header:
curl -H "Authorization: Bearer lb_pat_..." https://api.lordbase.com/e/v1/developer/...
Managing Tokens
Create, view, and revoke tokens in Settings in the Lordbase Dashboard.
Creating a Token
curl -X POST https://api.lordbase.com/e/v1/developer/access-tokens/ \
-H "Authorization: Bearer lb_pat_existing_token" \
-H "Content-Type: application/json" \
-d '{
"name": "CI/CD Pipeline",
"scopes": ["api"],
"expires_in_days": 90
}'
attention
The token is shown only once! Copy it immediately after creation. If you lose it, you'll need to create a new one.
Available Scopes
| Scope | Description |
|---|---|
api | Full API Access (Default) |
read_workspaces | View workspace details |
write_workspaces | Create, update, or delete workspaces |
read_databases | View database details and connections |
write_databases | Create, modify, or delete databases |
read_backups | View backup history |
write_backups | Create, restore, or delete backups |
Revoking a Token
curl -X POST https://api.lordbase.com/e/v1/developer/access-tokens/{token_id}/revoke/ \
-H "Authorization: Bearer lb_pat_your_token"
Deleting a Token
curl -X DELETE https://api.lordbase.com/e/v1/developer/access-tokens/{token_id}/ \
-H "Authorization: Bearer lb_pat_your_token"
Token Details
| Field | Description |
|---|---|
name | Human-readable name |
token_prefix_display | First characters shown for identification |
scopes | Granted permissions |
expires_at | Expiration date (null = never) |
last_used_at | Last time the token was used |
last_used_ip | IP address of last use |
is_active | Whether the token is active |
Token Security
| Practice | Description |
|---|---|
| Never expose in frontend | Tokens are for server-side only |
| Use environment variables | Don't hardcode tokens |
| Set expiration | Use expires_in_days for auto-expiry |
| Minimum scopes | Grant only the permissions needed |
| One token per service | Easier to revoke if compromised |
Next Steps
- API Reference — Use tokens with the API
- Security Best Practices — Secure your tokens