Authorization header of every request.
Authentication method
Quickleap uses Bearer token authentication. All API requests must include anAuthorization header with your token:
withCredentials: true) and supports cookie-based authentication for browser environments.
Obtaining your API token
To get your API token:- Log in to your Quickleap dashboard
- Navigate to Settings → API Tokens
- Click Generate New Token
- Copy and securely store your token
Making authenticated requests
Include your token in theAuthorization header of every API request:
Authentication errors
The API returns specific error codes for authentication failures:Missing token
If you don’t include anAuthorization header, you’ll receive a 401 Unauthorized response:
Invalid token
If your token is invalid or malformed:Expired token
If your token has expired:When you receive an expired token error, obtain a new token from your dashboard or refresh your authentication session.
Token storage best practices
Server-side applications
For server-side applications, store your API token securely using environment variables:Client-side applications
For browser-based applications, the Quickleap API supports cookie-based authentication. The client automatically includes cookies with requests whenwithCredentials: true is set.
For browser applications, consider using cookie-based authentication instead of storing tokens in localStorage to prevent XSS attacks.
CI/CD and automation
For CI/CD pipelines and automation scripts:- Store tokens in your CI/CD platform’s secret management system
- Inject tokens as environment variables at runtime
- Never hardcode tokens in scripts or configuration files
- Use different tokens for different environments (development, staging, production)
Request interceptors
The Quickleap API client includes request interceptors that:- Automatically add tokens - Tokens from cookies are added to every request
- Trim data - Request data is automatically trimmed of whitespace
- Set headers - Content-Type and custom headers are automatically configured
Security best practices
Use HTTPS only
Always use HTTPS for API requests. The Quickleap API rejects requests over HTTP.
Rotate tokens regularly
Regenerate your API tokens periodically to minimize security risks.
Use environment variables
Never hardcode tokens in your application code or commit them to version control.
Implement token refresh
Handle token expiration gracefully by implementing automatic token refresh logic.
Token permissions
API tokens have the same permissions as your user account. They can:- Create, read, update, and delete redirects
- Access all analytics data
- Manage rules and conditions
- Modify account settings
Revoking tokens
To revoke an API token:- Go to Settings → API Tokens in your dashboard
- Find the token you want to revoke
- Click Revoke or Delete
401 Unauthorized errors.
Testing authentication
Test your authentication setup with a simple request:Next steps
API overview
Learn about API resources and concepts
Redirects
Start managing redirects via API
Analytics
Access analytics data programmatically
Error handling
Handle API errors gracefully