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

# Duplicate Workspace Version

> Duplicate this workspace version to a new workspace



## OpenAPI

````yaml /api-reference/swagger.yml post /v2/workspaces/{workspaceId}/versions/{versionId}/duplicate
openapi: 3.0.0
info:
  version: 1.0.0
  title: Prisme.ai APIs
  description: Prisme.ai APIs specifications
  termsOfService: https://www.prisme.ai/mentions-legales
  contact:
    name: Prisme.ai Support Team
    email: support@prisme.ai
    url: https://www.prisme.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.studio.prisme.ai
    description: Prisme.ai Cloud
  - url: https://{customDomain}
    description: Self-hosted Prisme.ai instance
    variables:
      customDomain:
        default: api.your-prisme-instance.com
        description: API hostname of your self-hosted Prisme.ai deployment
  - url: http://localhost:3001
    description: Local development
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
  - BearerAuth: []
    OrgApiKeyAuth: []
tags:
  - name: API Gateway
    description: >-
      Authentication, session management, SSO providers, and user profile
      endpoints.
  - name: Prisme.ai Workspaces
    description: >-
      CRUD operations for workspaces and their resources (pages, apps,
      automations, imports, variables).
  - name: Prisme.ai Runtime
    description: Execute workspace automations and manage their runtime lifecycle.
  - name: Prisme.ai Events
    description: Event ingestion, delivery, and subscription filtering across the platform.
  - name: Organizations
    description: >-
      Manage organizations, members, roles, invites, groups, and org-level
      service accounts.
  - name: Subscriptions
    description: >-
      Manage organization subscription plans and tier assignments (SuperAdmin
      only).
  - name: Secrets
    description: Read and patch encrypted key-value secrets scoped to a workspace.
  - name: ApiKeys
    description: Create, list, rotate, and validate workspace-scoped API keys.
  - name: Permissions
    description: >-
      Share or unshare resources (workspaces, pages, …) with users via roles or
      fine-grained rules.
  - name: Monitoring
    description: Platform readiness checks across services (SuperAdmin only).
  - name: AuthProviders
paths:
  /v2/workspaces/{workspaceId}/versions/{versionId}/duplicate:
    post:
      tags:
        - Prisme.ai Workspaces
      summary: Duplicate Workspace Version
      description: Duplicate this workspace version to a new workspace
      operationId: duplicateWorkspaceVersion
      parameters:
        - name: workspaceId
          in: path
          description: Workspace id
          required: true
          schema:
            type: string
        - name: versionId
          in: path
          description: Version name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        '401':
          description: AuthenticationError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationError'
        '403':
          description: Bad permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Object not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectNotFoundError'
components:
  schemas:
    Workspace:
      $ref: '#/components/schemas/DSUL'
    AuthenticationError:
      type: object
      properties:
        error:
          type: string
          example: AuthenticationError
        message:
          type: string
          example: Unauthenticated
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: ForbiddenError
        message:
          type: string
          example: Forbidden
    ObjectNotFoundError:
      type: object
      properties:
        error:
          type: string
          example: ObjectNotFound
        message:
          type: string
    DSUL:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          pattern: "^[0-9A-Za-zÀ-ÖØ-öø-ÿ ,.'-\_]{1,60}$"
        description:
          $ref: '#/components/schemas/LocalizedText'
        photo:
          type: string
        config:
          $ref: '#/components/schemas/Config'
        blocks:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Block'
        slug:
          type: string
        id:
          type: string
        labels:
          type: array
          items:
            type: string
            pattern: ^[0-9A-Za-z._:-]{2,60}$
        customDomains:
          type: array
          items:
            type: string
        registerWorkspace:
          type: boolean
          description: >-
            If true, make this workspace metadata available to all workspaces
            with this variable : {{global.workspacesRegistry[WORKSPACE_SLUG]}}
        repositories:
          type: object
          description: Remote versioning repositories
          additionalProperties:
            $ref: '#/components/schemas/WorkspaceRepository'
        platformRepositories:
          type: object
          description: Platform remote versioning repositories
          additionalProperties:
            $ref: '#/components/schemas/WorkspaceRepository'
        secrets:
          type: object
          additionalProperties: false
          properties:
            schema:
              additionalProperties:
                $ref: '#/components/schemas/TypedArgument'
        events:
          $ref: '#/components/schemas/WorkspaceEventsConfiguration'
        writeLock:
          $ref: '#/components/schemas/WorkspaceWriteLock'
    LocalizedText:
      oneOf:
        - type: object
          additionalProperties:
            type: string
          example:
            fr: Bonjour
            en: Hello
        - type: string
          example: Bonjour
    Config:
      type: object
      additionalProperties: false
      properties:
        schema:
          additionalProperties:
            $ref: '#/components/schemas/TypedArgument'
        block:
          type: string
        value: {}
    Block:
      type: object
      description: Block
      additionalProperties: false
      properties:
        description:
          $ref: '#/components/schemas/LocalizedText'
        name:
          $ref: '#/components/schemas/LocalizedText'
        photo:
          type: string
        url:
          type: string
          description: >-
            A block can be a javascript bundled file. Host it on the internet
            and put its url here.
          deprecated: true
        edit:
          $ref: '#/components/schemas/TypedArgument'
          deprecated: true
        block:
          type: string
          description: A block can extends another one by giving its name here
          deprecated: true
        config:
          $ref: '#/components/schemas/AnyValue'
          description: default config applied to the Block. Usefull for extended Blocks.
          deprecated: true
        automation:
          oneOf:
            - type: string
            - type: object
              properties:
                slug:
                  type: string
                payload:
                  $ref: '#/components/schemas/AnyValue'
        blocks:
          type: array
          items:
            type: object
            required:
              - slug
            properties:
              slug:
                type: string
              appInstance:
                type: string
              onInit:
                oneOf:
                  - type: string
                  - type: object
                    properties:
                      event:
                        type: string
                      payload:
                        $ref: '#/components/schemas/AnyValue'
              updateOn:
                type: string
              automation:
                oneOf:
                  - type: string
                  - type: object
                    properties:
                      slug:
                        type: string
                      payload:
                        $ref: '#/components/schemas/AnyValue'
            additionalProperties: true
        css:
          type: string
          description: Css applied to Block
        schema:
          $ref: '#/components/schemas/TypedArgument'
    WorkspaceRepository:
      type: object
      required:
        - name
        - config
      additionalProperties: false
      properties:
        name:
          type: string
        type:
          type: string
          enum:
            - git
            - archive
            - filesystem
        mode:
          type: string
          enum:
            - read-write
            - read-only
        config:
          anyOf:
            - $ref: '#/components/schemas/WorkspaceGitRepositoryConfig'
            - $ref: '#/components/schemas/WorkspaceFilesystemRepositoryConfig'
            - type: object
        groups:
          type: array
          description: >-
            Only for platform repositories fetched from the Platform workspaces
            ; indicates which groups can be pulled/pushed
          items:
            type: string
        pull:
          type: object
          properties:
            exclude:
              type: array
              items:
                type: object
                required:
                  - path
                properties:
                  path:
                    type: string
    TypedArgument:
      type: object
      properties:
        type:
          type: string
          enum:
            - string
            - number
            - object
            - array
            - boolean
            - localized:string
            - localized:number
            - localized:boolean
        format:
          type: string
        properties:
          additionalProperties:
            type: object
            description: >-
              Recursive reference to `TypedArgument` — nesting is truncated here
              to avoid the infinite expansion that crashes the API reference
              renderer.
        title:
          $ref: '#/components/schemas/LocalizedText'
        description:
          $ref: '#/components/schemas/LocalizedText'
        items:
          type: object
          description: >-
            Recursive reference to `TypedArgument` — nesting is truncated here
            to avoid the infinite expansion that crashes the API reference
            renderer.
        ui:widget:
          type: string
        ui:options:
          type: object
      example:
        type: string
        title:
          en: User ID
        description:
          en: The unique identifier of the user
        secret:
          type: boolean
        event:
          type: boolean
    WorkspaceEventsConfiguration:
      type: object
      additionalProperties: false
      properties:
        mapping:
          type: object
          additionalProperties: true
          description: >-
            Custom mapping which will be directly sent to underlying database
            (Elasticsearch/Opensearch)
        types:
          description: Custom configuration per event type
          additionalProperties:
            $ref: '#/components/schemas/WorkspaceEventConfiguration'
    WorkspaceWriteLock:
      type: object
      description: >-
        Lock preventing writes during versioning operations or unresolved merge
        conflicts
      additionalProperties: false
      properties:
        lockedAt:
          type: string
        lockedBy:
          type: string
          description: User ID who initiated the lock
        reason:
          type: string
          description: Reason for the lock (e.g., pull_in_progress, merge_conflict)
    AnyValue: {}
    WorkspaceGitRepositoryConfig:
      type: object
      required:
        - url
        - branch
      properties:
        url:
          type: string
        branch:
          type: string
        dirpath:
          type: string
          description: >-
            Sub-directory path within the repository where the workspace is
            stored
        auth:
          type: object
          properties:
            user:
              type: string
            password:
              type: string
            sshkey:
              type: string
    WorkspaceFilesystemRepositoryConfig:
      type: object
      required:
        - dirpath
      properties:
        dirpath:
          type: string
          description: Absolute path to the directory containing workspace folders
    WorkspaceEventConfiguration:
      type: object
      additionalProperties: false
      properties:
        schema:
          additionalProperties:
            $ref: '#/components/schemas/TypedArgument'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key

````