Update License Key
Added in v1.0
PUT
https://api.example.com/api/keys/{id}
Requires authentication:
X-API-Key: YOUR_API_KEY
Updates an existing license key details. Content defaults to existing data if not provided in the body. Returns updated key object.
Path parameters
-
idinteger requiredExample:1
Body parameters
-
disabledboolean optionalExample:false -
ipstring optionalExample:203.0.113.10 -
lockedboolean optionalExample:true
Responses
- 200Success
- 400License key not found
Request
curl -X PUT 'https://api.example.com/api/keys/1' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"disabled": false,
"ip": "203.0.113.10",
"locked": true
}'
const response = await fetch('https://api.example.com/api/keys/1', {
method: 'PUT',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"disabled": false,
"ip": "203.0.113.10",
"locked": true
}),
});
const data = await response.json();
console.log(data);
import requests
response = requests.put(
"https://api.example.com/api/keys/1",
headers={
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"disabled": False,
"ip": "203.0.113.10",
"locked": True
},
)
print(response.json())
<?php
$ch = curl_init('https://api.example.com/api/keys/1');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{
"disabled": false,
"ip": "203.0.113.10",
"locked": true
}',
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
Response
Success
{
"id": 1,
"uuid": "123",
"product": 456,
"key": "0190a5f3-7c1e-7b2a-9d4e-3f8a6c1b2d90",
"ip": "203.0.113.10",
"status": true,
"disabled": false,
"locked": true,
"lastSeen": 1790000000000
}
License key not found
{
"msg": "The specified license key was not found."
}