---
title: "Rollback to a previous deployment"
method: POST
path: "/v1/agents/{agentId}/deployments/{deploymentId}/rollback"
tags: ["Deployments"]
---

# Rollback to a previous deployment

`POST /v1/agents/{agentId}/deployments/{deploymentId}/rollback`

## Request body

- RollbackDeploymentPublicBody
  - `deploymentMessage` string

## Response `200`

Rolled-back deployment with triggered test run IDs

- MutationDeploymentPublicResponse
  - `deployment` object, required
    - `id` string, required
    - `accountId` string, required
    - `agentId` string, required
    - `environment` string, required
    - `artifactVersion` string, required
    - `version` string, required
    - `createdBy` string, required
    - `createdAt` string, required
    - `metadata` object, nullable
  - `testRunIds` string[], required

## Other responses

- `404` — Deployment not found

---

[API](https://skmtc.net/poly/apis/polyai-agents-api.md) · [All operations](https://skmtc.net/poly/apis/polyai-agents-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/poly/polyai-agents-api/revisions/76f3c606e395/schema)
