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

# Lock a device

> Lock the device for the given device ID.

**Supported platforms:** macOS, Windows, Linux

**Important:** The lock command will be executed the next time the device comes online.

**Platform-specific behavior:**
- **macOS**: Locks the device with a 6-digit PIN. The PIN is stored and can be retrieved via the unlock endpoint.
- **Windows/Linux**: Locks the device without a PIN.

**Not supported:** iOS, Android, Chrome OS

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


## OpenAPI

````yaml https://api.getprimo.com/openapi.json post /devices/{deviceId}/lock
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:
  /devices/{deviceId}/lock:
    post:
      tags:
        - Devices
      summary: Lock a device
      description: >-
        Lock the device for the given device ID.


        **Supported platforms:** macOS, Windows, Linux


        **Important:** The lock command will be executed the next time the
        device comes online.


        **Platform-specific behavior:**

        - **macOS**: Locks the device with a 6-digit PIN. The PIN is stored and
        can be retrieved via the unlock endpoint.

        - **Windows/Linux**: Locks the device without a PIN.


        **Not supported:** iOS, Android, Chrome OS
      operationId: lockDevice
      parameters:
        - name: deviceId
          required: true
          in: path
          schema:
            type: string
      responses:
        default:
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LockDevice_Output'
components:
  schemas:
    LockDevice_Output:
      type: object
      properties:
        success:
          type: boolean
          const: true
        platform:
          type: string
          description: The platform of the locked device
          enum:
            - ANDROID
            - IOS
            - MACOS
            - WINDOWS
            - LINUX
            - CHROME_OS
            - IPADOS
            - UNKNOWN
        message:
          type: string
          description: A human-readable description of the lock operation
      required:
        - success
        - platform
        - message
      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>`.

````