API Authentication
All SnapTimers API requests require authentication using an API key. This guide explains how to create and use API keys.
Requirements
API access requires a Pro plan or higher. Upgrade from your Account settings to enable API access.
Creating an API Key
- 1.Go to Account → API
- 2.Click "Create API Key"
- 3.Give your key a descriptive name (e.g., "Production")
- 4.Select the scopes you need
- 5.Copy and securely store the key immediately
Important: The full API key is only shown once. If you lose it, you'll need to create a new one.
Key Format
SnapTimers API keys follow this format:
st_XXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX- •
st_prefix identifies SnapTimers keys - • First 8 characters are a public identifier
- • Remaining characters are the secret
Using Your API Key
Include your API key in the request headers:
Authorization Header (Recommended)
Authorization: Bearer st_your_api_keyX-API-Key Header (Alternative)
X-API-Key: st_your_api_keyExample Request
cURL
curl https://www.snaptimers.com/api/v1/timers \ -H "Authorization: Bearer st_your_api_key" \ -H "Content-Type: application/json"
API Key Scopes
| Scope | Description |
|---|---|
| timers:read | List and get timer details |
| timers:write | Create, update, delete timers |
| analytics:read | View timer analytics |
| usage:read | View account usage stats |
Security Best Practices
- ✓Never commit API keys to version control
- ✓Use environment variables for key storage
- ✓Create separate keys for development and production
- ✓Use minimal scopes needed for each key
- ✓Rotate keys periodically
- ✓Revoke unused or compromised keys immediately