> For the complete documentation index, see [llms.txt](https://api.senderwiz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.senderwiz.com/admin/customer-api/create-a-customer-api-key.md).

# Create a Customer API Key

Create a customer API key using Admin API. Add IP rules, name, and description for secure integration across systems and platforms.

### 🛠️ Create a Customer API Key

Generate a new API key for a customer using your Admin API key. Customize the key with optional IP whitelisting, naming, and descriptions.

#### 🔹 HTTP Request

`POST ADMIN-API-URL/customers/CUSTOMER-UID/api-keys`

#### 🔸 URL Segments

| Segment        | Type   | Required | Description                       |
| -------------- | ------ | -------- | --------------------------------- |
| `CUSTOMER-UID` | string | Yes      | Unique identifier of the customer |

#### 🔐 Authorization Header

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

#### 💻 PHP Example

```php
$response = $endpoint->createApiKey('ab382plq98zr7', [
  'name' => 'My site',
  'description' => 'This key is used on my site',
  'ip_whitelist' => ['123.123.123.123', '111.111.111.111'],
  'ip_blacklist' => ['231.231.231.231', '222.222.222.222']
]);

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

#### 📦 Sample JSON Response

```json
{
  "status": "success",
  "api_key": {
    "key_id": "31",
    "key": "67bb0a3627efd012458c3206db8cef86c95c0d47",
    "name": "My site",
    "description": "This key is used on my site",
    "ip_whitelist": ["123.123.123.123", "111.111.111.111"],
    "ip_blacklist": ["231.231.231.231", "222.222.222.222"],
    "created_at": "2025-04-19 11:00:00"
  }
}
```
