---
title: "Rollback to a previous deployment"
method: POST
path: "/projects/{project_id}/deployments/{deployment_id}/rollback"
tags: ["deployments"]
---

# Rollback to a previous deployment

`POST /projects/{project_id}/deployments/{deployment_id}/rollback`

Re-deploy the model from a previous deployment record.

The rolled-back deployment may be either a training-job deployment or a
base-model deployment; this endpoint handles both shapes by mirroring
whichever target was set on the source record.

Args:
    project_id: Project to roll back.
    deployment_id: Deployment record whose target will be re-activated.
    auth: Authenticated user.

Returns:
    DeploymentResponse for the new rollback deployment record.

Raises:
    400: If the historical deployment targets a base model that is no
        longer in the catalog.
    403: If the user does not have access to the project.
    404: If the deployment record is not found for this project.

## Path parameters

- `project_id` string, uuid, required
- `deployment_id` string, uuid, required

## Response `200`

Successful Response

- DeploymentResponse — A single deployment history record. A deployment targets exactly one of ``training_job_id`` or ``base_model``: the trained adapter that was activated, or the base catalog model that was activated when no adapter is in use. Attributes: id: Unique deployment record ID. project_id: The project whose active model was changed. training_job_id: Training job that was deployed (training-job shape). base_model: HuggingFace base model ID that was deployed (base-model shape). deployed_by: User ID who triggered the deployment. reason: Optional reason for the swap. deployed_at: When the swap occurred.
  - `id` string, required
  - `project_id` string, required
  - `training_job_id` string, nullable
  - `base_model` string, nullable
  - `deployed_by` string, required
  - `reason` string, nullable, required
  - `deployed_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pioneer/apis/brain-api.md) · [All operations](https://skmtc.net/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pioneer/brain-api/versions/31dfe831e079/schema)
