curl -X GET "https://api.mailgreet.com/api/v1/external/test-auth" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.mailgreet.com/api/v1/external/test-auth', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'https://api.mailgreet.com/api/v1/external/test-auth',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
print(response.json())
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.mailgreet.com/api/v1/external/test-auth',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{
"success": true,
"message": "API key authentication successful",
"data": {
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"clerk_user_id": "user_2abc123def456",
"api_key_name": "Default API Key",
"authenticated_at": "2026-01-18T14:00:00Z"
}
}
{
"success": false,
"error": "Invalid or missing API key"
}
Authentication
Test Authentication
Verify your API key is working correctly
GET
/
api
/
v1
/
external
/
test-auth
curl -X GET "https://api.mailgreet.com/api/v1/external/test-auth" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.mailgreet.com/api/v1/external/test-auth', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'https://api.mailgreet.com/api/v1/external/test-auth',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
print(response.json())
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.mailgreet.com/api/v1/external/test-auth',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{
"success": true,
"message": "API key authentication successful",
"data": {
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"clerk_user_id": "user_2abc123def456",
"api_key_name": "Default API Key",
"authenticated_at": "2026-01-18T14:00:00Z"
}
}
{
"success": false,
"error": "Invalid or missing API key"
}
Overview
This endpoint allows you to test your API key authentication before making other requests. It’s the recommended first step when integrating with the MailGreet API.Authentication
Bearer token. Format:
Bearer YOUR_API_KEYResponse
Indicates if the request was successful
Success message confirming authentication
curl -X GET "https://api.mailgreet.com/api/v1/external/test-auth" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch('https://api.mailgreet.com/api/v1/external/test-auth', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
'https://api.mailgreet.com/api/v1/external/test-auth',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
print(response.json())
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.mailgreet.com/api/v1/external/test-auth',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY'
]
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
{
"success": true,
"message": "API key authentication successful",
"data": {
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"clerk_user_id": "user_2abc123def456",
"api_key_name": "Default API Key",
"authenticated_at": "2026-01-18T14:00:00Z"
}
}
{
"success": false,
"error": "Invalid or missing API key"
}
⌘I

