Extend Download URL Expiry

Extend download URL expiration for continued access to converted files

POST /api/v1/extend-sasPOST

Overview

This endpoint allows you to extend the expiration time of download URLs for converted files. By default, download URLs expire after 24 hours for security. This endpoint enables continued access to your converted documents by extending the expiration time.

Important Note

You cannot extend the expiry of any file once it has already expired, as expired files are automatically deleted from our servers for security and storage optimization.

🔗 Extended Access

Keep your download URLs active for continued access to converted files.

📦 Multiple Files

Extend download expiry for multiple files at once with a single request.

🛡️ Secure Access

Maintain secure, time-limited access to your converted files.

Important Notes

File Deletion Policy
  • • Files are permanently deleted after download URL expiration
  • • Extensions must be requested before file deletion
  • • Deleted files cannot be recovered or re-extended
  • • Re-processing is required for deleted files

Request Format

Single File Extension

JSON Request Body
{
 "job_id": "conv_1234567890abcdef",
 "extension_hours": 168
}

cURL Example

curl -X POST https://api.markdownconverters.com/api/v1/extend-sas \
 -H "X-API-Key: your_api_key_here" \
 -H "Content-Type: application/json" \
 -d '{
 "job_id": "conv_1234567890abcdef",
 "extension_hours": 168
 }'

Batch Extension

Batch Request Body
{
 "job_ids": [
 "conv_1234567890abcdef",
 "conv_2345678901bcdefg", 
 "conv_3456789012cdefgh"
 ],
 "extension_hours": 72
}

cURL Example

curl -X POST https://api.markdownconverters.com/api/v1/extend-sas \
 -H "X-API-Key: your_api_key_here" \
 -H "Content-Type: application/json" \
 -d '{
 "job_ids": [
 "conv_1234567890abcdef",
 "conv_2345678901bcdefg"
 ],
 "extension_hours": 72
 }'

Request Parameters

ParameterTypeRequiredDescription
job_idstringConditional*Single job ID to extend (required for single extension)
job_idsarrayConditional*Array of job IDs for batch extension
extension_hoursnumberYesHours to extend access (1-720)

* Either job_id or job_ids is required, but not both.

Extension Hours Guidelines

Common Extensions

  • • 24 hours: Short-term access
  • • 72 hours: Weekend access
  • • 168 hours: 1 week extension
  • • 720 hours: 30 days (maximum)

Validation Rules

  • • Minimum: 1 hour
  • • Maximum: 720 hours per extension
  • • Must be whole number
  • • Cannot exceed total lifetime limit

Response Formats

Single Extension Success

Extension Successful (200 OK)
{
 "job_id": "conv_1234567890abcdef",
 "filename": "document.pdf",
 "original_sas_url": "https://mdconverterstorage.blob.core.windows.net/converted-files/conv_1234567890abcdef.md?sp=r&st=2024-01-01T12:00:00Z&se=2024-01-08T12:00:00Z&spr=https&sv=2022-11-02&sr=b&sig=...",
 "new_sas_url": "https://mdconverterstorage.blob.core.windows.net/converted-files/conv_1234567890abcdef.md?sp=r&st=2024-01-01T12:00:00Z&se=2024-01-15T12:00:00Z&spr=https&sv=2022-11-02&sr=b&sig=...",
 "expiration_info": {
 "original_expiry": "2024-01-08T12:00:00Z",
 "new_expiry": "2024-01-15T12:00:00Z",
 "extension_hours": 168,
 "total_valid_hours": 336
 },
 "file_info": {
 "file_size": 2048576,
 "created_at": "2024-01-01T12:00:00Z",
 "last_accessed": "2024-01-05T15:30:00Z"
 },
 "limits": {
 "max_extension_hours": 720,
 "remaining_extensions": 2,
 "max_total_lifetime_hours": 8760
 }
}

Batch Extension Response

Batch Extension (200 OK)
{
 "batch_id": "ext_batch_1234567890",
 "total_jobs": 3,
 "successful_extensions": 2,
 "failed_extensions": 1,
 "results": [
 {
 "job_id": "conv_1234567890abcdef",
 "status": "success",
 "filename": "document1.pdf",
 "new_sas_url": "https://mdconverterstorage.blob.core.windows.net/converted-files/conv_1234567890abcdef.md?sp=r&st=2024-01-01T12:00:00Z&se=2024-01-04T12:00:00Z&spr=https&sv=2022-11-02&sr=b&sig=...",
 "new_expiry": "2024-01-04T12:00:00Z"
 },
 {
 "job_id": "conv_2345678901bcdefg",
 "status": "success", 
 "filename": "document2.docx",
 "new_sas_url": "https://mdconverterstorage.blob.core.windows.net/converted-files/conv_2345678901bcdefg.md?sp=r&st=2024-01-01T12:00:00Z&se=2024-01-04T12:00:00Z&spr=https&sv=2022-11-02&sr=b&sig=...",
 "new_expiry": "2024-01-04T12:00:00Z"
 },
 {
 "job_id": "conv_3456789012cdefgh",
 "status": "failed",
 "filename": "document3.pptx",
 "error": {
 "code": "FILE_EXPIRED",
 "message": "The file has already been deleted and cannot be extended",
 "suggestion": "File was deleted after expiration. Please re-process the original document."
 }
 }
 ]
}

Error Response

Extension Failed (400 Bad Request)
{
 "error": "Extension limit exceeded",
 "code": "EXTENSION_LIMIT_EXCEEDED",
 "message": "Cannot extend SAS token. Maximum extension limit of 720 hours exceeded.",
 "details": {
 "job_id": "conv_1234567890abcdef",
 "current_total_hours": 600,
 "requested_extension_hours": 168,
 "max_total_hours": 720,
 "remaining_extension_hours": 120
 },
 "suggestion": "Request a smaller extension or re-process the file to reset the timer."
}

Response Fields

Single Extension Fields

FieldTypeDescription
job_idstringThe conversion job identifier
filenamestringOriginal filename of the converted file
original_sas_urlstringPrevious SAS URL (now expired or expiring soon)
new_sas_urlstringNew SAS URL with extended expiration

Expiration Information

FieldTypeDescription
original_expirystringPrevious expiration time (ISO 8601)
new_expirystringNew expiration time (ISO 8601)
extension_hoursnumberHours added in this extension
total_valid_hoursnumberTotal hours from creation to new expiry

Limits Information

FieldTypeDescription
max_extension_hoursnumberMaximum hours per single extension
remaining_extensionsnumberNumber of extensions remaining
max_total_lifetime_hoursnumberMaximum total hours for file lifetime

Error Codes

Common Error Scenarios

FILE_EXPIRED

File Already Deleted

File was deleted after SAS token expiration

EXTENSION_LIMIT_EXCEEDED

Extension Limit Reached

Maximum extension hours exceeded for this file

JOB_NOT_FOUND

Invalid Job ID

The specified job ID does not exist

INVALID_EXTENSION_HOURS

Invalid Extension Duration

Extension hours must be between 1 and 720

Best Practices

Optimization Tips

  • • Extend tokens before they expire to avoid file deletion
  • • Use batch extensions for multiple files to reduce API calls
  • • Monitor expiration times and set up automated extensions
  • • Request appropriate extension durations based on usage patterns

Security Considerations

  • • Don't share SAS URLs publicly or store them in client-side code
  • • Update your applications with new SAS URLs after extension
  • • Consider the principle of least privilege for access duration
  • • Log and monitor SAS URL usage for security auditing