Skip to content

Short summary for creation

Summary of Actions Performed

1. Retrieved Existing Webhook Configuration

GET /v3/user/webhooks/parse/settings/eazytms-nightly-mail.aholadigital.com Checked the current Inbound Parse settings for the hostname eazytms-nightly-mail.aholadigital.com.

  curl -X GET "https://api.sendgrid.com/v3/user/webhooks/parse/settings/eazytms-nightly-mail.aholadigital.com" \
    --header "Authorization: Bearer <SENDGRID_APIKEY>"

--- 2. Created a Security Policy

POST /v3/user/webhooks/security/policies Created a new security policy with: - Name: EazyTMS Inbound Parse Security - Method: Signature verification (ECDSA) enabled - Result: Policy ID ab0ee252-79b8-43a1-9e85-6b1b2cffc8c8 and a public key for verification

  curl -X POST "https://api.sendgrid.com/v3/user/webhooks/security/policies" \
    --header "Authorization: Bearer <SENDGRID_APIKEY>" \
    --header "Content-Type: application/json" \
    --data '{
      "name": "EazyTMS Inbound Parse Security",
      "signature": { "enabled": true }
    }'

Response:

  {
    "policy": {
      "id": "ab0ee252-79b8-43a1-9e85-6b1b2cffc8c8",
      "name": "EazyTMS Inbound Parse Security",
      "signature": {
        "public_key": "<KEY>"
      }
    }
  }

--- 3. Attached Security Policy to Webhook

PATCH /v3/user/webhooks/parse/settings/eazytms-nightly-mail.aholadigital.com Updated the webhook with: - URL: https://eazytms-nightly.attracs.com/api/v1/sendgrid/inbound-email - Spam Check: Disabled - Send Raw: Disabled (parsed format) - Security Policy: Linked to ab0ee252-79b8-43a1-9e85-6b1b2cffc8c8

  curl -X PATCH "https://api.sendgrid.com/v3/user/webhooks/parse/settings/eazytms-nightly-mail.aholadigital.com" \
    --header "Authorization: Bearer <SENDGRID_APIKEY>" \
    --header "Content-Type: application/json" \
    --data '{
      "url": "https://eazytms-nightly.attracs.com/api/v1/sendgrid/inbound-email",
      "spam_check": false,
      "send_raw": false,
      "security_policy": "ab0ee252-79b8-43a1-9e85-6b1b2cffc8c8"
    }'

--- Result

Emails sent to *@eazytms-nightly-mail.aholadigital.com will be: 1. Parsed by SendGrid 2. Signed with ECDSA signature 3. POSTed to https://eazytms-nightly.attracs.com/api/v1/sendgrid/inbound-email

Your endpoint should now verify incoming requests using the public key from the security policy response.