Skip to main content

Rollback Agent

Rolls an agent back to a previous version. Optionally cleans up failed deployments.

POST /api/v1/agents/{agent_id}/rollback — 🔒 Requires Auth

Path Parameters

ParameterDescription
agent_idAgent UUID

Request Body

FieldTypeRequiredDescription
target_versionstringVersion to roll back to. Omit for the previous version.
cleanup_failedbooleanRemove failed deployments (default: true)
reasonstringReason for rollback (logged)

Examples

# Roll back to previous version
curl -X POST https://nasiko.dev/api/v1/agents/agent-abc123/rollback \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{"reason": "Performance regression in 1.1.0"}'

# Roll back to specific version
curl -X POST https://nasiko.dev/api/v1/agents/agent-abc123/rollback \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{"target_version": "1.0.0", "reason": "Critical bug in 1.1.0"}'

Response

{
"data": {
"message": "Rollback successful",
"agent_id": "agent-abc123",
"rolled_back_to": "1.0.0",
"rolled_back_from": "1.1.0",
"status": "running",
"status_code": 200
}
}