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

# Revert to version by number

> Creates a **new** version whose `assetData` is copied from the specified version number. Non-destructive — existing history is preserved and the revert appears as a new entry at the head. Use a positive integer for `versionId`.




## OpenAPI

````yaml /openapi.yaml post /assets/{assetId}/versions/{versionId}
openapi: 3.1.0
info:
  title: Versuno Public API
  description: >
    The Versuno Public API lets you manage AI assets, projects, and version
    history programmatically.


    All endpoints except key management require a Bearer API key in the
    `Authorization` header.

    API keys are formatted as
    `uk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`.
  version: 1.0.0
  contact:
    email: support@versuno.ai
servers:
  - url: https://versuno.ai/api/public
    description: Production
  - url: http://localhost:3000/api/public
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Verify API key validity and retrieve the caller's identity.
  - name: Teams
    description: Teams the authenticated user owns or is an active member of.
  - name: Assets
    description: AI assets — prompts, personas, contexts, system prompts, and skills.
  - name: Asset Trash
    description: Single-asset soft-delete, restore, and permanent delete lifecycle.
  - name: Bulk Asset Trash
    description: Bulk trash operations across multiple assets at once.
  - name: Projects
    description: Project folders for organising assets and teams.
  - name: Project Trash
    description: Project trash lifecycle — trashing deletes the entire subtree.
  - name: Versioning
    description: Full-snapshot version history with non-destructive revert support.
  - name: Public Brains
    description: >-
      Graph-based knowledge structures composed of containers (folders/groups)
      and nodes (content items). Read the graph, or run semantic RAG queries
      against it.
  - name: Memory
    description: >-
      The universal agent-memory layer. Capture coding-agent memory, recall it
      semantically, and resolve contradictions. Capture-only, scoped to your API
      key's account.
  - name: Key Management
    description: >-
      Create, update, and delete API keys. These endpoints do not require a
      Bearer token.
paths:
  /assets/{assetId}/versions/{versionId}:
    post:
      tags:
        - Versioning
      summary: Revert to version by number
      description: >
        Creates a **new** version whose `assetData` is copied from the specified
        version number. Non-destructive — existing history is preserved and the
        revert appears as a new entry at the head. Use a positive integer for
        `versionId`.
      operationId: revertToVersionByNumber
      parameters:
        - name: assetId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: versionId
          in: path
          required: true
          description: Positive integer version number (e.g. `2`).
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                commitDescription:
                  type: string
                  maxLength: 2000
                  description: >-
                    Custom message. Defaults to "Reverted to version N" if
                    omitted.
      responses:
        '201':
          description: Newly created revert version object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Version'
        '400':
          description: >-
            Invalid assetId, versionId is not a positive integer, or
            `commitDescription` exceeds 2000 chars.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '404':
          description: No version with that number found for this asset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
components:
  schemas:
    Version:
      type: object
      description: A full-snapshot version checkpoint of an asset.
      required:
        - assetId
        - assetType
        - versionNumber
        - assetData
        - userId
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for this version.
          example: d4e5f6a7-b8c9-0123-def0-234567890123
        assetId:
          type: string
          format: uuid
          description: ID of the asset this version belongs to.
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        assetType:
          type: string
          enum:
            - prompt
            - persona
            - context
            - system_prompt
            - skill
          description: Type of the parent asset.
          example: prompt
        versionNumber:
          type: integer
          description: Monotonically increasing version number within the asset.
          example: 3
        commitDescription:
          anyOf:
            - type: string
            - type: 'null'
          description: Optional message describing what changed in this version.
          example: Updated tone to be more empathetic
        assetData:
          type: object
          description: >-
            Full snapshot of the asset state at the time this version was saved.
            Returned exactly as stored (no key normalization).
          example:
            title: SKILL
            content: |-
              fdasfsd

              fdsafdsa
            description: null
            emoji: null
            tags: []
            files: []
            is_public: false
            block_ids:
              - b_015729a2-f530-40b0-aa65-6f3efadc967e
              - b_55000bce-0e51-45d6-bd64-3962ec8b948b
            content_blocks:
              - id: b_015729a2-f530-40b0-aa65-6f3efadc967e
                type: paragraph
                meta: {}
                content: fdasfsd
              - id: b_55000bce-0e51-45d6-bd64-3962ec8b948b
                type: paragraph
                meta: {}
                content: fdsafdsa
        userId:
          type: string
          format: uuid
          description: ID of the user who created this version.
          example: b2c3d4e5-f6a7-8901-bcde-f12345678901
        createdAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when this version was saved.
          example: '2026-01-20T14:45:00.000Z'
        user:
          type: object
          description: Author profile.
          properties:
            id:
              type: string
              format: uuid
              example: b2c3d4e5-f6a7-8901-bcde-f12345678901
            fullName:
              type: string
              example: Alex Johnson
            username:
              type: string
              example: alexj
            avatarUrl:
              anyOf:
                - type: string
                - type: 'null'
              example: https://versuno.ai/avatars/alexj.png
    Error400:
      type: object
      properties:
        error:
          type: string
          example: 'Wrong data: assetType is required'
    Error401:
      type: object
      properties:
        error:
          type: string
          example: Invalid API key
    Error404:
      type: object
      properties:
        error:
          type: string
          example: Not found
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Versuno API key. Must be prefixed with `Bearer`. Format: `Bearer
        uk_live_...`
      x-default: Bearer uk_live_your_api_key_here

````