Overview
API keys provide programmatic access to the Spoo.me API without requiring interactive authentication. They allow you to automate URL shortening, retrieve analytics, and manage your URLs from scripts, applications, and integrations.API keys are only available in API v1. The legacy v0 API does not support API key authentication.
Authentication Methods
Spoo.me v1 API supports three authentication methods:Anonymous
No authentication required
- Lower rate limits
- Cannot manage URLs later
- Limited features
JWT Token
Interactive user sessions
- Full dashboard access
- Manage URLs via web UI
- Highest privileges
API Key
Programmatic access
- Scoped permissions
- Long-lived tokens
- Perfect for automation
API Key Scopes
API keys can be granted specific permissions (scopes) to limit their access:| Scope | Description | Endpoints |
|---|---|---|
shorten:create | Create new shortened URLs | POST /api/v1/shorten |
urls:read | View URL details and list | GET /api/v1/urls |
urls:manage | Update and delete URLs | PATCH/DELETE /api/v1/urls/* |
stats:read | Access analytics data | GET /api/v1/stats |
admin:all | Full administrative access | All endpoints |
Creating API Keys
Via Web Dashboard
- Log in to your Spoo.me Dashboard
- Navigate to Settings → API Keys
- Click Create New API Key
- Configure your key:
- Name: Human-readable identifier (e.g., “Production Server”)
- Description: Optional details about key’s purpose
- Scopes: Select required permissions
- Expiration: Optional expiration date
- Click Create
- Copy the key immediately - it won’t be shown again!
Using API Keys
API keys must be sent in theAuthorization header with the Bearer scheme:
Example: Shorten a URL
Example: Get Statistics
Example: List Your URLs
Rate Limits with API Keys
API keys grant authenticated rate limits, which are significantly higher than anonymous limits:With API Key
- 60 requests/minute
- 5000 requests/day
- Access to management endpoints
- Private stats support
Without API Key
- 20 requests/minute
- 1000 requests/day
- Cannot manage URLs
- Public URLs only
Security Best Practices
1
Store Keys Securely
- Use environment variables, not hardcoded values
- Never commit keys to version control
- Use
.gitignoreto exclude files containing keys
2
Use Minimal Scopes
- Grant only the permissions needed
- Create separate keys for different purposes
- Use
shorten:createfor simple automation, notadmin:all
3
Rotate Keys Regularly
- Set expiration dates on keys
- Rotate keys every 90-180 days
- Revoke old keys after rotation
Key Limits
Maximum Active Keys
20 keys per userOnly non-revoked keys count toward this limit.
Creation Rate Limit
5 keys per hourPrevents abuse and key spam.
Troubleshooting
401 Unauthorized - Invalid token
401 Unauthorized - Invalid token
403 Forbidden - Insufficient permissions
403 Forbidden - Insufficient permissions
Possible causes:
- API key missing required scope
- Trying to access someone else’s resources
429 Too Many Requests - Rate limit exceeded
429 Too Many Requests - Rate limit exceeded
Possible causes:
- Exceeded 60 requests per minute
- Exceeded 5000 requests per day
- Key creation limit (5 per hour)
Key not showing full token
Key not showing full token
Cause: Security feature - tokens are only shown once at creation.Solution: Create a new API key if you lost the original.

