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

# Restore a version of an AI agent skill

> Publish a new version whose content equals the chosen one. Also
restores a soft-deleted skill.



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json post /api/v1/aiAgents/skills/{skillUuid}/versions/{versionNumber}/restore
openapi: 3.0.0
info:
  title: Lightdash API
  version: 2.338.0
  description: >
    Open API documentation for all public Lightdash API endpoints. #
    Authentication Before you get started, you might need to create a Personal
    Access Token to authenticate via the API. You can create a token by
    following this guide: https://docs.lightdash.com/references/personal_tokens
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
  - url: /
security: []
tags:
  - name: My Account
    description: These routes allow users to manage their own user account.
  - name: Organizations
    description: >-
      Each user is a member of a single organization. These routes allow users
      to manage their organization. Most actions are only available to admin
      users.
  - name: Projects
    description: >-
      Projects belong to a single organization. These routes allow users to
      manage their projects, browse content, and execute queries. Users inside
      an organization might have access to a project from an organization-level
      role or they might be granted access to a project directly.
  - name: Spaces
    description: >-
      Spaces allow you to organize charts and dashboards within a project. They
      also allow granular access to content by allowing you to create private
      spaces, which are only accessible to the creator and admins.
  - name: Roles & Permissions
    description: >-
      These routes allow users to manage roles and permissions for their
      organization.
    externalDocs:
      url: https://docs.lightdash.com/references/roles
  - name: Query
    description: >-
      These routes allow users to execute and manage queries against their data
      warehouse. This includes metric queries, SQL queries, and retrieving query
      results.
paths:
  /api/v1/aiAgents/skills/{skillUuid}/versions/{versionNumber}/restore:
    post:
      summary: Restore a version of an AI agent skill
      description: |-
        Publish a new version whose content equals the chosen one. Also
        restores a soft-deleted skill.
      operationId: restoreAiAgentSkillVersion
      parameters:
        - in: path
          name: skillUuid
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
        - in: path
          name: versionNumber
          required: true
          schema:
            type: number
            format: double
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiAiAgentSkillResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      security: []
components:
  schemas:
    UUID:
      type: string
      format: uuid
      description: |-
        Stringified UUIDv4.
        See [RFC 4112](https://tools.ietf.org/html/rfc4122)
      pattern: >-
        [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}
    ApiAiAgentSkillResponse:
      properties:
        results:
          $ref: '#/components/schemas/AiAgentSkill'
        status:
          type: string
          enum:
            - ok
          nullable: false
      required:
        - results
        - status
      type: object
    ApiErrorPayload:
      properties:
        error:
          properties:
            data:
              $ref: '#/components/schemas/AnyType'
              description: Optional data containing details of the error
            message:
              type: string
              description: A friendly message summarising the error
            name:
              type: string
              description: Unique name for the type of error
            statusCode:
              type: number
              format: integer
              description: HTTP status code
          required:
            - name
            - statusCode
          type: object
        status:
          type: string
          enum:
            - error
          nullable: false
      required:
        - error
        - status
      type: object
      description: |-
        The Error object is returned from the api any time there is an error.
        The message contains
    AiAgentSkill:
      allOf:
        - $ref: '#/components/schemas/AiAgentSkillSummary'
        - properties:
            parsed:
              $ref: '#/components/schemas/AiAgentSkillParsed'
            content:
              $ref: '#/components/schemas/AiAgentSkillContent'
          required:
            - parsed
            - content
          type: object
    AnyType:
      description: |-
        This AnyType is an alias for any
        The goal is to make it easier to identify any type in the codebase
        without having to eslint-disable all the time
        These are only used on legacy `any` types, don't use it for new types.
        This is added on a separate file to avoid circular dependencies.
    AiAgentSkillSummary:
      properties:
        deletedAt:
          type: string
          format: date-time
          nullable: true
        updatedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedByUserUuid:
          type: string
          nullable: true
        createdByUserUuid:
          type: string
          nullable: true
        agentUuids:
          items:
            type: string
          type: array
          description: Agents this skill is bound to.
        currentVersion:
          $ref: '#/components/schemas/AiAgentSkillVersionSummary'
        availability:
          items:
            $ref: '#/components/schemas/AiAgentSkillAvailability'
          type: array
        userInvocable:
          type: boolean
        disableModelInvocation:
          type: boolean
        argumentHint:
          type: string
          nullable: true
          description: Frontmatter fields the chat and MCP surfaces need without the body.
        description:
          type: string
        title:
          type: string
          nullable: true
        name:
          type: string
        projectUuid:
          type: string
          nullable: true
        organizationUuid:
          type: string
        uuid:
          type: string
      required:
        - deletedAt
        - updatedAt
        - createdAt
        - updatedByUserUuid
        - createdByUserUuid
        - agentUuids
        - currentVersion
        - availability
        - userInvocable
        - disableModelInvocation
        - argumentHint
        - description
        - title
        - name
        - projectUuid
        - organizationUuid
        - uuid
      type: object
    AiAgentSkillParsed:
      properties:
        resources:
          items:
            $ref: '#/components/schemas/AiAgentSkillParsedResource'
          type: array
        body:
          type: string
        frontmatter:
          $ref: '#/components/schemas/AiAgentSkillFrontmatter'
      required:
        - resources
        - body
        - frontmatter
      type: object
    AiAgentSkillContent:
      properties:
        files:
          $ref: '#/components/schemas/AiAgentSkillFiles'
        schemaVersion:
          type: number
          enum:
            - 1
          nullable: false
      required:
        - files
        - schemaVersion
      type: object
    AiAgentSkillVersionSummary:
      properties:
        createdByUserUuid:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        restoredFromVersion:
          type: number
          format: double
          nullable: true
        source:
          $ref: '#/components/schemas/AiAgentSkillVersionSource'
        contentHash:
          type: string
        versionNumber:
          type: number
          format: double
        uuid:
          type: string
      required:
        - createdByUserUuid
        - createdAt
        - restoredFromVersion
        - source
        - contentHash
        - versionNumber
        - uuid
      type: object
    AiAgentSkillAvailability:
      type: string
      enum:
        - agent
        - mcp
    AiAgentSkillParsedResource:
      properties:
        body:
          type: string
        description:
          type: string
        name:
          type: string
        fileName:
          type: string
      required:
        - body
        - description
        - name
        - fileName
      type: object
    AiAgentSkillFrontmatter:
      properties:
        compatibility:
          type: string
          nullable: true
        license:
          type: string
          nullable: true
        metadata:
          $ref: '#/components/schemas/AiAgentSkillMetadata'
        availability:
          items:
            $ref: '#/components/schemas/AiAgentSkillAvailability'
          type: array
        userInvocable:
          type: boolean
        disableModelInvocation:
          type: boolean
        arguments:
          items:
            type: string
          type: array
        argumentHint:
          type: string
          nullable: true
        whenToUse:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        description:
          type: string
        name:
          type: string
      required:
        - compatibility
        - license
        - metadata
        - availability
        - userInvocable
        - disableModelInvocation
        - arguments
        - argumentHint
        - whenToUse
        - title
        - description
        - name
      type: object
      description: Frontmatter fields Lightdash honours, after defaults are applied.
    AiAgentSkillFiles:
      properties: {}
      additionalProperties:
        type: string
      type: object
    AiAgentSkillVersionSource:
      type: string
      enum:
        - ui
        - as_code
        - restore
        - system
    AiAgentSkillMetadata:
      properties: {}
      additionalProperties:
        type: string
      type: object

````