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

# Copy a space's structure

> Creates a space with the source's default status, statuses, priorities, tags and folders. Not tasks, description, record configs or bindings. People only: integration tokens are refused. `staging: true` needs an account root or admin.



## OpenAPI

````yaml /api-reference/endpoint/workspaces/openapi.json post /workspaces/space/{space_id}/copy-structure
openapi: 3.0.3
info:
  title: Workspaces Service API
  version: 1.0.0
  description: API for managing workspaces, tasks, and comments
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /workspaces/space/{space_id}/copy-structure:
    post:
      tags:
        - Sandbox
      summary: Copy a space's structure
      description: >-
        Creates a space with the source's default status, statuses, priorities,
        tags and folders. Not tasks, description, record configs or bindings.
        People only: integration tokens are refused. `staging: true` needs an
        account root or admin.
      parameters:
        - name: space_id
          in: path
          required: true
          description: Space id. Case-insensitive; canonical form is upper case.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CopyStructureRequest'
      responses:
        '200':
          description: The new space.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Space'
        '400':
          description: >-
            Bad request: `name` or `space_id` missing, or an unreadable body. No
            `code`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            Not authenticated, or the integration token was revoked
            (`token_revoked`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Forbidden: `scope_denied`, `integration_not_allowed` for an
            integration bearer outside workspaces, the new id is a system Space
            id, or `staging: true` was sent by a caller who is not root or
            admin.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '`space_not_found`: the source does not exist.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '`space exists`: a Space with the new id already exists.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The space was created but not every folder was copied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: The source space could not be read. Retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CopyStructureRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        id:
          type: string
          description: >-
            Defaults to the upper-cased name with non-word runs replaced by `_`,
            at most 32 characters.
        staging:
          type: boolean
          description: Needs an account root or admin.
      required:
        - name
    Space:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        url:
          type: string
          readOnly: true
          description: UI URL to navigate directly to this space
        name:
          type: string
        description:
          type: string
        default_status:
          type: string
        statuses:
          type: array
          items:
            $ref: '#/components/schemas/SpaceStatus'
        owner:
          type: string
          readOnly: true
          description: ID of the user who created the space, set by the backend
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        record_config_ids:
          type: array
          items:
            type: string
        default_record_config_id:
          type: array
          items:
            type: string
        priorities:
          type: array
          items:
            type: object
            additionalProperties: true
        tags:
          type: array
          items:
            type: object
            additionalProperties: true
        staging:
          type: boolean
          description: >-
            Marks a space for testing. Only root and admin users can set it.
            Staging spaces can be reset.
        distribution_bindings:
          type: array
          readOnly: true
          description: >-
            Connections to other accounts. Present on a space connected through
            distribution.
          items:
            type: object
            additionalProperties: true
            properties:
              distribution_id:
                type: string
              product_id:
                type: string
              side:
                type: string
                enum:
                  - publisher
                  - distributor
              counterparty_account_id:
                type: string
              counterparty_name:
                type: string
              folder:
                type: string
              required_roles:
                type: array
                items:
                  type: string
              status_map:
                type: object
                additionalProperties:
                  type: string
              bound_at:
                type: string
                format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code. Branch on this, not on `error`.
      required:
        - error
    SpaceStatus:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
          description: e.g. To Do, In Progress, Done
        color:
          type: string
        order:
          type: integer
        is_visible:
          type: boolean
          nullable: true
        complete:
          type: boolean
          description: >-
            If true, when a task reaches this state, it will not be considered
            overdue past the due date.
          example: true
        role:
          type: string
          description: >-
            What the status means, such as `intake`, `acknowledged`, `working`
            or `done`. Used to map statuses between connected accounts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Authorization header using the Bearer scheme
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````

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