Cloudflare

The Cloudflare modules enable you to monitor, create, or update zones and monitor, create, list, patch, delete, or export/import DNS records in your Cloudflare account.

Getting Started with Cloudflare

Prerequisites

  • A Cloudflare account

In order to use Cloudflare with Integromat, it is necessary to have a Cloudflare account. If you do not have one, you can create a Cloudflare account at dash.cloudflare.com/sign-up.

The module dialog fields that are displayed in bold (in the Integromat scenario, not in this documentation article) are mandatory!

Connecting Cloudflare to Integromat

To connect your Cloudflare account to Integromat, you'll need to create an API token or retrieve an API Key in your Cloudflare account.

Choose one of the options for establishing a connection:

  • API Token (allows scoped and permissioned access to resources, and uses the RFC compliant Authorization Bearer Token Header)
  • API Key

Connecting Using an API Token

1. Log in to your Cloudflare account.

2. Click your profile icon in the top-right corner, and select the My Profile option.

LZy9BLP35k.gif

3. Open the API Tokens tab, and click the Create Token button.

U4bUYLnCNk.gif

4. On the API Tokens page, click the Get Started button to create a custom token.

2020-10-02_15_17_09-My_Profile___Cloudflare_-_Web_Performance___Security.png

5. Enter the desired name for your token, and add required permissions and additional permissions needed for the modules you want to use in your scenario. Then click Continue to summary and Create a Token.

REQUIRED PERMISSIONS

Account:Account Settings:Read

User:User Details:Read

Zone:Zone:Read 

WtNim9LDv7.gif

Additional Permissions

MODULE NAMEPERMISSION REQUIRED FOR THE MODULE
Watch ZonesZone:Zone:Read
Create a ZoneZone:Zone:Edit
Change a Zone's SSL SettingZone:Zone Settings:Edit
Change a Zone's Security LevelZone:Zone Settings:Edit
Turn a Zone into Development ModeZone:Zone Settings:Edit
Watch DNS RecordsZone:DNS:Read
Create a DNS RecordZone:DNS:Edit
List DNS RecordsZone:DNS:Read
Patch a DNS RecordZone:DNS:Edit
Delete a DNS RecordZone:DNS:Edit
Export DNS RecordsZone:DNS:Read
Import DNS RecordsZone:DNS:Edit
Create a CertificateRequires the API Key authentication.
List CertificatesRequires the API Key authentication.
Revoke a CertificateRequires the API Key authentication.
Watch User BillingsRequires the API Key authentication.

6. Copy the token provided.

2020-10-02_17_38_54-My_Profile___Cloudflare_-_Web_Performance___Security.png

7. Go to Integromat, open the Cloudflare module's Create a connection dialog, and select the API Token option in the Authentication Method field.

8. Enter the API Token you have copied in step 6 to the respective field, and click the Continue button to establish the connection.

The connection has been established. You can proceed with setting up the module.

Connecting Using API Key

1. Log in to your Cloudflare account.

2. Click your profile icon in the top-right corner, and select the My Profile option.

LZy9BLP35k.gif

3. Open the API Tokens tab, and click the View button for the Global API Key. Enter the password, and copy the displayed Global API Key.

gAtDvibclT.gif

4. Go to Integromat, open the Cloudflare module's Create a connection dialog, and select the API Key option in the Authentication Method field.

5. Enter the Global API Key you have copied in step 3 to the respective field, enter your account email, and click the Continue button to establish the connection.

The connection has been established. You can proceed with setting up the module.

Zones

A Zone is a domain name along with its subdomains and other identities.

Watch Zones

Retrieves details when a zone is created, updated, or activated.

ConnectionEstablish a connection to your Cloudflare account.
EventSelect whether you want to watch created, modified, or activated zones
LimitSet the maximum number of zones Integromat will return during one execution cycle.

Create a Zone

Creates a new zone.

ConnectionEstablish a connection to your Cloudflare account.
Domain NameEnter the domain name of the site you want to add.
Account ID

Enter or select the account ID.

If the account ID is not provided in the drop-down menu, you can obtain the account ID in the URL of your Cloudflare account.
2020-10-05_13_35_44-Account___Cloudflare_-_Web_Performance___Security.png

 

Skip fetching current DNS recordsEnable this option to skip automatic attempt to fetch existing DNS records.
TypeSelect the type. A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup.

Change a Zone's SSL Setting

Changes the SSL setting of the specified site.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to change the SSL setting for.
SSL Setting
  • Off (Not Secure)
    No SSL between the visitor and Cloudflare, and no SSL between Cloudflare and your web server (all HTTP traffic).
  • Flexible
    SSL between the visitor and Cloudflare. The visitor sees HTTPS on your site, but no SSL between Cloudflare and your web server. You don't need to have an SSL certificate on your web server, but your visitors will still see the site as being HTTPS enabled.
  • Full
    SSL between the visitor and Cloudflare. The visitor sees HTTPS on your site and SSL between Cloudflare and your web server. You'll need to have your own SSL certificate or self-signed certificate, at the very least.
  • Full (strict)
    SSL between the visitor and Cloudflare. The visitor sees HTTPS on your site and SSL between Cloudflare and your web server. You'll need to have a valid SSL certificate installed on your web server. This certificate must be signed by a certificate authority, have an expiration date in the future, and respond for the request domain name (hostname).

Change a Zone's Security Level

Adjusts the security settings.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to change the security level for.
Security Level

Select the security level you want to set for the zone specified above.

  • Essentially off
    Only challenges IP addresses with the worst reputation.
  • Low
    Challenges only the most threatening visitors.
  • Medium
    Challenges both moderate threat visitors and the most threatening visitors.
  • High
    Challenges all visitors that exhibit threatening behavior within the last 14 days.
  • I’m Under Attack!
    Only for use if your website is currently under a DDoS attack.

Turn a Zone into Development Mode

Modifies the development mode setting of the zone.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to enable the development mode for.
Development mode

Enable this option to turn on the development mode.

DNS Records

Watch DNS Records

Returns DNS record details when a DNS record is created or modified.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to watch for DNS records.
EventSelect whether you want to watch created or modified DNS records.
LimitSet the maximum number of DNS records Integromat will return during one execution cycle.

Create a DNS Record

Creates a new DNS record for a zone.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to create a new DNS record for.
Type

Select the type of the new DNS record. See the Cloudflare documentation for each type's fields.

List DNS Records

Returns DNS records based on specified criteria.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to list DNS records for.
RequirementSelect the logical operator. Indicate whether to match all search requirements or at least one (any).
NameEnter the DNS record name to filter results by.
ContentEnter the content of the DNS record to filter results by.
TypeSelect the type of the DNS record to filter results by.
ProxiedDNS record proxied status.
OrderSelect the order in which you want to sort returned DNS records.
DirectionSelect the order of the returned domains.
LimitSet the maximum number of DNS records Integromat will return during one execution cycle.

Patch a DNS Record

Partially updates a DNS record.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to update a DNS record for.
DNS Record IDMap or select the identifier of the DNS record you want to update.
TypeSelect the type of DNS record.

Delete a DNS Record

Removes a DNS record.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to delete a DNS record from.
DNS Record IDMap or select the identifier of the DNS record you want to delete.

Export DNS Records

Downloads a BIND configuration file.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to download a BIND configuration file for.
File NameEnter the file name without .zone extension. Leave this field blank to use {zone_name}_{current_datetime}.zone as the file name.

Import DNS Records

Uploads a BIND configuration file.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to upload a BIND configuration file to.
Source FileMap the file you want to upload from the previous module (e.g. HTTP > Get a File or Google Drive > Download a File), or enter the file name and file data manually.

Origin CA

Create a Certificate

ConnectionEstablish a connection to your Cloudflare account.
HostnamesAdd hostnames you want to bind to the certificate.
Requested ValiditySelect the number of days for which the certificate should be valid.
Request TypeSelect the signature type desired on the certificate.
Certificate Signing RequestEnter the CSR (a block of encoded text).

List Certificates

Retrieves origin certificates for the specified zone.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to list certificates from.
LimitSet the maximum number of certificates Integromat will return during one execution cycle.

Revoke a Certificate

Revoke an existing Origin CA certificate.

ConnectionEstablish a connection to your Cloudflare account.
Zone IDMap the zone ID, or select the zone you want to revoke a certificate from.
Certificate IDMap the Certificate ID of the certificate you want to revoke.

Billings

Watch User Billings

Retrieves billing history details when the authorized user is billed.

ConnectionEstablish a connection to your Cloudflare account.
LimitSet the maximum number of billing histories Integromat will return during one execution cycle.

Make an API Call

Allows you to perform a custom API call.

ConnectionEstablish a connection to your Cloudflare account.
URL

Enter a path relative to https://api.cloudflare.com/client
For example: /v4/user.

For the list of available endpoints, refer to the Cloudflare API v4 Documentation.
Method

Select the HTTP method you want to use:

GET
to retrieve information for an entry.

POST
to create a new entry.

PUT
to update/replace an existing entry.

PATCH
to make a partial entry update.

DELETE
to delete an entry.

HeadersEnter the desired request headers. You don't have to add authorization headers; we've already done this for you.
Query StringEnter the request query string.
BodyEnter the body content for your API call.

Example of Use - List Zones

The following API call returns all zones in your Cloudflare account:

URL:
/v4/zones

Method:
GET

2020-10-07_12_13_46-Integration_Cloudflare___Integromat.png

The result can be found in the module's Output under BundleBody > result
In our example, 2 zones were returned:

2020-10-07_12_14_51-Integration_Cloudflare___Integromat.png

Common Problems

The operation failed with an error. [403] Error 9109: Unauthorized to access requested resource

Add the permission to your API Token that is required by the module you want to use. Please see the additional permissions list.

The operation failed with an error. [501] Error 10000: API Tokens are not supported by this API for now.

Connect using an API Key.

 

Popular use cases from our blog

automated-data-collection-crm-illustration

How to Automate Data Collection - Part 5: CRM Systems

automated-data-collection-chatbot-marketing-illustration

How to Automate Data Collection - Part 4: Chatbot Marketing

automated-data-collection-paid-ads-illustration

How to Automate Data Collection - Part 3: Paid Ads

automated-data-collection-email-illustration

How to Automate Data Collection - Part 2: Email Marketing Segmentation

personalized-customer-experience-illustration-integromat

5 Automated Solutions to Personalize Customer Experience

data-collection-automation-forms-pt-1

How to Automate Data Collection - Part 1: Online Forms

Didn’t find what you were looking for?

Expert

Find an expert

We feature a network of 450+ certified partners across the globe who are ready to help

Find an expert

Automate any workflow in your business

Sign up for a free account today. No credit card required, no time limits on free plan.