Authentication
All Blockline API endpoints require authentication using API keys. This guide explains how to obtain, use, and manage your API keys securely.API Key Format
Blockline uses bearer token authentication with two types of API keys:- Production keys:
sk_live_prefix - Use in production environments - Test keys:
sk_test_prefix - Use for development and testing
sk_live_abcd....7890
Getting Your API Key
1
Create an account
Sign up at blockline.soltop.sh if you haven’t already
2
Access the dashboard
Navigate to Dashboard → API Keys
3
Generate a new key
- Click “Create New API Key” 2. Give your key a descriptive name (e.g., “Production API”, “Dev Testing”) 3. Optionally set an expiration date 4. Click “Generate”
4
Save your key
Using Your API Key
Include your API key in theAuthorization header of every request:
Best Practices
Store keys securely
Store keys securely
- Never commit keys to version control - Add them to
.gitignore - Use environment variables - Store keys in
.envfiles or secure vaults - Rotate keys regularly - Generate new keys periodically and revoke old ones
- Use separate keys for different environments - One for production, one for development
Protect your keys
Protect your keys
- Don’t expose in client-side code - API keys should only be used server-side - Don’t log keys - Sanitize logs to prevent accidental exposure - Use HTTPS only - Always make requests over HTTPS (not HTTP) - Revoke compromised keys immediately - If a key is exposed, revoke it in the dashboard
Monitor usage
Monitor usage
- Check “Last Used” timestamps in the dashboard
- Review API usage patterns for anomalies
- Set up alerts for unusual activity
- Track which keys are being used for what purposes
Managing API Keys
View All Keys
Visit your API Keys dashboard to see:- Key prefix (e.g.,
sk_live_xxxxxx...) - Name and description
- Created date
- Last used timestamp
- Expiration date (if set)
Revoke a Key
To revoke an API key:- Go to Dashboard → API Keys
- Find the key you want to revoke
- Click Revoke or the trash icon
- Confirm the action
Key Rotation
It’s good practice to rotate API keys periodically:- Generate a new API key
- Update your applications to use the new key
- Test that everything works with the new key
- Revoke the old key
Subscription Requirements
API keys must be associated with an active subscription. Subscription statuses:- ✅ Trial - Free trial period with full access
- ✅ Active - Paid subscription in good standing
- ✅ Grace Period - Brief period after subscription expires
- ❌ Expired - No access, 403 errors returned
Error Responses
401 Unauthorized
Cause: Invalid, missing, or revoked API key- Verify the key is correctly formatted:
Bearer sk_live_...orBearer sk_test_... - Check that the key hasn’t been revoked in the dashboard
- Ensure you’re including the
Authorizationheader