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

# Duplicate an existing package

> Creates a full copy of the package identified by its slug. Every configurable element is copied — SKU lines with their per-SKU regions, category rules, bundle references, used-equipment preferences, instructions and delivery settings. The copy starts active with no one assigned, gets a new slug and friendly id, and its name is suffixed with " (Copy)". PATCH the result to rename or adjust it. This mirrors the admin UI's Duplicate action, which pre-populates a new-package editor so integrators do not have to re-pick products.



## OpenAPI

````yaml /openapi.json post /api/v1/packages/{slug}/duplicate
openapi: 3.1.0
info:
  title: Firstbase API Specification
  description: Integration endpoints for Firstbase
  version: 0.1.0
servers:
  - url: https://apipub.firstbasehq.com
    description: Production
security:
  - ApiKey: []
tags:
  - name: Catalog
    description: Browse SKUs, brands, and categories
  - name: Inventory
    description: Query and manage inventory items and assets
  - name: Inventory Levels
    description: Configure inventory levels by SKU and warehouse
  - name: Inventory Orders
    description: Create and manage inventory orders
  - name: ITAD
    description: IT asset disposition requests
  - name: New Joiners
    description: Track and remind new joiners
  - name: Offices
    description: Manage office locations
  - name: Orders
    description: Create and track equipment orders
  - name: Packages
    description: Manage equipment packages
  - name: People
    description: Provision and manage users
  - name: Regions
    description: Query regions
  - name: Replacements
    description: Create and manage equipment replacements
  - name: Returns
    description: Create and manage returns
  - name: Shipment
    description: Look up shipments and carriers
  - name: Shipment Notices
    description: Create and manage shipment notices
  - name: Warehouses
    description: Query warehouses
paths:
  /api/v1/packages/{slug}/duplicate:
    post:
      tags:
        - Packages
      summary: Duplicate an existing package
      description: >-
        Creates a full copy of the package identified by its slug. Every
        configurable element is copied — SKU lines with their per-SKU regions,
        category rules, bundle references, used-equipment preferences,
        instructions and delivery settings. The copy starts active with no one
        assigned, gets a new slug and friendly id, and its name is suffixed with
        " (Copy)". PATCH the result to rename or adjust it. This mirrors the
        admin UI's Duplicate action, which pre-populates a new-package editor so
        integrators do not have to re-pick products.
      operationId: duplicatePackage
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Package duplicated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPackageResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '403':
          description: Endpoint not enabled for this organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '404':
          description: Package not found for the authenticated organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
        '409':
          description: Package cannot be duplicated (e.g. name collision)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiHttpErrors'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -sS -X POST
            'https://apipub.firstbasehq.com/api/v1/packages/{slug}/duplicate' \
              -H 'Authorization: ApiKey YOUR_API_KEY' \
              -H 'Accept: application/json'
components:
  schemas:
    GetPackageResponse:
      type: object
      description: Package details returned by get/list package endpoints
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the package
        name:
          type: string
          description: Display name of the package.
        automaticOrder:
          type: boolean
          description: >-
            When true, assigning this package can trigger automatic equipment
            ordering
        approvalRequired:
          type: boolean
          description: When true, orders from this package require admin approval
        requireJustification:
          type: boolean
          description: When true, requesters must provide a justification when ordering
        slug:
          type: string
          description: URL-safe unique identifier for the package
        active:
          type: boolean
          description: Whether the package is active
        skuIds:
          type: array
          description: SKU UUIDs included in this package
          items:
            type: string
            format: uuid
        assignedTo:
          $ref: '#/components/schemas/PackageAssignedToResponse'
          description: People currently assigned to this package
        notes:
          type: array
          description: Notes associated with the package
          items:
            $ref: '#/components/schemas/PackageNoteResponse'
        deliverySetting:
          type: string
          description: Where package equipment should be delivered
          enum:
            - PERSON
            - OFFICE
            - FLEXIBLE
        defaultOfficeId:
          type: string
          format: uuid
          description: Default office UUID used when the delivery setting targets an office
        regions:
          type: array
          description: >-
            Regions stored on this package. Persisted in `package_region` rows
            and maintained when the package's SKU lines change — not derived at
            read time.
          items:
            $ref: '#/components/schemas/PackageRegionResponse'
        skuLines:
          type: array
          description: Category SKU lines with per-SKU region scoping
          items:
            $ref: '#/components/schemas/PackageSkuLineResponse'
        rules:
          type: array
          description: Category quantity rules for the package
          items:
            $ref: '#/components/schemas/PackageRuleResponse'
        bundleLines:
          type: array
          description: Bundle references attached to this package
          items:
            $ref: '#/components/schemas/PackageBundleLineResponse'
        usedEquipmentPreferences:
          type: array
          description: Used-equipment preferences per category
          items:
            $ref: '#/components/schemas/UsedEquipmentPrefResponse'
      required:
        - active
        - approvalRequired
        - automaticOrder
        - bundleLines
        - id
        - name
        - notes
        - regions
        - requireJustification
        - rules
        - skuLines
        - slug
        - usedEquipmentPreferences
    PublicApiHttpErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PublicApiError'
          description: List of error details.
      required:
        - errors
    PackageAssignedToResponse:
      type: object
      description: People assigned to a package
      properties:
        people:
          type: array
          description: Person UUIDs assigned to this package
          items:
            type: string
            format: uuid
    PackageNoteResponse:
      type: object
      description: Package note details
      properties:
        id:
          type: string
          format: uuid
          description: Package note unique identifier
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        note:
          type: string
          description: Note text
          example: Remember to include the welcome letter
        active:
          type: boolean
          description: Whether the note is active
          example: true
      required:
        - id
    PackageRegionResponse:
      type: object
      description: Region summary stored on a package
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the region
        name:
          type: string
          description: Human-readable name of the region
        code:
          type: string
          description: Short code identifying the region
      required:
        - code
        - id
        - name
    PackageSkuLineResponse:
      type: object
      description: SKU line with region scoping for a package
      properties:
        skuId:
          type: string
          format: uuid
          description: SKU UUID
        vendorCode:
          type: string
          description: Vendor code for the SKU; null when the SKU has no vendor
        vendorSku:
          type: string
          description: Vendor SKU identifier
        regions:
          type: array
          description: Regions selected for this SKU line
          items:
            $ref: '#/components/schemas/PackageRegionResponse'
      required:
        - regions
        - skuId
        - vendorSku
    PackageRuleResponse:
      type: object
      description: A rule within a package
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the rule
          example: 3a68a467-8733-4c8d-a942-16ed7ec33018
        category_code:
          type: string
          description: Product category code this rule applies to
          example: LAPTOP
        quantity:
          type: integer
          format: int32
          description: Number of items allowed or required for this category
          example: 1
        optional:
          type: boolean
          description: When true, this category rule is optional
          example: false
        allowed_product_ids:
          type: array
          description: >-
            Product UUIDs allowed by this rule; empty means no product
            restriction
          items:
            type: string
            format: uuid
      required:
        - category_code
        - id
        - optional
        - quantity
    PackageBundleLineResponse:
      type: object
      description: Bundle reference line on a package
      properties:
        productGroupId:
          type: string
          format: uuid
          description: Product group UUID
        friendlyId:
          type: string
          description: Human-friendly product group identifier (GRP-*)
        name:
          type: string
          description: Display name of the bundle
        sortOrder:
          type: integer
          format: int32
          description: Sort order of this bundle within the package
      required:
        - friendlyId
        - name
        - productGroupId
        - sortOrder
    UsedEquipmentPrefResponse:
      type: object
      description: Used-equipment preference for a category
      properties:
        categoryCode:
          type: string
          description: Product category code
        preference:
          type: string
          description: Used-equipment preference value
          enum:
            - NEW_FIRST
            - NEW_ONLY
            - USED_FIRST
            - USED_ONLY
        inStockOnly:
          type: boolean
          description: When true, only in-stock products are shown for this category
      required:
        - categoryCode
        - inStockOnly
        - preference
    PublicApiError:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable description of the error
          example: Invalid request
        source:
          type: string
          description: >-
            Entity or field path that caused the error (for example order,
            shipmentNotice, or person:email)
          example: request
      required:
        - detail
        - source
  securitySchemes:
    ApiKey:
      type: apiKey
      description: Prefix the value with "ApiKey" to indicate the custom authorization type
      name: Authorization
      in: header

````

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