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

# Link a related object to a ticket

> Attach a device, employee, identity, order or shipment to the ticket.

<span className="badge-write">Key: Write</span><span className="badge-company">Scope: Company</span>


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /tickets/{ticketId}/related
openapi: 3.1.1
info:
  title: Public API - BETA
  description: Read docs on https://docs.getprimo.com/
  version: '1.0'
  contact: {}
servers:
  - url: https://api.getprimo.com
security:
  - apikey: []
tags: []
paths:
  /tickets/{ticketId}/related:
    post:
      tags:
        - Tickets
      summary: Link a related object to a ticket
      description: Attach a device, employee, identity, order or shipment to the ticket.
      operationId: linkTicketRelatedObject
      parameters:
        - name: ticketId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkTicketRelatedObjectBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkedTicketRelatedObject_Output'
components:
  schemas:
    LinkTicketRelatedObjectBody:
      type: object
      properties:
        relatedType:
          type: string
          enum:
            - DEVICE
            - EMPLOYEE
            - IDENTITY
            - ORDER
            - SHIPMENT
            - COMPANY_SAAS_APPLICATION
        relatedId:
          description: Id of the device, employee, identity, order or shipment to link
          type: string
          minLength: 1
      required:
        - relatedType
        - relatedId
    LinkedTicketRelatedObject_Output:
      type: object
      properties:
        linkId:
          type: string
        relatedType:
          type: string
          enum:
            - DEVICE
            - EMPLOYEE
            - IDENTITY
            - ORDER
            - SHIPMENT
            - COMPANY_SAAS_APPLICATION
        relatedId:
          type: string
      required:
        - linkId
        - relatedType
        - relatedId
      additionalProperties: false
  securitySchemes:
    apikey:
      scheme: bearer
      bearerFormat: API key
      type: http
      description: >-
        Use your Primo API key in the Authorization header as `Bearer
        <API_KEY>`.

````