---
title: Lock a Device
slug: jetstream-v2/lock-a-device
docTags: 
createdAt: 2024-01-23T15:33:56.265Z
---

## About

Instructs the specified device to lock for a defined number of hours. During a lockdown period, a device may not be accessed.

| **Command Type**       | **Device is Online**                   | **Device is Offline**               |
| ---------------------- | -------------------------------------- | ----------------------------------- |
| Synchronous, Queueable | Immediate execution, Published results | Queued execution, Published results |

Applicable to the following device types: [RFID Enclosures (Cabinets, Fridges, Freezers)](docId\:kobLJQncO2S0-1ozNf09G)

## Parameters

| **Property**                                                         | **Location** | **Details**                                                                                                                                                                  |
| -------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **AccessKey**<br />:::BlockQuote
string&#xA;Required&#xA;Unique
:::  | Header       | The access key for your user account.<br />This value is a 36-character GUID provided during [user account sign up](https://jetstreamrfid.com/login/signup).                 |
| **DeviceName**<br />:::BlockQuote
string&#xA;Required&#xA;Unique
::: | URL          | The name of the device.<br />This value has a max length of 128 ASCII characters.<br />This value must adhere to this regular expression: ^\[a-zA-Z0-9-\_]\*$                |
| **Hours**<br />:::BlockQuote
int&#xA;Required
:::                    | Body         | The number of hours to lockdown the device.<br />This value is a number within the following range: 0 – 168<br />A value of 0 means that the device should end the lockdown. |

## Example

### Request URL

**POST** https\://api.jetstreamrfid.com/2/devices/\{Device Name}/lockdown

### Request Body

:::BlockQuote
\{
&#x9;"Hours": 1
}
:::

### Response Code

200 OK

### Response Body

:::BlockQuote
\{
&#x9;"CommandId": "6bd4b8fb-d964-4d00-ae0a-e3943d58e004",
&#x9;"Status": "Completed",
&#x9;"ExceptionList": \[],
&#x9;"OutputParameterList": \[]
}
:::

### Published CommandQueuedEvent

:::BlockQuote
\{
&#x9;"Device": "MyDeviceName",
&#x9;"CommandId": "6bd4b8fb-d964-4d00-ae0a-e3943d58e004",
&#x9;"CommandName": "Lockdown",
&#x9;"URI": "/2/Devices/MyDeviceName/lockdown",
&#x9;"Verb": "Post",
&#x9;"User": "MyUserName",
&#x9;"Parameters": \[
&#x9;    \{
&#x9;        "Key": "Hours",
&#x9;        "Value": "1"
&#x9;    }
&#x9;],
&#x9;"Type": "CommandQueuedEvent",
&#x9;"EventId": "98115b7b-3f7f-439b-ba27-ac1234d7569c",
&#x9;"EventTime": "2017-05-18T00:31:20Z"
}
:::

### Published CommandCompletionEvent

:::BlockQuote
\{
&#x9;"CommandId": "6bd4b8fb-d964-4d00-ae0a-e3943d58e004",
&#x9;"CommandName": "Lockdown",
&#x9;"OutputParameterList": \[],
&#x9;"ExceptionList": \[],
&#x9;"Device": "MyDeviceName",
&#x9;"ReceivedTime": "2017-05-18T00:31:36Z",
&#x9;"Type": "CommandCompletionEvent",
&#x9;"EventId": "a0a1a21b-7537-4a75-9eee-cb2e9688f146",
&#x9;"EventTime": "2017-05-18T00:31:35Z"
}
:::

## Version Changes

Replaces Lockdown
