Authentication
The sajn API uses API keys to authenticate requests. All API requests must include your API key in theAuthorization
header.
Getting Your API Key
- Log in to your sajn account at app.sajn.se
- Navigate to Organization Settings > API Keys
- Click Create API Key
- Copy your API key and store it securely
Never share your API key or commit it to version control. Treat it like a password.
Making Authenticated Requests
Include your API key in theAuthorization
header as a Bearer token:
Example with Different Languages
API Key Security Best Practices
Store securely
Store securely
Store API keys in environment variables or secure credential management systems, never in code.
Rotate regularly
Rotate regularly
Rotate your API keys periodically to minimize the impact of potential compromises.
Use separate keys
Use separate keys
Use different API keys for development, staging, and production environments.
Monitor usage
Monitor usage
Regularly review API key usage in your sajn dashboard to detect unauthorized access.
Error Responses
If authentication fails, you’ll receive a401 Unauthorized
response:
Error | Description |
---|---|
401 Unauthorized | API key is missing, invalid, or expired |
403 Forbidden | API key doesn’t have permission for this resource |
Rate Limiting
API requests are rate limited per API key:- 100 requests per minute
- 1000 requests per hour
429 Too Many Requests
response.