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

# Roll back to a version, or save a labeled checkpoint

> Two actions on an agent's version history:

- **`rollback`**: restore the agent's live config from an earlier
  snapshot. This rewrites the live agent row (the source of truth the
  runtime reads) and repoints `publishedVersionId` — so the change
  takes effect immediately. Requires `versionId`.
- **`checkpoint`**: append a version snapshotting the current live
  config, with an optional `label`. Useful for marking a known-good
  state before a round of edits. De-duplicated if nothing changed.

Requires agent management permission or `org:admin`.




## OpenAPI

````yaml /openapi.yaml post /agents/versions
openapi: 3.1.0
info:
  title: AsterAgents API
  version: 1.0.0
  description: >
    API for AsterAgents platform operations.


    - **Admin endpoints** (`/admin/*`) require organization admin privileges
    (`org:admin` role)

    - **Agent endpoints** (`/agents`) require agent management permissions or
    `org:admin` role

    - **Knowledge base endpoints** (`/kb/*`) require standard authentication

    - **Skills endpoints** (`/skills/*`) require standard authentication

    - **File endpoints** (`/upload/*`, `/kb/files`, `/skills/files`) require
    standard authentication
  contact:
    name: AsterAgents Support
    url: https://asteragents.com/support
servers:
  - url: https://asteragents.com/api
    description: Production
  - url: http://localhost:3000/api
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Users
    description: Manage active organization users
  - name: Invitations
    description: Manage organization invitations
  - name: Files
    description: Upload and manage files
  - name: Knowledge Bases
    description: Manage knowledge bases and their files
  - name: Knowledge Base Management
    description: Create, update, and delete knowledge bases
  - name: Agents
    description: Create, update, and delete agents
  - name: Agent Tags
    description: Organize agents with tags
  - name: Tools
    description: Discover the tool catalog available to your organization
  - name: Skills
    description: Manage agent skills
  - name: Skill Files
    description: Manage bundled files for skills
  - name: Conversations
    description: Invoke agents and retrieve conversation history and messages
  - name: Scheduled Tasks
    description: Schedule agents to run automatically on a cron schedule
paths:
  /agents/versions:
    post:
      tags:
        - Agents
      summary: Roll back to a version, or save a labeled checkpoint
      description: |
        Two actions on an agent's version history:

        - **`rollback`**: restore the agent's live config from an earlier
          snapshot. This rewrites the live agent row (the source of truth the
          runtime reads) and repoints `publishedVersionId` — so the change
          takes effect immediately. Requires `versionId`.
        - **`checkpoint`**: append a version snapshotting the current live
          config, with an optional `label`. Useful for marking a known-good
          state before a round of edits. De-duplicated if nothing changed.

        Requires agent management permission or `org:admin`.
      operationId: agentVersionAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agentId
                - action
              properties:
                agentId:
                  type: integer
                  example: 1
                action:
                  type: string
                  enum:
                    - rollback
                    - checkpoint
                versionId:
                  type: integer
                  description: Version to restore (required when `action` is `rollback`)
                  example: 17
                label:
                  type: string
                  description: >-
                    Optional note for the version (used when `action` is
                    `checkpoint`)
                  example: before reworking the system prompt
            examples:
              rollback:
                summary: Roll back to an earlier version
                value:
                  agentId: 1
                  action: rollback
                  versionId: 17
              checkpoint:
                summary: Save a labeled checkpoint of the current config
                value:
                  agentId: 1
                  action: checkpoint
                  label: before reworking the system prompt
      responses:
        '200':
          description: Action completed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  publishedVersionId:
                    type: integer
                    description: The version now reflected by the agent's live config
              example:
                success: true
                publishedVersionId: 17
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          description: Agent or version not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  responses:
    BadRequest:
      description: Bad Request - Invalid parameters or user not part of organization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: User is not part of any organization
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal Server Error
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Bad Request
        details:
          type: array
          items:
            type: object
            additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        JWT token from Clerk authentication.

        Must be from a user with `org:admin` role.

````