---
title: Add a Policy to a Device
slug: jetstream-v3/add-a-policy-to-a-device
docTags: 
createdAt: 2024-01-23T15:41:09.320Z
---

## About

Add a specified policy to the specified device in your Jetstream application. This triggers monitoring of the device's configuration values for any discrepancies from the policy – Jetstream will automatically schedule a [Get a Device's Policy Parameters](docId\:G6S4NzG5DSGAf_dCAGbTb) request and compare the results with the policy and overridden device parameters.

## Parameters

| **Property**                                         | **Location**                        | **Details**                                                                                                                                                                                                                                                                                                       |
| ---------------------------------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **AccessKey**<br />string<br />Required<br />Unique  | Header                              | The access key for your user account.<br />This value is a 36-character GUID provided in your [user profile](docId\:BbIFQiuIXND5iAfMreBBi).                                                                                                                                                                       |
| **DeviceName**<br />string<br />Required<br />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-\_,. ]\*$<br />The device must not already have a policy added to it.                                                                                      |
| **Name**<br />string<br />Required<br />Unique       | Body<br />*Request*<br />*Response* | The name of the policy.<br />This value is one of the policies retrieved by the [Get All Policies](docId\:DrWgILNwAaQ3tJs0Ku6KT) request.<br />This value has a max length of 128 ASCII characters.<br />This value must adhere to this regular expression: ^\[a-zA-Z0-9-\_,. ]\*$                                |
| **Parameters**<br />dictionary(string,string)        | Body<br />*Request*<br />*Response* | The parameters and values to override what’s currently set for them in the policy.<br />All parameters defined must be in the policy’s associated device definition.<br />All values defined must be of the type (e.g., int, bool, string, float, datetime) defined in the policy’s associated device definition. |
| **LastPolicyUpdate**<br />string                     | Body<br />*Response*                | The date/time value indicating when a policy was last added to the specified device.<br />This value is generated by Jetstream – do not define it in requests.                                                                                                                                                    |
| **LastPolicySync**<br />string                       | Body<br />*Response*                | The date/time value indicating when a policy was last [synced](docId\:g2EhiBF-dqNWC4nH0cX1w) to the specified device.<br />This value is generated by Jetstream – do not define it in requests.                                                                                                                   |

## Example

### Request URL

**POST** https\://api.jetstreamrfid.com/3/devices/&#x7B;DeviceName}/Policy

### Request Body

:::BlockQuote
\{
&#x9;"Name": "MyPolicyName",
&#x9;"Parameters": \{
&#x9;	"aggregateeventscancount": 3
&#x9;}
}
:::

### Response Code

201 Created

### Response Body

:::BlockQuote
\{
&#x9;"Id": 1,
&#x9;"Name": " MyPolicyName",
&#x9;"Parameters": \{
&#x9;	"aggregateeventscancount": "3"
&#x9;},
&#x9;"LastPolicyUpdate": "2018-05-18T18:56:27Z",
&#x9;"LastPolicySync": ""
}
:::

## Version Changes

Addition of the Id Property.
