Ana içeriğe atla

Endpoint

POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/deploy-histories/{revision}/rollback/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
apiProxyNamestringYesAPI Proxy name
revisionintegerYesDeploy history revision number to rollback to

Query Parameters

ParameterTypeRequiredDescription
environmentNamestringNoIf provided, the rolled-back API Proxy is automatically deployed to this environment after rollback.

Request Body

This endpoint does not require a request body.

Response

Success Response (200 OK) - Rollback Only

{
  "status": "SUCCESS",
  "resultMessage": "API Proxy rolled back successfully to deploy history revision (12)."
}

Success Response (200 OK) - Rollback with Deploy

{
  "status": "SUCCESS",
  "resultMessage": "API Proxy rolled back successfully to deploy history revision (12). Deployed to environment: production"
}

Partial Success Response (200 OK) - Rollback Succeeded, Deploy Failed

{
  "status": "SUCCESS",
  "resultMessage": "API Proxy rolled back successfully but deployment failed: Connection refused"
}

Response Fields

FieldTypeDescription
statusstringRequest status (SUCCESS or FAILURE)
resultMessagestringOperation result message with details

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "Rollback failed for deploy history revision (12)!"
}

Common Causes

  • Deploy history record with the given revision does not exist
  • Environment name does not exist (when environmentName is provided)
  • API Proxy snapshot in the deploy history is corrupted

Error Response (401 Unauthorized)

{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}

cURL Examples

Rollback Only (No Deploy)

curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/petstore-api/deploy-histories/12/rollback/" \
  -H "Authorization: Bearer YOUR_TOKEN"

Rollback and Deploy

curl -X POST \
  "https://demo.apinizer.com/apiops/projects/MyProject/apiProxies/petstore-api/deploy-histories/12/rollback/?environmentName=production" \
  -H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Configuration Rollback: This operation restores the API Proxy configuration (routing, policies, settings) to the state captured in the deploy history record.
  • Deploy List Preserved: The list of environments the API Proxy is allowed to deploy to is always taken from the current state, not from the historical snapshot.
  • Optional Deploy: When environmentName is provided, the rolled-back configuration is deployed to the specified environment in a single atomic operation.
  • Deploy Failure: If the optional deploy fails, the rollback itself is still applied. The API Proxy configuration is updated, but you need to deploy manually.

Permissions

User must have API_MANAGEMENT + MANAGE permission in the project.