Skip to content

Instantly share code, notes, and snippets.

@warrenski
warrenski / postman-cloudflare-migadu.js
Created August 3, 2022 09:05 — forked from sam-heller/postman-cloudflare-migadu.js
Provision Migadu Email to a Cloudflare domain via Postman
//Parent Request to https://api.cloudflare.com/client/v4/zones/**zone_id**/dns_records?type=mx,txt,cname,srv
const current_zone = ''; //Zone ID
const verify_code = ''; //value from the hosted-email-verify TXT entry supplied by Migadu
const host = ''; //Hostname
const cloudflare_token = ''; //Cloudflare API Token
const base_url = 'https://api.cloudflare.com/client/v4';
const dns_records_url = base_url + '/zones/' + current_zone + '/dns_records/';
request = {header: {"Authorization" : "Bearer " + cloudflare_token,"Content-Type" : "application/json"}};
const updates = [