1--- 2layout: api 3page_title: License - Operator - HTTP API 4sidebar_current: api-operator-license 5description: |- 6 The /operator/license endpoints allow for setting and retrieving the Consul 7 Enterprise License. 8--- 9 10# License - Operator HTTP API 11 12~> **Enterprise Only!** This API endpoint and functionality only exists in 13Consul Enterprise. This is not present in the open source version of Consul. 14 15The licensing functionality described here is available only in 16[Consul Enterprise](https://www.hashicorp.com/products/consul/) version 1.1.0 and later. 17 18## Getting the Consul License 19 20This endpoint gets information about the current license. 21 22| Method | Path | Produces | 23| ------ | ---------------------------- | -------------------------- | 24| `GET` | `/operator/license` | `application/json` | 25 26The table below shows this endpoint's support for 27[blocking queries](/api/features/blocking.html), 28[consistency modes](/api/features/consistency.html), 29[agent caching](/api/features/caching.html), and 30[required ACLs](/api/index.html#authentication). 31 32| Blocking Queries | Consistency Modes | Agent Caching | ACL Required | 33| ---------------- | ----------------- | ------------- | ---------------- | 34| `NO` | `all` | `none` | `none` | 35 36### Parameters 37 38- `dc` `(string: "")` - Specifies the datacenter whose license should be retrieved. 39 This will default to the datacenter of the agent serving the HTTP request. 40 This is specified as a URL query parameter. 41 42### Sample Request 43 44```text 45$ curl \ 46 http://127.0.0.1:8500/v1/operator/license 47``` 48 49### Sample Response 50 51```json 52{ 53 "Valid": true, 54 "License": { 55 "license_id": "2afbf681-0d1a-0649-cb6c-333ec9f0989c", 56 "customer_id": "0259271d-8ffc-e85e-0830-c0822c1f5f2b", 57 "installation_id": "*", 58 "issue_time": "2018-05-21T20:03:35.911567355Z", 59 "start_time": "2018-05-21T04:00:00Z", 60 "expiration_time": "2019-05-22T03:59:59.999Z", 61 "product": "consul", 62 "flags": { 63 "package": "premium" 64 }, 65 "features": [ 66 "Automated Backups", 67 "Automated Upgrades", 68 "Enhanced Read Scalability", 69 "Network Segments", 70 "Redundancy Zone", 71 "Advanced Network Federation" 72 ], 73 "temporary": false 74 }, 75 "Warnings": [] 76} 77``` 78 79## Updating the Consul License 80 81This endpoint updates the Consul license and returns some of the 82license contents as well as any warning messages regarding its validity. 83 84| Method | Path | Produces | 85| ------ | ---------------------------- | -------------------------- | 86| `PUT` | `/operator/license` | `application/json` | 87 88The table below shows this endpoint's support for 89[blocking queries](/api/features/blocking.html), 90[consistency modes](/api/features/consistency.html), 91[agent caching](/api/features/caching.html), and 92[required ACLs](/api/index.html#authentication). 93 94| Blocking Queries | Consistency Modes | Agent Caching | ACL Required | 95| ---------------- | ----------------- | ------------- | ---------------- | 96| `NO` | `none` | `none` | `operator:write` | 97 98### Parameters 99 100- `dc` `(string: "")` - Specifies the datacenter whose license should be updated. 101 This will default to the datacenter of the agent serving the HTTP request. 102 This is specified as a URL query parameter. 103 104### Sample Payload 105 106The payload is the raw license blob. 107 108### Sample Request 109 110```text 111$ curl \ 112 --request PUT \ 113 --data @consul.license \ 114 http://127.0.0.1:8500/v1/operator/license 115``` 116 117### Sample Response 118 119```json 120{ 121 "Valid": true, 122 "License": { 123 "license_id": "2afbf681-0d1a-0649-cb6c-333ec9f0989c", 124 "customer_id": "0259271d-8ffc-e85e-0830-c0822c1f5f2b", 125 "installation_id": "*", 126 "issue_time": "2018-05-21T20:03:35.911567355Z", 127 "start_time": "2018-05-21T04:00:00Z", 128 "expiration_time": "2019-05-22T03:59:59.999Z", 129 "product": "consul", 130 "flags": { 131 "package": "premium" 132 }, 133 "features": [ 134 "Automated Backups", 135 "Automated Upgrades", 136 "Enhanced Read Scalability", 137 "Network Segments", 138 "Redundancy Zone", 139 "Advanced Network Federation" 140 ], 141 "temporary": false 142 }, 143 "Warnings": [] 144} 145``` 146 147## Resetting the Consul License 148 149This endpoint resets the Consul license to the license included in the Enterprise binary. If the included license is not valid, the replace will fail. 150 151| Method | Path | Produces | 152| -------- | ---------------------------- | -------------------------- | 153| `DELETE` | `/operator/license` | `application/json` | 154 155The table below shows this endpoint's support for 156[blocking queries](/api/features/blocking.html), 157[consistency modes](/api/features/consistency.html), 158[agent caching](/api/features/caching.html), and 159[required ACLs](/api/index.html#authentication). 160 161| Blocking Queries | Consistency Modes | Agent Caching | ACL Required | 162| ---------------- | ----------------- | ------------- | ---------------- | 163| `NO` | `none` | `none` | `operator:write` | 164 165### Parameters 166 167- `dc` `(string: "")` - Specifies the datacenter whose license should be updated. 168 This will default to the datacenter of the agent serving the HTTP request. 169 This is specified as a URL query parameter. 170 171### Sample Request 172 173```text 174$ curl \ 175 --request DELETE \ 176 http://127.0.0.1:8500/v1/operator/license 177``` 178 179### Sample Response 180 181```json 182{ 183 "Valid": true, 184 "License": { 185 "license_id": "2afbf681-0d1a-0649-cb6c-333ec9f0989c", 186 "customer_id": "0259271d-8ffc-e85e-0830-c0822c1f5f2b", 187 "installation_id": "*", 188 "issue_time": "2018-05-21T20:03:35.911567355Z", 189 "start_time": "2018-05-21T04:00:00Z", 190 "expiration_time": "2019-05-22T03:59:59.999Z", 191 "product": "consul", 192 "flags": { 193 "package": "premium" 194 }, 195 "features": [ 196 "Automated Backups", 197 "Automated Upgrades", 198 "Enhanced Read Scalability", 199 "Network Segments", 200 "Redundancy Zone", 201 "Advanced Network Federation" 202 ], 203 "temporary": false 204 }, 205 "Warnings": [] 206} 207``` 208