Update a Customer API Key

Update a customer's API key with a new name, description, or IP rules using the Admin API for improved security and management.

✏️ Update a Customer API Key

Update an existing API key's details like name, description, or IP restrictions using the Admin API for better access management.

πŸ”Ή HTTP Request

PUT ADMIN-API-URL/customers/CUSTOMER-UID/api-keys/KEY-ID

πŸ”Έ URL Segments

Segment
Type
Required
Description

CUSTOMER-UID

string

Yes

Unique identifier of the customer

KEY-ID

string

Yes

ID of the API key to update

πŸ” Authorization Header

X-ADMIN-API-KEY: your-admin-api-key-here

πŸ”„ Fields Available for Update

Field
Type
Required
Description

name

string

No

A label or title for the API key

description

string

No

Short description for internal use

ip_whitelist

string[]

No

List of IPs allowed to use this key

ip_blacklist

string[]

No

List of IPs blocked from using this key

πŸ’» PHP Example

$response = $endpoint->updateApiKey('ab382plq98zr7', '45', [
  'name' => 'Updated Key',
  'description' => 'Updated description for the key',
  'ip_whitelist' => ['101.101.101.101'],
  'ip_blacklist' => ['202.202.202.202']
]);

echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';

πŸ“¦ Sample JSON Response

Last updated