---
title: Create new Location Context policy
canonical: https://openvpn.net/cloud-docs/developer/cloudconnexa-beta-api-v0-16-0/location-context/create-new-location-context-policy/
product: CloudConnexa Docs
---

# Create new Location Context policy

`POST /api/beta/location-contexts`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| body | body | object | true | body |

### Body parameter

```json
{
  "countryPolicy": {
    "allowed": true,
    "countries": [
      "string"
    ]
  },
  "defaultPolicy": {
    "allowed": true
  },
  "description": "string",
  "ipPolicy": {
    "allowed": true,
    "ips": [
      {
        "description": "string",
        "ip": "string"
      }
    ]
  },
  "name": "string",
  "userGroupsIds": [
    "string"
  ]
}
```

### Responses

| Status | Meaning | Description |
| --- | --- | --- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK |
| 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Entity created |
| 400 | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Bad Request |
| 401 | [Unauthorized](https://tools.ietf.org/html/rfc7235#section-3.1) | Unauthorized |
| 403 | [Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3) | Access Forbidden |
| 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | Not Found |
| 406 | [Not Acceptable](https://tools.ietf.org/html/rfc7231#section-6.5.6) | Not Acceptable |
| 429 | [Too Many Requests](https://tools.ietf.org/html/rfc6585#section-4) | Too Many Requests |
| 500 | [Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1) | Internal Server Error |

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

```json
{
  "countryPolicy": {
    "allowed": true,
    "countries": [
      "string"
    ]
  },
  "defaultPolicy": {
    "allowed": true
  },
  "description": "string",
  "id": "string",
  "ipPolicy": {
    "allowed": true,
    "ips": [
      {
        "description": "string",
        "ip": "string"
      }
    ]
  },
  "name": "string",
  "userGroupsIds": [
    "string"
  ]
}
```

---

Prev: [Get existing Location Context policies](https://openvpn.net/cloud-docs/developer/cloudconnexa-beta-api-v0-16-0/location-context/get-existing-location-context-policies.md)
Next: [Get existing Location Context policy](https://openvpn.net/cloud-docs/developer/cloudconnexa-beta-api-v0-16-0/location-context/get-existing-location-context-policy.md)
Index: https://openvpn.net/cloud-docs/llms.txt
