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

# POST /stack/copy



## OpenAPI

````yaml /api-reference/trust-accounting/openapi.json post /stack/copy
openapi: 3.0.3
info:
  title: Stax API (stack, tpa, document)
  description: >-
    Routes under /stack, /tpa, and /document. Parameters and JSON bodies are
    inferred from Express handlers; multipart and streaming responses are called
    out explicitly. Session auth uses cookies userId + authToken or headers
    x-user-id + x-auth-token; API keys use Authorization.
  version: 1.0.0
servers:
  - url: /
    description: Relative to API host
security: []
tags:
  - name: stack
    description: Stack (workspace) operations
  - name: tpa
    description: Trust plan accounting (TPA)
  - name: document
    description: Document operations
paths:
  /stack/copy:
    post:
      tags:
        - stack
      summary: POST /stack/copy
      operationId: post_stack_copy
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                source:
                  oneOf:
                    - type: string
                    - type: object
                      additionalProperties: true
                    - type: array
              additionalProperties: true
      responses:
        '200':
          description: JSON response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  stack:
                    $ref: '#/components/schemas/Stack'
                additionalProperties: true
        '401':
          description: Not authorized
      security:
        - SessionCookies: []
          UserIdCookie: []
        - ApiKeyAuth: []
components:
  schemas:
    Stack:
      type: object
      description: Stack (classification workspace) document
      properties:
        _id:
          $ref: '#/components/schemas/ObjectId'
        path:
          type: string
        team:
          $ref: '#/components/schemas/ObjectId'
        template:
          $ref: '#/components/schemas/ObjectId'
        baseName:
          type: string
        base:
          $ref: '#/components/schemas/ObjectId'
        restrict:
          type: boolean
        access:
          type: array
          items:
            $ref: '#/components/schemas/ObjectId'
        pinned:
          type: boolean
        hideHint:
          type: boolean
        enabled:
          type: boolean
        lastModified:
          $ref: '#/components/schemas/ISODateString'
        numDocuments:
          type: integer
        numUnread:
          type: integer
        keys:
          type: array
          items:
            type: string
        dataTypes:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              dataType:
                type: string
            additionalProperties: true
        rules:
          type: object
          additionalProperties: true
        trainer:
          type: object
          additionalProperties: true
        numMovedFiles:
          type: integer
        pipeline:
          type: array
          items:
            type: object
            additionalProperties: true
        locked:
          type: boolean
        forms:
          type: array
          items:
            $ref: '#/components/schemas/ObjectId'
        tags:
          type: array
          items:
            type: string
      additionalProperties: true
    ObjectId:
      type: string
      pattern: ^[a-fA-F0-9]{24}$
      description: 24-character hexadecimal MongoDB ObjectId
    ISODateString:
      type: string
      format: date-time
      description: ISO-8601 timestamp
  securitySchemes:
    SessionCookies:
      type: apiKey
      in: cookie
      name: authToken
      description: Session token (with userId cookie or x-user-id / x-auth-token headers)
    UserIdCookie:
      type: apiKey
      in: cookie
      name: userId
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: Authorization header (API key flow)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.