# Create client-specific inbox
curl -X POST https://app.mailhook.co/api/v1/email_addresses \
-H "Authorization: Bearer your_api_key" \
-d '{
"local_part": "acme-corp",
"domain_id": "dom_abc123",
"metadata": {
"client_id": "client_789",
"project": "benefits_enrollment"
}
}'
# Configure webhook for this client
curl -X POST https://app.mailhook.co/api/v1/webhooks \
-H "Authorization: Bearer your_api_key" \
-d '{
"url": "https://your-app.com/webhooks/email",
"email_address_id": "ea_xyz123",
"events": ["inbound_email"]
}'
# Webhook payload includes metadata
{
"event": "inbound_email",
"data": {
"from": "[email protected]",
"subject": "Benefits Confirmation",
"metadata": {
"client_id": "client_789",
"project": "benefits_enrollment"
}
}
}