---
title: Create a Policy
slug: jetstream-v2/create-a-policy
docTags: 
createdAt: 2024-01-23T15:40:26.741Z
---

## About

Add a policy to your Jetstream application for managing a device's configuration values (the configuration parameters are defined by the device’s definition). A policy may be added to a device to apply its configuration settings. If an assigned device's parameters do not match the policy, a [LogEntryEvent](docId:29y5YUYiF83JhS1F2y-R0) (PolicyException) is published.

## 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).                                                                                                                                                                                                                                                                                                                         |
| **Name**<br />:::BlockQuote
string&#xA;Required&#xA;Unique
:::               | Body         | The name of the policy.<br />This value has a max length of 128 ASCII characters.<br />This value must adhere to this regular expression: ^\[a-zA-Z0-9-\_]\*$                                                                                                                                                                                                                                                                                                                        |
| **DeviceDefinition**<br />:::BlockQuote
string&#xA;Required
:::              | Body         | The name of the device definition associated with the policy.<br />This value is one of the device definitions retrieved by the [Get All Device Definitions](docId\:XnMyd7X5iixvo71OFVqoz) 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 />:::BlockQuote
dictionary(string,string)&#xA;Required
::: | Body         | The parameters and values associated with the policy.<br />All parameters defined in the associated device definition must be defined.<br />All values defined must be of the type (e.g., int, bool, string, float, datetime) defined in the associated device definition.<br />Once a [policy is added to a device](docId\:U-YIhQPcNLvud3UaG439E), if a device's parameters do not match the policy, a [LogEntryEvent](docId:29y5YUYiF83JhS1F2y-R0) (PolicyException) is published. |

## Example

### Request URL

**POST** https\://api.jetstreamrfid.com/2/policies


### Request Body

:::BlockQuote
\{
&#x20;   "Name": "MyPolicyName",
&#x20;   "DeviceDefinition":"TS032, Cabinet, US, UHF, GF, 7.9 cu ft",
&#x20;   "Parameters":\{
&#x20;       "aggregateeventscancount": 2,
&#x20;       "aggregateeventscantime": 10,
&#x20;       "antenna1rxsensitivity": 50,
&#x20;       "antenna1txpower": 30,
&#x20;       "antenna2rxsensitivity": 50,
&#x20;       "antenna2txpower": 30,
&#x20;       "antenna3rxsensitivity": 50,
&#x20;       "antenna3txpower": 30,
&#x20;       "antenna4rxsensitivity": 50,
&#x20;       "antenna4txpower": 30,
&#x20;       "commandpollinterval": 60,
&#x20;       "dns": "0.0.0.0",
&#x20;       "dooropentimelimit": 300,
&#x20;       "gateway": "0.0.0.0",
&#x20;       "ip": "0.0.0.0",
&#x20;       "jetstreamdeviceurl": "https\://usdevice.tersosolutions.com/v1.0/device/",
&#x20;       "lockdownhightemp": 127,
&#x20;       "lockdownonacpowerfailure": 0,
&#x20;       "lockdownonhightemp": 0,
&#x20;       "lockdownonreaderfailure": 0,
&#x20;       "logentryeventhightemp": 127,
&#x20;       "logentryeventlowtemp": -128,
&#x20;       "logentrylevel": "warning",
&#x20;       "numberofantennas": 4,
&#x20;       "objecteventscancount": 2,
&#x20;       "objecteventscantime": 10,
&#x20;       "subnet": "0.0.0.0"
&#x20;   }
}
:::

### Response Code

201 Created


### Response Body

:::BlockQuote
\{
&#x20;   "Name": "MyPolicyName",
&#x20;   "DeviceDefinition": "TS032, Cabinet, US, UHF, GF, 7.9 cu ft",
&#x20;   "Parameters": \{
&#x20;       "aggregateeventscancount": "2",
&#x20;       "aggregateeventscantime": "10",
&#x20;       "antenna1rxsensitivity": "50",
&#x20;       "antenna1txpower": "30",
&#x20;       "antenna2rxsensitivity": "50",
&#x20;       "antenna2txpower": "30",
&#x20;       "antenna3rxsensitivity": "50",
&#x20;       "antenna3txpower": "30",
&#x20;       "antenna4rxsensitivity": "50",
&#x20;       "antenna4txpower": "30",
&#x20;       "commandpollinterval": "60",
&#x20;       "dns": "0.0.0.0",
&#x20;       "dooropentimelimit": "300",
&#x20;       "gateway": "0.0.0.0",
&#x20;       "ip": "0.0.0.0",
&#x20;       "jetstreamdeviceurl": "https\://usdevice.tersosolutions.com/v1.0/device/",
&#x20;       "lockdownhightemp": "127",
&#x20;       "lockdownonacpowerfailure": "0",
&#x20;       "lockdownonhightemp": "0",
&#x20;       "lockdownonreaderfailure": "0",
&#x20;       "logentryeventhightemp": "127",
&#x20;       "logentryeventlowtemp": "-128",
&#x20;       "logentrylevel": "warning",
&#x20;       "numberofantennas": "4",
&#x20;       "objecteventscancount": "2",
&#x20;       "objecteventscantime": "10",
&#x20;       "subnet": "0.0.0.0"
&#x20;   },
&#x20;   "ProprietaryCommands": \[]
}
:::

## Version Changes

Replaces AddPolicy
