---
title: "Device Lock With Generated Pin"
method: POST
path: "/api/v2/applemdms/{deviceManagerObjectId}/devices/{deviceObjectId}/lockwithgeneratedpin"
tags: ["mdm"]
---

# Device Lock With Generated Pin

`POST /api/v2/applemdms/{deviceManagerObjectId}/devices/{deviceObjectId}/lockwithgeneratedpin`

## Request

- Base URL: `https://console.jumpcloud.com`
- URL: `https://console.jumpcloud.com/api/v2/applemdms/{deviceManagerObjectId}/devices/{deviceObjectId}/lockwithgeneratedpin`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/docs/api/v2/applemdms/:deviceManagerObjectId/devices/:deviceObjectId/lockwithgeneratedpin/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint locks a macOS device with an auto-generated PIN and optionally displays a message and phone number on the lock screen.

## Path parameters

- `deviceManagerObjectId` string, byte, required
- `deviceObjectId` string, byte, required

## Request body

- object
  - `message` string
  - `organizationObjectId` string, byte
  - `phoneNumber` string

## Response `200`

A successful response.

- JumpcloudAppleMdmCommandResponse

## Other responses

- `204`: A successful response.
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `500`: Internal Server Error

---

[API](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api.md) - [All operations](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jumpcloud/apis/jumpcloud-console-api/revisions/f396d9271b46?raw)
