---
title: Create location context policy
canonical: https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/location-context/create-location-context-policy/
product: CloudConnexa Docs
---

# Create location context policy

`POST /api/v1/location-contexts`

**Create a new location context policy** with specified criteria for IP, country, and default checks to define access policies based on geographic location or IP address.

Attributes:

- **name** (string): The name of the location context.
- **description** (string): Description of the location context.
- **userGroupsIds** (array of strings): List of user group IDs associated with this location context.
- **ipCheck** (object): Specifies the IP check criteria.
  - **allowed** (boolean): Indicates whether the IP addresses are allowed.
  - **ips** (array of objects): List of IP addresses and descriptions.
- **countryCheck** (object): Specifies the country check criteria.
  - **countries** (array of strings): List of allowed countries.
  - **allowed** (boolean): Indicates whether connections from specified countries are allowed.
- **defaultCheck** (object): Specifies the default check criteria for access.
  - **allowed** (boolean): Indicates if default access is allowed.

## Body parameter

```json
{
  "name": "string",
  "description": "string",
  "userGroupsIds": [
    "string"
  ],
  "ipCheck": {
    "allowed": true,
    "ips": [
      {}
    ]
  },
  "countryCheck": {
    "countries": [
      "string"
    ],
    "allowed": true
  },
  "defaultCheck": {
    "allowed": true
  }
}
```

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| body | body | [LocationContextRequest](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/schemas/locationcontextrequest.md) | true | none |
| » name | body | string | false | none |
| » description | body | string | false | none |
| » userGroupsIds | body | \[string\] | false | none |
| » ipCheck | body | [IpCheckRequest](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/schemas/ipcheckrequest.md) | false | none |
| »» allowed | body | boolean | false | none |
| »» ips | body | \[[IpRequest](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/schemas/iprequest.md)\] | false | none |
| »»» ip | body | string | false | none |
| »»» description | body | string | false | none |
| » countryCheck | body | [CountryCheckRequest](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/schemas/countrycheckrequest.md) | false | none |
| »» countries | body | \[string\] | false | none |
| »» allowed | body | boolean | false | none |
| » defaultCheck | body | [DefaultCheckRequest](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/schemas/defaultcheckrequest.md) | false | none |
| »» allowed | body | boolean | false | none |

## Responses

| Status | Meaning | Description | Schema |
| --- | --- | --- | --- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [LocationContextResponse](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/schemas/locationcontextresponse.md) |

To perform this operation, you must be authenticated by means of one of the following methods: oauth

---

Prev: [Get location context policies](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/location-context/get-location-context-policies.md)
Next: [User](https://openvpn.net/cloud-docs/developer/cloudconnexa-api-v1-2-3/user.md)
Index: https://openvpn.net/cloud-docs/llms.txt
