Cloudflare - Create DNS record
@sergio
code:
data:privatelast updated:4 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
cloudflare_create_dns_record
Creates a DNS Record given its zone id
auth
(auths.cloudflare_api_key)
params
Zone id

The zone ID where the DNS record being created belongs to.

 
string ·params.zone_id
Type

DNS record type.

string ·params.type
Name

DNS record name.

 
string ·params.name
Content

DNS record content.

 
string ·params.content
Ttl

Time to live for DNS record. Value of 1 is 'automatic'.

 
integer ·params.ttl
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
}
23

return await require("@pipedreamhq/platform").axios(this, {
 method: "post",
 url: `https://api.cloudflare.com/client/v4/zones/${params.zone_id}/dns_records`,
 headers: {
    "X-Auth-Email": `${auths.cloudflare_api_key.Email}`,
    "X-Auth-Key": `${auths.cloudflare_api_key.API_Key}`,
   "Content-Type": "application/json"
   
 },
 data: {
    type: params.type,
    name: params.name,
    content: params.content,
    ttl: params.ttl,
    proxied: params.proxied,
    priority: params.priority    
 }
});