The Freemius API uses Bearer authentication to secure API requests. This chapter details the authentication process and security best practices.
The API uses the standard Bearer authentication scheme. You need to include your API key in the Authorization header of your requests:
Authorization: Bearer YOUR_API_KEY
According to the API specification, you can obtain the API Key from the Freemius Developer Dashboard for a product or a store.
The API defines the following security scheme:
type: http
scheme: bearer
All authenticated requests must include:
- The Authorization header with your Bearer token
- Proper Content-Type header (application/json)
Example of an authenticated request:
curl -X GET "https://api.freemius.com/v1/products/{product_id}.json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"
Common authentication-related HTTP status codes:
401 Unauthorized
: Invalid or missing authentication credentials403 Forbidden
: Valid authentication but insufficient permissions
-
Secure Storage
- Never expose your API key in client-side code
- Store API keys securely in environment variables or secure configuration files
-
Key Management
- Use different API keys for different environments (development, production)
- Regularly rotate API keys for security
-
Error Handling
- Implement proper error handling for authentication failures
- Log authentication errors appropriately without exposing sensitive details
Once you've set up authentication, you can:
- Learn about Core Concepts
- Start working with Products
- Explore User Management