Authentication & API Tokens
What it is
To interact with your personal data using the VerseDB API — like Collections, Wishlists, Pull Lists, or reading progress — you'll need to authenticate with a Bearer token.
Tokens act as your secure access key and allow API requests to be made on your behalf without exposing your password.
Where to get your token
To create and manage API tokens:
- Log into your VerseDB account
- Navigate to Settings → API section
- Or go directly to: https://versedb.com/user/api-tokens
- Click Create New Token
- Give your token a descriptive name (e.g., "Mobile App", "Discord Bot")
- Select the permissions/scopes you need
- Click Create to generate your token
- Copy the token immediately — it will only be shown once!
> Important: Store your token securely. You won't be able to see it again after creation. If you lose it, you'll need to generate a new one.
Using the token in API requests
Include your token in the Authorization header of every authenticated request:
Authorization: Bearer your-api-token-here
Example: cURL
curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGc..." \
https://versedb.com/api/v1/user/collection
Example: JavaScript (fetch)
fetch('https://versedb.com/api/v1/user/collection', {
headers: {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGc...',
'Content-Type': 'application/json'
}
})
Example: Python (requests)
import requests
headers = {
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGc...',
'Content-Type': 'application/json'
}
response = requests.get('https://versedb.com/api/v1/user/collection', headers=headers)
Token Permissions (Scopes)
When creating a token, select only the permissions your application needs. This follows the principle of least privilege for better security:
Read Permissions
read:public– Browse public content (series, issues, characters, creators)read:self– Read your own account data and profileread:collection– View your collectionread:wishlist– View your wishlistread:pulllist– View your pull listread:read– View your reading history
Write Permissions
write:collection– Add, edit, and remove items from your collectionwrite:wishlist– Add, edit, and remove items from your wishlistwrite:pulllist– Add and remove series from your pull listwrite:read– Mark issues as read/unreadwrite:follow– Follow/unfollow titles and series
Combined Permissions
lists:collection– Full read/write access to collectionlists:wishlist– Full read/write access to wishlistlists:pulllist– Full read/write access to pull listlists:read– Full read/write access to reading trackerlists:follow– Full read/write access to follows
Best practice: Use combined permissions for simpler token management, or separate read/write for fine-grained control.
Managing multiple tokens
You can create multiple tokens for different purposes:
- Personal scripts - One token for your automation scripts
- Mobile app - Separate token for your phone
- Third-party integrations - Different tokens for each service
- Development/testing - Test tokens that can be safely revoked
Benefits:
- Revoke compromised tokens without affecting others
- Track usage per application
- Grant different permissions to different tools
Token security best practices
DO:
✅ Store tokens in environment variables, not hardcoded
✅ Use secrets management tools (e.g., .env files, Azure Key Vault)
✅ Revoke unused tokens regularly
✅ Use HTTPS only for all API requests
✅ Implement token rotation for long-running apps
✅ Give tokens descriptive names to track usage
DON'T:
❌ Never commit tokens to Git repositories
❌ Don't share tokens publicly (Discord, forums, etc.)
❌ Avoid storing tokens in client-side JavaScript
❌ Don't use the same token across multiple untrusted apps
❌ Never log tokens in application logs
Revoking and regenerating tokens
To revoke a token:
- Go to Settings → API section
- Find the token you want to revoke
- Click Delete or Revoke
- The token will be immediately invalidated
When to revoke:
- Token may have been exposed or compromised
- No longer using the application/service
- Switching to a new token with different permissions
- Regular security rotation (e.g., every 90 days)
Public vs authenticated endpoints
Public endpoints (no token required):
- GET
/api/series- Browse series - GET
/api/issues- Browse issues - GET
/api/characters- Browse characters - GET
/api/creators- Browse creators - GET
/api/users/{id}/profile- View public profiles
Authenticated endpoints (token required):
- GET
/api/user/collection- Your collection - POST
/api/user/collection- Add to collection - GET
/api/user/wishlist- Your wishlist - POST
/api/user/pulllist- Manage pull list - GET
/api/user/profile- Your private profile data
Troubleshooting authentication errors
401 Unauthorized
Problem: Token is missing, invalid, or expired
Solutions:
- Check the
Authorizationheader is properly formatted - Verify token hasn't been revoked
- Regenerate token if necessary
- Ensure using
Bearerprefix before token
403 Forbidden
Problem: Token lacks required permissions for the endpoint
Solutions:
- Check token has appropriate scope/permission
- Create new token with correct permissions
- Verify endpoint requires the permission you think it does
429 Too Many Requests
Problem: Rate limit exceeded
Solutions:
- Implement exponential backoff in your client
- Upgrade to PRO for higher rate limits
- Reduce request frequency
Testing your token
Quick test to verify your token works:
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
https://versedb.com/api/v1/user/profile
If successful, you'll receive your profile data. If you get a 401, the token is invalid.
Next step: Learn about rate limits in "Understanding API Rate Limits on VerseDB"
Was this article helpful?
Please login to provide feedback