---
title: "Rollback Agent Config"
method: POST
path: "/agents/{job_id}/config/rollback"
tags: ["Agents"]
---

# Rollback Agent Config

`POST /agents/{job_id}/config/rollback`

Roll a config-based agent back to a historical version.

Writes a new version N+1 whose config equals the target's stored
snapshot, records ``change_kind='rollback'`` + ``rollback_source_version``
on the new history row, and redeploys the agent. Never a pointer swap,
never destructive. If current validators reject the historical config
(validator tightening between then and now), returns 422 with Pydantic's
error text so the FE can highlight the offending fields.

## Path parameters

- `job_id` string, required

## Request body

- RollbackAgentConfigRequest — Request body for ``POST /agents/{id}/config/rollback``.
  - `targetVersion` integer, required — The existing version number whose config will be copied into a new version. Version 0 is the initial ``change_kind='create'`` snapshot.
  - `note` string, nullable — Optional user-supplied context - recorded on the new rollback row.

## Response `200`

Successful Response

- AppModelsApiAgentsApiModelsFlinkJobsFlinkJobResponse
  - `_id` string, required
  - `name` string, required
  - `job_type` 'pyflink' | 'jar' | 'agent_config' | 'knowledge_base', required
  - `status` 'CREATED' | 'DEPLOYING' | 'RUNNING' | 'CANCELLING' | 'CANCELLED' | 'FAILED' | 'FINISHED', required
  - `desired_status` 'CREATED' | 'DEPLOYING' | 'RUNNING' | 'CANCELLING' | 'CANCELLED' | 'FAILED' | 'FINISHED'
  - `flink_job_name` string, required
  - `flink_job_id` string, nullable
  - `parallelism` integer
  - `error_message` string, nullable
  - `agent_config` object, nullable
  - `created_by` string, nullable
  - `created_timestamp` string, date-time, nullable
  - `updated_timestamp` string, date-time, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/streamkap/apis/streamkap-rest-api.md) · [All operations](https://skmtc.net/streamkap/apis/streamkap-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/streamkap/streamkap-rest-api/revisions/8aea6143d003/schema)
