> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamkap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rollback Agent Config

> 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.



## OpenAPI

````yaml /openapi/openapi.json post /agents/{job_id}/config/rollback
openapi: 3.1.0
info:
  title: Streamkap REST API
  description: >-
    The Streamkap REST API allows you to programmatically manage your CDC
    pipelines, sources, destinations, transforms, and more.


    Authenticate using a bearer token obtained from the [Access
    Token](/api-reference/auth/access-token) endpoint with your API client
    credentials.
  contact:
    name: Streamkap Support
    url: https://streamkap.com/
    email: support@streamkap.com
  license:
    name: Proprietary
  version: 2.0.0
servers:
  - url: https://api.streamkap.com
    description: Production
security: []
tags:
  - name: Agents
    description: Create, deploy, and manage Flink-based AI agents.
  - name: Agents Observability
    description: >-
      Read-only views over the MCP audit log: agent rollup, sessions, spans,
      histograms, external-agent verify.
  - name: Alerts
    description: Manage alert subscribers, preferences, and notification credentials.
  - name: Authentication
    description: Obtain and refresh access tokens, manage client credentials and roles.
  - name: Billing
    description: Retrieve usage metrics, summaries, and export billing data.
  - name: Consumer Groups
    description: List, inspect, and reset Kafka consumer group offsets.
  - name: Dashboard
    description: Retrieve organisation-level statistics and overview data.
  - name: Destinations
    description: Create, configure, and manage data destinations and their lifecycle.
  - name: Kafka Access
    description: Manage Kafka users and their access permissions.
  - name: Logs
    description: Query and summarise system logs.
  - name: Pipelines
    description: Create, configure, and manage CDC pipelines and their lifecycle.
  - name: Project Keys
    description: Manage project keys that bundle API credentials and optional Kafka access.
  - name: Schema Registry
    description: Browse schema subjects, versions, and retrieve schema definitions.
  - name: Services
    description: View and switch service metadata.
  - name: Sources
    description: >-
      Create, configure, and manage data sources, snapshots, and their
      lifecycle.
  - name: Tags
    description: Create, update, and manage resource tags for organisation.
  - name: Topics
    description: Browse topic details, statistics, configurations, metrics, and messages.
  - name: Transforms
    description: >-
      Create, deploy, and manage data transforms, unit tests, and implementation
      details.
paths:
  /agents/{job_id}/config/rollback:
    post:
      tags:
        - Agents
      summary: Rollback Agent Config
      description: >-
        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.
      operationId: rollbackAgentConfig
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RollbackAgentConfigRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/app__models__api__agents_api_models__flink_jobs__FlinkJobResponse
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - FronteggHTTPAuthentication: []
components:
  schemas:
    RollbackAgentConfigRequest:
      properties:
        targetVersion:
          type: integer
          minimum: 0
          title: Targetversion
          description: >-
            The existing version number whose config will be copied into a new
            version. Version 0 is the initial ``change_kind='create'`` snapshot.
        note:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Note
          description: Optional user-supplied context - recorded on the new rollback row.
      additionalProperties: false
      type: object
      required:
        - targetVersion
      title: RollbackAgentConfigRequest
      description: Request body for ``POST /agents/{id}/config/rollback``.
    app__models__api__agents_api_models__flink_jobs__FlinkJobResponse:
      properties:
        _id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        job_type:
          $ref: >-
            #/components/schemas/app__models__api__agents_api_models__flink_jobs__FlinkJobTypeEnum
        status:
          $ref: '#/components/schemas/FlinkJobStatusEnum'
        desired_status:
          anyOf:
            - $ref: '#/components/schemas/FlinkJobStatusEnum'
            - type: 'null'
        flink_job_name:
          type: string
          title: Flink Job Name
        flink_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Flink Job Id
        parallelism:
          type: integer
          title: Parallelism
          default: 1
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        agent_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Agent Config
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        created_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created Timestamp
        updated_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated Timestamp
      additionalProperties: true
      type: object
      required:
        - _id
        - name
        - job_type
        - status
        - flink_job_name
      title: FlinkJobResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    app__models__api__agents_api_models__flink_jobs__FlinkJobTypeEnum:
      type: string
      enum:
        - pyflink
        - jar
        - agent_config
        - knowledge_base
      title: FlinkJobTypeEnum
    FlinkJobStatusEnum:
      type: string
      enum:
        - CREATED
        - DEPLOYING
        - RUNNING
        - CANCELLING
        - CANCELLED
        - FAILED
        - FINISHED
      title: FlinkJobStatusEnum
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    FronteggHTTPAuthentication:
      type: http
      scheme: bearer

````