Hi there,
Below are my 2 scripts to enable or disable Dkim for all cluster. (use them at your own risk)
First step is to go and create a Token with "Super admin" rights in your enhance control panel
Also on the same page there is a ORG ID you need to copy and have in hand when configuring the scripts.
create a script We call it "enable-dkim.sh"
Copy paste the below code and replace with your own details :
API_URL=
ORG_ID=
AUTH_TOKEN=
#!/bin/bash
=== CONFIGURATION === IP
API_URL="https://your.domain.to.panel/api"
ORG_ID="your ORD ID"
AUTH_TOKEN="Your syperadmin Token"
AUTH_HEADER="Authorization: Bearer $AUTH_TOKEN"
CONTENT_TYPE="Content-Type: application/json"
=== STEP 1: Get all website domain names and IDs with recursion ===
echo "🔍 Fetching websites for org $ORG_ID..."
curl -s "$API_URL/orgs/$ORG_ID/websites?recursion=directCustomers" -H "$AUTH_HEADER" |
jq -r '.items[] | select(.domain.id != null) | "(.domain.domain) (.domain.id)"' |
while read -r DOMAIN_NAME DOMAIN_ID; do
echo "🔧 Enabling DKIM for $DOMAIN_NAME ($DOMAIN_ID)..."
STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X PUT "$API_URL/orgs/$ORG_ID/domains/$DOMAIN_ID/email-auth" \
-H "$AUTH_HEADER" \
-H "$CONTENT_TYPE" \
-d '{"dkim": true}')
if [[ "$STATUS" == "200" || "$STATUS" == "204" ]]; then
echo "✅ DKIM enabled for $DOMAIN_NAME"
else
echo "❌ Failed to enable DKIM for $DOMAIN_NAME (HTTP $STATUS)"
fi
done
Make it Executable
Run It on your control panel server
Enjoy.