API Versioning
Overview
Smart Academic Hub uses URI versioning for API management.
Versioning Strategy
URI Versioning
All API endpoints are prefixed with the version number:
/api/v1/academies
/api/v2/academies (future)
Current Version
Version 1.1 (/api/v1/)
Version Management
Controllers
Controllers are organized by version:
app/Http/Controllers/Api/V1/
app/Http/Controllers/Api/V2/ (future)
Routes
Routes are grouped by version:
Route::prefix('v1')->group(function () {
// V1 routes
});
Backward Compatibility
- Maintain previous versions during transition periods
- Deprecation notices in response headers
- Documentation for migration paths
Breaking Changes
Breaking changes require a new major version:
- Removing endpoints
- Changing response structure
- Modifying required parameters
Non-Breaking Changes
Can be added to existing versions:
- Adding optional parameters
- Adding new endpoints
- Adding fields to responses
Deprecation Policy
- Announce deprecation 6 months in advance
- Support old version for migration period
- Provide clear migration documentation
- Set deprecation headers
Best Practices
- Always specify version in API calls
- Don't mix versions in single application
- Plan version upgrades carefully
- Test thoroughly before upgrading