> ## 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.

# Assign an accessory to an employee

> Assign an accessory to an employee. Pass ownerId as null to unassign the current owner.

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


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /accessories/{accessoryId}/assign
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:
  /accessories/{accessoryId}/assign:
    post:
      tags:
        - Accessories
      summary: Assign an accessory to an employee
      description: >-
        Assign an accessory to an employee. Pass ownerId as null to unassign the
        current owner.
      operationId: assignAccessory
      parameters:
        - name: accessoryId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignAccessoryBody'
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessoryActionSuccess_Output'
components:
  schemas:
    AssignAccessoryBody:
      type: object
      properties:
        ownerId:
          description: Employee ID to assign the accessory to. Pass null to unassign.
          anyOf:
            - type: string
              pattern: ^[a-f\d]{24}$
            - type: 'null'
      required:
        - ownerId
    AccessoryActionSuccess_Output:
      type: object
      properties:
        success:
          type: boolean
          const: true
      required:
        - success
      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>`.

````