Create DNS Records in customers cloudflare account

Hello,
I am looking for a way to create DNS records for a customers domain in the customers cloudflare account. I jus setup a domain in Office365 and during the setup, it was detected, that my domains dns servers are the cloudflare servers. I got a button to login into my cloudflare acount. After that, i needed to confirm the dns records needed for Office365 and they where automatically set.

How can i add this feature to my own application? I could not find something useful in the docs.
Thanky for helping me out

best regards

To add this feature to your application, you’d need to use Cloudflare’s API. With the customer’s consent, your application could create, edit, or remove DNS records in their account. However, before implementing this, you should ensure you and your customers understand the security implications, as this could potentially allow your application to change vital settings. For more details and implementation guides, check out the official documentation on Cloudflare’s API: Cloudflare API Documentation

1 Like

There’s also Domain Scoped Roles, which is now available on all plan levels. An account owner can invite someone to be a DNS admin for a specific domain.

This is described in a Birthday Week blog post:

3 Likes

Hello,
thanky for your reply. It is not very clear to me, how i can implement this using the api. Could you please give me a simple summary what i have to do or which endpoints i need? Would be great.
best regards

1 Like

I think you’d need to have a role as described by sdayman and an API token for that role. Your app could then make the api calls using those credentials. But, if you want that to scale to multiple different accounts you likely do need to use a different approach. How many accounts do you envision your app controling?

1 Like

I want to offter this feature to all customers. So in theory, there is no limit. Currently, i expect abount 100 customers to use the feature.
But i do not want to control the account for a long time. I only want to set dns records for a domain one time. I will try to show you a screenshot from the Office365 Admin Center to show you what i want to do.

Here is a screenshots of the domain setup.

That should be DomainConnect. Have a look at https://www.domainconnect.org/ for more information.

4 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.