cURL Examples
Set your API key once:
export EMBOUX_KEY="your-api-key-here"export EMBOUX_URL="https://api.emboux.com"Domains
Section titled “Domains”# Createcurl -X POST "$EMBOUX_URL/domains/" \ -H "Authorization: Bearer $EMBOUX_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "example.com"}'
# Listcurl "$EMBOUX_URL/domains/" \ -H "Authorization: Bearer $EMBOUX_KEY"
# Deletecurl -X DELETE "$EMBOUX_URL/domains/example.com" \ -H "Authorization: Bearer $EMBOUX_KEY"
# Suspendcurl -X PUT "$EMBOUX_URL/domains/example.com/suspend" \ -H "Authorization: Bearer $EMBOUX_KEY"
# Activatecurl -X PUT "$EMBOUX_URL/domains/example.com/activate" \ -H "Authorization: Bearer $EMBOUX_KEY"Mailboxes
Section titled “Mailboxes”# Createcurl -X POST "$EMBOUX_URL/users/" \ -H "Authorization: Bearer $EMBOUX_KEY" \ -H "Content-Type: application/json" \
# List (all)curl "$EMBOUX_URL/users/" \ -H "Authorization: Bearer $EMBOUX_KEY"
# List (by domain)curl "$EMBOUX_URL/users/?domain_id=1" \ -H "Authorization: Bearer $EMBOUX_KEY"
# Change password -H "Authorization: Bearer $EMBOUX_KEY" \ -H "Content-Type: application/json" \ -d '{"password": "new-pass-456"}'
# Delete -H "Authorization: Bearer $EMBOUX_KEY"Aliases
Section titled “Aliases”# Create aliascurl -X POST "$EMBOUX_URL/aliases/" \ -H "Authorization: Bearer $EMBOUX_KEY" \ -H "Content-Type: application/json" \ -d '{"domain_name": "example.com", "source": "[email protected]", "destination": "[email protected]"}'
# Create catch-allcurl -X POST "$EMBOUX_URL/aliases/" \ -H "Authorization: Bearer $EMBOUX_KEY" \ -H "Content-Type: application/json" \
# Listcurl "$EMBOUX_URL/aliases/?domain_id=1" \ -H "Authorization: Bearer $EMBOUX_KEY"
# Delete -H "Authorization: Bearer $EMBOUX_KEY"Quotas & Limits
Section titled “Quotas & Limits”# Get mailbox quota -H "Authorization: Bearer $EMBOUX_KEY"
# Set mailbox quota (2 GB) -H "Authorization: Bearer $EMBOUX_KEY" \ -H "Content-Type: application/json" \ -d '{"quota_mb": 2048}'
# Get retention policycurl "$EMBOUX_URL/domains/example.com/retention" \ -H "Authorization: Bearer $EMBOUX_KEY"
# Set retention (90 days)curl -X PUT "$EMBOUX_URL/domains/example.com/retention" \ -H "Authorization: Bearer $EMBOUX_KEY" \ -H "Content-Type: application/json" \ -d '{"retention_days": 90}'
# Get transfer limitcurl "$EMBOUX_URL/domains/example.com/transfer" \ -H "Authorization: Bearer $EMBOUX_KEY"
# Set transfer limit (10 GB)curl -X PUT "$EMBOUX_URL/domains/example.com/transfer" \ -H "Authorization: Bearer $EMBOUX_KEY" \ -H "Content-Type: application/json" \ -d '{"transfer_monthly_mb": 10240}'Health Check
Section titled “Health Check”curl "$EMBOUX_URL/health" \ -H "Authorization: Bearer $EMBOUX_KEY"{"status": "ok", "db_connected": true}