Rollback Deploy History
Endpoint
POST /apiops/projects/{projectName}/apiProxies/{apiProxyName}/deploy-histories/{revision}/rollback/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| apiProxyName | string | Yes | API Proxy name |
| revision | integer | Yes | Deploy history revision number to rollback to |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| environmentName | string | No | If 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
| Field | Type | Description |
|---|---|---|
| status | string | Request status (SUCCESS or FAILURE) |
| resultMessage | string | Operation 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
environmentNameis 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
environmentNameis 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.
Related Documentation
- List Deploy History - List all deploy history records
- Deploy API Proxy - Deploy API proxy to environment
- Get Deploy History Detail - Get full detail of a deploy history record