API Versioning
The Telesoft Healthcare API uses versioning to ensure backward compatibility while allowing for improvements and new features. This documentation outlines our versioning strategy and how to work with different API versions.
Versioning Strategy
Telesoft uses a date-based versioning scheme to make it easy to understand when changes were introduced. All API requests include a version in the URL path, and we maintain backward compatibility for all non-deprecated versions.
Version Format
Our API versions follow this format: YYYY-MM-DD
For example: v2023-01-15
represents the API version released on January 15, 2023.
// Example of a versioned API request
https://api.telesoft.us/v2023-01-15/diagnostics/analyze
Current API Versions
Version | Status | End of Life |
---|---|---|
v2023-10-15 | Current | â |
v2023-04-30 | Stable | April 30, 2024 |
v2022-11-15 | Deprecated | November 15, 2023 |
v2022-05-01 | Sunset | No longer available |
Version Lifecycle
Each API version goes through several phases during its lifecycle:
Preview
New versions may be made available in preview before they become the current version. Preview versions are subject to change and should not be used in production environments.
Preview versions are accessible through a special URL format: https://api.telesoft.us/preview/YYYY-MM-DD/resource
Current
The latest stable version of the API. This version includes all the newest features and improvements. We recommend using the current version for new integrations.
Stable
Previous versions of the API that are still fully supported. These versions will continue to work as documented for at least 12 months after they are succeeded by a newer version.
Deprecated
Versions that are scheduled for sunset. Deprecated versions will continue to function but will be removed at a specified future date. When using a deprecated version, API responses will include a deprecation warning header.
Example deprecation header:
Telesoft-API-Deprecation: version=v2022-11-15; sunset=2023-11-15; please migrate to v2023-04-30 or later
Sunset
Versions that are no longer available. Requests to sunset versions will receive a 410 Gone response with information about which versions are currently supported.
â ī¸ Version Support Policy
Telesoft guarantees that API versions will be supported for a minimum of 12 months after a newer version is released. We will provide at least 90 days notice before sunsetting any API version.
Specifying API Versions
In API Requests
There are two ways to specify which API version you want to use:
1. URL Path (Recommended)
Include the version in the URL path:
// Example request with version in URL path
https://api.telesoft.us/v2023-04-30/patients/pat_1a2b3c4d5e6f
2. Accept Header
Specify the version in the Telesoft-Version
header:
// Example request with version in header
GET /patients/pat_1a2b3c4d5e6f HTTP/1.1
Host: api.telesoft.us
Authorization: Bearer YOUR_API_KEY
Telesoft-Version: 2023-04-30
đĄ Best Practice
We recommend using the URL path method for version specification as it is more explicit and ensures that API clients are aware of which version they are using. If both methods are used, the URL path version takes precedence.
Using the SDK
When using the Telesoft SDK, you can specify the API version during initialization:
// JavaScript/TypeScript SDK
const telesoft = new TelesoftAI({
apiKey: 'YOUR_API_KEY',
environment: 'production',
apiVersion: '2023-04-30' // Specify the version you want to use
});
// Python SDK
from telesoft.healthcare import TelesoftAI
telesoft = TelesoftAI(
api_key="YOUR_API_KEY",
environment="production",
api_version="2023-04-30" # Specify the version you want to use
)
If you don't specify a version, the SDK will use the latest stable version by default.
Breaking vs. Non-Breaking Changes
Understanding which types of changes require a new API version helps you plan your integration strategy.
Breaking Changes (Require New Version)
- Removing or renaming fields in API responses
- Changing the type or format of existing fields
- Adding required request parameters
- Removing API endpoints
- Changing the URL structure or resource naming
- Modifying the behavior of existing functionality in a way that could break existing integrations
Non-Breaking Changes (No Version Change)
- Adding new API endpoints
- Adding new optional request parameters
- Adding new fields to API responses
- Changing error messages (but not error codes)
- Performance improvements
- Bug fixes that don't change the documented behavior
âšī¸ Note
Even for non-breaking changes, your application should be designed to handle new fields gracefully. Always use a parsing approach that ignores unknown fields to ensure forward compatibility.
Migrating Between Versions
When a new API version is released, you should plan to migrate your integration to take advantage of new features and ensure long-term compatibility.
Migration Strategy
- Review the changelog: Understand what's changed in the new version
- Update your SDK: Make sure you're using an SDK version that supports the new API version
- Test in development: Update your code and test thoroughly in a non-production environment
- Gradually roll out changes: Consider using feature flags to gradually migrate your code
- Monitor error rates: After deployment, watch for any increase in API errors
Example Migration Guide: v2022-11-15 to v2023-04-30
// Change 1: Patient object structure changes
// Before (v2022-11-15)
{
"id": "pat_1a2b3c4d5e6f",
"name": "John Doe",
"dob": "1980-01-15",
"gender": "male", // Deprecated field
"contact": {
"email": "john.doe@example.com",
"phone": "+1-555-123-4567"
}
}
// After (v2023-04-30)
{
"id": "pat_1a2b3c4d5e6f",
"name": "John Doe",
"dob": "1980-01-15",
"sex": "male", // Renamed from "gender"
"gender_identity": "male", // New field
"contact_info": { // Renamed from "contact"
"email": "john.doe@example.com",
"phone": "+1-555-123-4567",
"preferred_method": "email" // New field
}
}
To migrate your code:
// Before (using v2022-11-15)
function getPatientGender(patient) {
return patient.gender;
}
function getPatientContact(patient) {
return patient.contact;
}
// After (using v2023-04-30)
function getPatientGender(patient) {
// Handle both versions
return patient.sex || patient.gender || 'unknown';
}
function getPatientContact(patient) {
// Handle both versions
return patient.contact_info || patient.contact || {};
}
đĄ Migration Tip
Consider writing adapter functions that normalize data between versions. This allows you to update your API client code while maintaining backward compatibility in your application logic.
Version Changelog
Below is a summary of major changes introduced in each API version:
v2023-10-15 (Current)
New Features
- Added real-time diagnostic streaming API
- Added support for medical image analysis
- Improved medical terminology recognition with 20% better accuracy
Breaking Changes
- Renamed
analysis_result
fields todiagnostic_result
for consistency - Changed structure of confidence score objects to provide more detailed uncertainty metrics
- Modified authentication token format for improved security
v2023-04-30
New Features
- Added support for bulk operations for patients and diagnostic records
- Introduced medical knowledge graph API for retrieving medical entity relationships
- Added webhooks for real-time notifications
Breaking Changes
- Renamed
gender
field tosex
and added separategender_identity
field - Restructured patient contact information
- Changed pagination mechanism from offset-based to cursor-based
v2022-11-15 (Deprecated)
New Features
- Added differential diagnosis capability
- Introduced drug interaction checking API
- Added support for medical record attachments
Breaking Changes
- Modified error response format to include more detailed diagnostic information
- Changed authentication mechanism from API key in URL to Authorization header
- Restructured diagnostic response format to support confidence scores