Overview
The validate endpoint checks if a license key is valid and can be used on the current machine. This endpoint uses Redis caching for performance and implements machine binding to prevent license sharing.Endpoint
This endpoint is rate-limited to 5 requests per IP address within a 15-minute window.
Request
Request Body
The license key to validate
Example Request
Response
Success - Active License
Whether the license is valid and active
License status:
"active", "pending", "expired", "revoked", "invalid", or "machine_mismatch"License duration (e.g., β12 monthsβ)
Expiration timestamp in milliseconds
Example Response - Active
Example Response - Invalid Key
Example Response - Machine Mismatch
Example Response - Expired
Example Response - Pending Activation
Example Response - Revoked
License Status Values
License is active and valid for use on the current machine
License exists but has not been activated yet
License duration has elapsed and is no longer valid
License has been manually revoked by the developer
License key does not exist in the database
License is active but bound to a different machine
Machine Binding
When a license is activated:- The server generates a unique, hashed machine ID
- This ID is stored with the license
- Future validation requests check if the machine ID matches
- If the machine ID differs, validation fails with
machine_mismatchstatus
Caching Strategy
The validation endpoint uses Redis caching to minimize database queries and improve performance.
Cache Flow
- Cache Hit: If license is in Redis, return cached status immediately
- Cache Miss: Query MongoDB, then cache the result
- Cache Invalidation: Cache is invalidated when license status changes
Performance Benefits
- Faster validation for frequently checked licenses
- Reduced database load
- Better scalability for high-volume applications
Error Responses
Missing License Key
Status Code: 400Rate Limit Exceeded
Status Code: 429Server Error
Status Code: 500Integration Example
Hereβs a complete example of integrating license validation into your application:Best Practices
Cache Results
Cache validation results locally to minimize API calls
Handle Errors
Gracefully handle all possible status values
Retry Logic
Implement retry logic for transient failures
Offline Mode
Consider offline validation for extended network outages
See Also
- Activate License - Activate a pending license
- Create License - Create new license keys
- Machine Binding - Learn about machine binding