---
title: "Create a new Policy"
method: POST
path: "/api/v2/policies"
tags: ["Policies"]
---

# Create a new Policy

`POST /api/v2/policies`

## Request

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

This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies.

##### Sample Request
```
curl -X POST https://console.jumpcloud.com/api/v2/policies \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: {API_KEY}' \
  -d '{
    {Policy_Parameters}
  }'
```

## Headers

- `x-org-id` string

## Request body

- PolicyCreateRequest: A request to create an instance of a policy template.
  - `name` string, required: The description for this specific Policy.
  - `notes` string: The notes for this specific Policy.
  - `template` object, required
    - `id` string, required: ObjectId uniquely identifying a Policy instance.
  - `values` PolicyValue[]
    - `configFieldID` string: The ObjectId of the corresponding Policy Template configuration field.
    - `value` union: The value for the configuration field for this Policy instance.
      - string
      - number
      - boolean
      - unknown[]
        - unknown
    - `sensitive` boolean: Defines if the value is sensitive or not.

## Response `201`

Created

- PolicyWithDetails: An instance of a policy template.
  - `configFields` PolicyTemplateConfigField[]
    - `defaultValue` union: The default value for this field.
      - string
      - number
      - boolean
      - unknown[]
        - unknown
    - `displayOptions` object, nullable: The options that correspond to the display_type.
    - `displayType` 'checkbox' | 'date' | 'email' | 'file' | 'number' | 'select' | 'text' | 'textarea' | 'singlelistbox' | 'doublelistbox' | 'table' | 'segmentedbutton' | 'radio' | 'copywell' | 'timeinput' | 'datepickerrange' | 'multilist' | 'paginationlist' | 'searchandselect' | 'datetimepicker' | 'numberinline' | 'objectstoragefile': The default rendering for this field.
    - `id` string, required: ObjectId uniquely identifying a Policy Template Configuration Field
    - `label` string: The default label for this field.
    - `name` string, required: A unique name identifying this config field.
    - `position` number: The default position to render this field.
    - `readOnly` boolean: If an admin is allowed to modify this field.
    - `required` boolean: If this field is required for this field.
    - `sensitive` boolean: Defines if the policy template config field is sensitive or not.
    - `validators` object, nullable: Descriptors to perform extended assertions on the supplied config field value.
    - `tooltip` object, nullable
      - `template` string
      - `variables` object
        - `icon` string
        - `message` string
  - `id` string: ObjectId uniquely identifying a Policy.
  - `name` string: The description for this specific Policy.
  - `notes` string: The notes for this specific Policy.
  - `template` PolicyTemplate: The shallow information about a Policy Template.
    - `activation` string: Requirements before the policy can be activated.
    - `behavior` string: Specifics about the behavior of the policy.
    - `deliveryTypes` string[]: The supported delivery mechanisms for this policy template.
    - `description` string: The default description for the Policy.
    - `displayName` string: The default display name for the Policy.
    - `id` string: ObjectId uniquely identifying a Policy Template.
    - `name` string: The unique name for the Policy Template.
    - `osMetaFamily` 'linux' | 'darwin' | 'windows' | 'ios' | 'universal' | 'android'
    - `state` string: String describing the release status of the policy template.
    - `alert` string, nullable: Text to describe any risk associated with this policy.
    - `reference` string, nullable: URL to visit for further information.
    - `osRestrictions` OSRestriction[]
      - `osName` string: The name of the OS in which this restriction applies
      - `earliestVersion` string: The earliest version of the OS in which the policy can be applied
      - `isMdmRequired` boolean: Boolean representing if the policy requires the device to be MDM enrolled
      - `deprecatedVersion` string: The version of the OS in which the policy was deprecated
      - `supportedEnrollmentTypes` string[]: This field is deprecated and will be ignored. Use appleRestrictions.supportedEnrollmentTypes instead
      - `appleRestrictions` object: The Apple specific restricitons for this policy, if there are any
        - `requiresSupervision` boolean: Boolean representing if the policy requires the Apple devices to be MDM supervised
        - `supportedEnrollmentTypes` string[]: The supported Apple enrollment types for this policy
  - `values` PolicyValue[]
    - `configFieldID` string: The ObjectId of the corresponding Policy Template configuration field.
    - `value` union: The value for the configuration field for this Policy instance.
      - string
      - number
      - boolean
      - unknown[]
        - unknown
    - `sensitive` boolean: Defines if the value is sensitive or not.

---

[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)
