Authentication overview
MailCheck.ai secures access to its email validation and verification services primarily through API key-based authentication. This method ensures that only authorized requests can interact with the API, protecting both user data and service integrity. Each account is assigned a unique API key that must be included with every API call. The MailCheck.ai API is designed for straightforward integration, supporting simple HTTP GET requests for validation tasks.
The API key functions as a secret token, identifying the client making the request. It grants access to the services associated with the user's account, including real-time email validation and bulk email verification features. All communications with the MailCheck.ai API must occur over HTTPS to encrypt data in transit, preventing interception and tampering of sensitive information, including the API key itself.
Supported authentication methods
MailCheck.ai's API primarily supports a single, robust authentication method: API Key authentication. This method is suitable for most server-to-server integrations and applications where a client can securely store and transmit a static key.
API Key
The API Key method involves generating a unique alphanumeric string from the MailCheck.ai user dashboard. This key then accompanies each API request, typically as a query parameter or a custom HTTP header, to authenticate the sender. This approach is widely adopted for its simplicity and effectiveness in controlling access to web services.
While basic, API keys are effective when managed securely. For enhanced security, it is critical to keep API keys confidential and to revoke them immediately if compromised. The MailCheck.ai documentation provides detailed guidance on how to use the API key within your requests, ensuring proper integration and authentication (MailCheck.ai API Reference Guide).
| Method | When to Use | Security Level |
|---|---|---|
| API Key | Server-to-server communication, backend applications, scripts | Medium (reliant on secure key management) |
Getting your credentials
To authenticate with the MailCheck.ai API, you need to obtain an API key. This key is generated and managed within your MailCheck.ai account dashboard. Follow these steps to get your credentials:
- Create an Account: If you don't already have one, sign up for a MailCheck.ai account on their official website. They offer a free tier for 100 verifications to get started.
- Log In to Your Dashboard: Access your MailCheck.ai account dashboard using your registered email and password.
- Navigate to API Settings: Within the dashboard, look for a section related to 'API Settings', 'API Keys', or 'Integrations'. The exact naming might vary but will be intuitively placed.
- Generate Your API Key: In the API settings section, you will typically find an option to generate a new API key. Click this button to create your unique key.
- Copy Your API Key: Once generated, your API key will be displayed. It's crucial to copy this key immediately and store it securely, as it may not be fully visible again for security reasons. Treat this key as sensitive as a password.
- Review Documentation: For specific instructions on where to include your API key in requests, refer to the MailCheck.ai API Reference.
Your API key is directly linked to your account's usage and billing. Ensure it is kept confidential to prevent unauthorized access and usage of your MailCheck.ai verification credits.
Authenticated request example
MailCheck.ai's API is designed for simplicity, typically requiring the API key as a query parameter in an HTTP GET request. The following example demonstrates how to perform an email validation query using curl, including your API key.
Assume your API key is YOUR_API_KEY_HERE and you want to validate the email address [email protected].
curl "https://api.mailcheck.ai/v1/[email protected]&apikey=YOUR_API_KEY_HERE"
In this example:
https://api.mailcheck.ai/v1/verifyis the API endpoint for email verification.[email protected]is the query parameter specifying the email address to validate.apikey=YOUR_API_KEY_HEREis the query parameter where you replaceYOUR_API_KEY_HEREwith your actual API key obtained from your MailCheck.ai dashboard.
The API will return a JSON response containing the validation results for the provided email address. Always ensure you are using HTTPS for all API calls to safeguard your API key and data in transit.
Security best practices
Securing your MailCheck.ai API key is crucial to prevent unauthorized access, potential misuse of your account credits, and data breaches. Adherence to these best practices enhances the overall security posture of your integrations:
- Keep API Keys Confidential: Treat your MailCheck.ai API key like a password. Never embed it directly in client-side code (e.g., JavaScript in a browser), public repositories, or commit it to version control systems without encryption. Client-side applications should route requests through a secure backend server that manages the API key.
-
Use Environment Variables: Store API keys in environment variables on your server or development machine. This prevents the key from being hardcoded into your application's source code, making it easier to manage and less susceptible to accidental exposure. For example, in Node.js, you might access it via
process.env.MAILCHECK_API_KEY. - Restrict API Key Access: Limit who in your team has access to the API key. Follow the principle of least privilege, granting access only to individuals or systems that absolutely require it.
- Utilize HTTPS: Always ensure that all API requests to MailCheck.ai are made over HTTPS. This encrypts the communication channel, protecting your API key and email data from eavesdropping during transit. The MailCheck.ai API endpoints are designed to enforce HTTPS (MailCheck.ai Documentation).
- Regularly Rotate API Keys: Periodically generate new API keys and revoke old ones, especially if there's a change in personnel or a suspected compromise. While MailCheck.ai's documentation doesn't specify an automatic rotation schedule, manual rotation is a recommended security practice for any API key (Microsoft Azure API Security Design).
- Implement IP Whitelisting (if available): Check your MailCheck.ai dashboard for features like IP whitelisting, which allows you to restrict API key usage to specific IP addresses. This adds an extra layer of security, as even if the key is stolen, it can only be used from authorized locations.
- Monitor API Usage: Regularly review your MailCheck.ai account's API usage statistics. Unexpected spikes in usage could indicate a compromised API key or unauthorized activity.
- Error Handling and Logging: Implement robust error handling for API authentication failures. Avoid logging API keys in plain text in application logs. If an authentication error occurs, log only enough information to identify the issue without exposing sensitive credentials.