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

# Replace



## OpenAPI

````yaml /openapi.json post /v1/workspaces/{workspaceId}/catalog-items/{itemId}/parts/{partId}/replace
openapi: 3.1.0
info:
  title: Specurate API
  description: ''
  version: 1.0.0
  contact: {}
servers:
  - url: https://app.specurate.com/api
    description: API Server
security: []
tags: []
paths:
  /v1/workspaces/{workspaceId}/catalog-items/{itemId}/parts/{partId}/replace:
    post:
      tags:
        - Catalog Item Parts
      summary: Replace
      operationId: CatalogItemPartsController_replace_v1
      parameters:
        - name: workspaceId
          required: true
          in: path
          schema:
            type: string
        - name: itemId
          required: true
          in: path
          schema:
            type: string
        - name: partId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceCatalogItemPartDto'
      responses:
        '200':
          description: >-
            The item's parts list after the replace. Refusals: 400
            INVALID_COMPONENT_TYPE, PART_ITEM_NOT_FOUND, SELF_REFERENCE,
            MATERIAL_CANNOT_HAVE_PARTS; 404 when the item or its link is not
            found (a link already replaced by this product answers 200); 409
            CATALOG_IDENTITY_CHANGED when the link no longer holds
            `expectedPartItemId`, the product the caller saw on it (a finish
            changed meanwhile), and nothing is written; 409 DUPLICATE_PART,
            PART_HAS_OWN_PARTS, OWNER_ALREADY_USED_AS_PART, CIRCULAR_DEPENDENCY,
            PART_DEPTH_LIMIT_EXCEEDED, CATALOG_FAMILY_DISCONTINUED; 409
            LOCK_TIMEOUT while another write holds the item's or the chosen
            product's family, a duplicate of an in-flight replace included —
            retryable, and a retry after the first committed answers 200 with
            the same list.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CatalogItemPartResponseDto'
components:
  schemas:
    ReplaceCatalogItemPartDto:
      type: object
      properties:
        expectedPartItemId:
          type: string
        partItemId:
          type: string
        quantity:
          type: string
          pattern: ^(?!0+(?:\.0{1,2})?$)\d{1,16}(?:\.0{1,2})?$
        confirmRelease:
          type: boolean
      required:
        - expectedPartItemId
        - partItemId
      additionalProperties: false
    CatalogItemPartResponseDto:
      type: object
      properties:
        id:
          type: string
        itemId:
          type: string
        partItemId:
          type: string
        partItemName:
          type: string
        partFamilyId:
          type: string
        partFamilyName:
          type: string
        partFamilyType:
          type: string
          enum:
            - default
            - material
        primaryImageUrl:
          type: string
          nullable: true
        categoryName:
          type: string
        quantity:
          type: string
        createdAt:
          type: string
      required:
        - id
        - itemId
        - partItemId
        - partItemName
        - partFamilyId
        - partFamilyName
        - partFamilyType
        - primaryImageUrl
        - categoryName
        - quantity
        - createdAt

````

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