Download the PHP package chimpmatic/mailchimp-api-key-validator without Composer
On this page you can find all versions of the php package chimpmatic/mailchimp-api-key-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chimpmatic/mailchimp-api-key-validator
More information about chimpmatic/mailchimp-api-key-validator
Files in chimpmatic/mailchimp-api-key-validator
Package mailchimp-api-key-validator
Short Description Validate Mailchimp API key format, detect common errors (whitespace, missing datacenter suffix), and verify connectivity.
License MIT
Homepage https://chimpmatic.com
Informations about the package mailchimp-api-key-validator
Mailchimp API Key Validator
Validate Mailchimp API key format, detect common errors, and optionally verify connectivity — all without hitting the Mailchimp API until you're ready.
Author: Chimpmatic
Why This Exists
The most common support request for any Mailchimp integration is "Invalid API Key." The causes are always the same:
- Extra whitespace when pasting
- Missing datacenter suffix (
-us4) - Truncated key (copied only part of it)
- Revoked or disabled key
This library catches all of these before making an API call, giving your users clear error messages instead of a generic failure.
Need to get your Mailchimp API key first? See How to Get Your Mailchimp API Key for a one-click shortcut.
Installation
Quick Start
Connectivity Verification
Optionally verify the key works against the Mailchimp API (requires curl):
What It Catches
| Issue | Detection | Message |
|---|---|---|
| Empty key | Format check | API key is empty. |
| Leading/trailing whitespace | Format check | Warning + auto-trim |
| Internal whitespace | Format check | Key contains whitespace characters. |
Missing -us4 suffix |
Format check | Missing datacenter suffix. |
| Wrong hash length | Format check | Key hash is N characters, expected 32. |
| Non-hex characters | Format check | Key hash contains non-hexadecimal characters. |
| Invalid datacenter format | Format check | Datacenter "X" does not match expected format. |
| Unknown datacenter | Format check | Warning (may be newer DC) |
| Revoked/disabled key | Connectivity check | API key is rejected by Mailchimp. |
| Insufficient permissions | Connectivity check | API key lacks sufficient permissions. |
ValidationResult API
Requirements
- PHP 7.4 or higher
curlextension (only forverifyConnectivity())
Testing
Or run PHPUnit directly:
Links
License
MIT License. Copyright (c) 2026 Chimpmatic.