Getting a Cloudflare Email API Key

Introduction

To enable Gravity SMTP to send messages via your Cloudflare Email Service account, you must provide the plugin with a Cloudflare API Token. This step must be completed before configuring the Cloudflare Integration in Gravity SMTP. This article outlines the steps to generate a new API Token from your Cloudflare account.

Refer to the API token documentation from the official Cloudflare website for more information and related articles.

Creating a New API Token

  1. Log in to the Cloudflare dashboard.
  2. Go to My Profile > API Tokens (in the top-right menu).
Image showing Cloudflare dashboard.
  1. Select Create Token.
  2. Select Create Custom Token to create a token with specific permissions.
Image showing Cloudflare dashboard.
  1. Enter a descriptive name for your token (for example, “Gravity SMTP Email Sending”).
  2. Under Permissions, set the following:
    Account > Email Sending > Edit (for sending emails)
    Zone > Zone > Read (for domain validation)
Image showing Cloudflare dashboard.
  1. Select Continue to summary, then review your token settings.
Image showing Cloudflare dashboard.
  1. Select Create Token to generate the token’s secret.
Image showing Cloudflare dashboard.
  1. Copy and save your API Token immediately. The token secret is only shown once and cannot be retrieved later. Store it securely and do not share it.

Note: Ensure the Email Sending permission is set under the Account category, not the Zone category. Zone-level “Email Routing Rules” is a different feature and will not work for sending.

Once you have created your API Token and identified your Account ID, you can configure your Cloudflare Integration settings within Gravity SMTP.