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

# Create Component Instance Link

> Endpoint to create a link between two component instances



## OpenAPI

````yaml PUT /components/instances/links
openapi: 3.1.0
info:
  title: Serial
  version: '1.0'
  description: Access and control your Serial data programmatically.
  contact:
    name: Devon Copeland
    email: support@serial.io
    url: www.serial.io
  summary: Serial API
servers:
  - url: https://api.serial.io
security:
  - serial-default-security: []
tags:
  - name: AI
    description: AI Endpoints
  - name: Auth
    description: Auth Endpoints
  - name: Companies
    description: Company Endpoints
  - name: Component Instances
    description: Component Instance Endpoints
  - name: Components
    description: Component Endpoints
  - name: Datasets
    description: Dataset Endpoints
  - name: Fields
    description: Field Endpoints
  - name: Legacy
    description: Legacy Endpoints
  - name: Part Numbers
    description: Part Number Endpoints
  - name: Processes
    description: Process Endpoints
  - name: Properties
    description: Property Endpoints
  - name: Storage
    description: Storage Endpoints
  - name: Users
    description: User Endpoints
  - name: Work Orders
    description: Work Order Endpoints
paths:
  /components/instances/links:
    put:
      tags:
        - Component Instances
      summary: Create Component Instance Link
      description: Endpoint to create a link between two component instances
      operationId: put-components-instances-links
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                parent_component_instance_id:
                  type: string
                  x-stoplight:
                    id: h65b0tvf0qzik
                  format: uuid
                  description: Database id for the parent component instance id.
                child_component_instance_id:
                  type: string
                  x-stoplight:
                    id: hc0kpbck93c06
                  format: uuid
                  description: >-
                    Database id for the child component instance id.

                    Note, if this component instance is serialized (component
                    type "SN"), then it will automatically break any links it
                    had with prior parents.
                process_entry_id:
                  type: string
                  x-stoplight:
                    id: lfnsf2u04pubn
                  description: Database id for the process entry where the link occured
                  format: uuid
                dataset_id:
                  type: string
                  x-stoplight:
                    id: yaccibq2dfprr
                  format: uuid
                  description: Database id for the dataset for which the link was created.
                break_prior_links:
                  type: boolean
                  x-stoplight:
                    id: r6nhmoyuc0mz5
                  description: >-
                    If true, will break all prior links for the parent.

                    I.e. if an axle had a tire linked to it, and a new link was
                    created with this option set to true, that link between the
                    axle and tire would be broken.
              required:
                - parent_component_instance_id
                - child_component_instance_id
                - process_entry_id
                - dataset_id
        description: ''
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  broken_links:
                    type: array
                    x-stoplight:
                      id: wc264on74zuob
                    description: List of broken component instance links
                    items:
                      $ref: '#/components/schemas/Component-instance-link'
                      x-stoplight:
                        id: cfukuuhd1s2u9
                  new_link:
                    $ref: '#/components/schemas/Component-instance-link'
                    x-stoplight:
                      id: 4c2m8wy0oigpo
                    description: Newly created component instance link
                  prior_link:
                    $ref: '#/components/schemas/Component-instance-link'
                    x-stoplight:
                      id: uw4qbc19n4i4p
                    description: >-
                      If a specific link already exists between a parent and
                      child for a given dataset & process, that already created
                      link is returned here
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '404':
          description: Not Found
        '500':
          description: Internal Server Error
components:
  schemas:
    Component-instance-link:
      title: component-instance-link
      x-stoplight:
        id: 3j4q2y8h4gxuz
      type: object
      description: Unique Identifiers Link Database return
      properties:
        id:
          type: string
          x-stoplight:
            id: 0s7lzt9tj81kv
          format: uuid
          description: Database id for the link
        unique_identifier_id:
          type: string
          x-stoplight:
            id: sguxqq7ucykae
          format: uuid
          description: Parent component instance's id
        has_child_of_id:
          type: string
          x-stoplight:
            id: ixm38romx62fn
          format: uuid
          description: Child component instance's id
        process_entry_id:
          type: string
          x-stoplight:
            id: t0anmk0qig5zv
          format: uuid
          description: If for the process entry where the link was created.
        is_active:
          type: boolean
          x-stoplight:
            id: r6l81zemqcvxb
          description: If true, the link is active. If false, the link has been broken.
        dataset_id:
          type: string
          x-stoplight:
            id: vlzz10za5h60r
          format: uuid
          description: Dataset that associates this link.
        created_at:
          type: string
          x-stoplight:
            id: up8zegky6c926
          format: date-time
          description: Timestamp when the link was created
        removed_at:
          type: string
          x-stoplight:
            id: j1vpakirs9ug5
          format: date-time
          description: Timestamp when the link was deactivated.
      required:
        - id
        - has_child_of_id
        - process_entry_id
  securitySchemes:
    serial-default-security:
      type: http
      scheme: bearer
      description: '**API Key** or **Token** formatted as `Bearer <YOUR_KEY_OR_TOKEN>`'

````