This document outlines FlowFi's policy for deprecating and sunsetting API endpoints. Our goal is to provide clear communication and sufficient time for consumers to migrate to new versions.
- Transparency - Clear communication about deprecations
- Stability - Maintain backward compatibility within versions
- Migration Support - Provide tools and documentation for migration
- Reasonable Timeline - Give consumers adequate time to adapt
When an endpoint is marked for deprecation:
-
Add deprecation headers to responses:
X-API-Deprecated: true X-API-Sunset-Date: YYYY-MM-DD X-API-Migration-Path: /v2/new-endpoint -
Update documentation with deprecation notice
-
Add to CHANGELOG.md with migration guide
-
Notify consumers via:
- GitHub releases
- API documentation updates
- Response headers (for programmatic detection)
During this period:
- ✅ Endpoint continues to function normally
- ✅ Deprecation headers included in all responses
- ✅ Documentation clearly marked as deprecated
- ✅ Migration guides available
- ❌ No new features added to deprecated endpoint
- ❌ Only critical security fixes applied
After the sunset date:
- Endpoint returns
410 Gonestatus - Response includes migration information
- Endpoint removed from active codebase
- Documentation archived
Day 0: Announcement - Headers added, docs updated
Month 1-6: Deprecation period - Endpoint works with warnings
Month 6+: Sunset - Endpoint returns 410 Gone
Status Code: 200 OK (or original status)
Headers:
X-API-Deprecated: true
X-API-Sunset-Date: 2024-12-31
X-API-Migration-Path: /v1/streams
Body: Normal response (unchanged)
Status Code: 410 Gone
Headers:
X-API-Deprecated: true
X-API-Sunset-Date: 2024-12-31
X-API-Migration-Path: /v1/streams
Body:
{
"error": "Deprecated endpoint",
"message": "This endpoint has been deprecated. Please use /v1/streams instead.",
"deprecated": true,
"migration": {
"old": "/streams",
"new": "/v1/streams"
},
"sunsetDate": "2024-12-31"
}- Changing request/response structure
- Removing required fields
- Changing field data types
- Removing endpoints
- Changing authentication requirements
- Adding optional fields
- Adding new endpoints
- Adding new query parameters
- Adding new response fields
- Performance improvements
- Bug fixes
- Migration guides for each deprecated endpoint
- Code examples showing old vs new usage
- Common pitfalls and solutions
- Health endpoint shows supported versions
- Deprecation headers for programmatic detection
- Clear error messages with migration paths
- GitHub releases for major deprecations
- API changelog updates
- Response headers for automatic detection
Endpoints:
/streams→/v1/streams/events→/v1/events
Status: Deprecated (as of 2024-02-21)
Sunset Date: 2024-12-31
Migration:
// Before
fetch('/streams')
// After
fetch('/v1/streams')const response = await fetch('/api/endpoint');
const isDeprecated = response.headers.get('X-API-Deprecated') === 'true';
if (isDeprecated) {
const sunsetDate = response.headers.get('X-API-Sunset-Date');
const migrationPath = response.headers.get('X-API-Migration-Path');
console.warn(`Endpoint deprecated. Sunset: ${sunsetDate}`);
console.info(`Migrate to: ${migrationPath}`);
}Always use versioned endpoints:
// ✅ Good - Explicit version
const api = 'https://api.flowfi.io/v1';
// ❌ Bad - No version
const api = 'https://api.flowfi.io';- Don't wait until sunset date
- Test new versions in staging
- Update gradually if possible
- Monitor for breaking changes
Check supported versions:
const health = await fetch('https://api.flowfi.io/health');
const { apiVersions } = await health.json();
if (!apiVersions.supported.includes('v1')) {
console.error('v1 no longer supported!');
}If a security vulnerability requires immediate removal:
- Immediate deprecation notice
- Minimum 30-day grace period (if possible)
- Emergency communication to all known consumers
- Extended support for critical enterprise customers (if applicable)
Breaking changes within a version are not allowed. If breaking changes are needed:
- Create a new version (e.g., v2)
- Deprecate old version following this policy
- Provide migration guide
v1 (Current)
├─ Active development
├─ New features added
└─ Bug fixes applied
v1 (Deprecated) [Future]
├─ No new features
├─ Security fixes only
└─ Migration period
v1 (Sunset) [Future]
└─ Returns 410 Gone
For questions about deprecations or migrations:
- Open an issue on GitHub
- Check the API Versioning Guide
- Review the CHANGELOG.md