ReferenceFlightcontrol APIServicesSwap Blue-Green

Swap Blue-Green API

Use this API to swap the Blue and Green environments for a service configured with Blue-Green deployments.

API Description

MethodPath
POST/v1/services/{serviceId}/swap-blue-green
Headers
AuthorizationBearer: [API key]

Full Endpoint URL https://api.flightcontrol.dev/v1/services/{serviceId}/swap-blue-green

Request

This endpoint does not require a request body. The swap operation is triggered by the POST request itself.

Path Parameters

  • serviceId (required) - The ID of the service to swap. Must be configured with Blue-Green deployment.

Example Request

curl -X POST \
  https://api.flightcontrol.dev/v1/services/cm2jl6r8p0000k08o5shg2z5a/swap-blue-green \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "success": true,
  "message": "Blue-Green swap initiated successfully"
}

Response Conditions

Success

Errors

Notes

  • The swap operation is asynchronous and may take several minutes to complete
  • The swap process updates load balancer routing
  • You can swap back to the previous version by calling this endpoint again (instant rollback)