Saas api for create custom hostnames

Hi Guys,

I am implementing our own saas api to add custom domain for our customers domains with txt validation.
Currently we could do following steps in cloudflare web pages:

1, add a custom domain here:

2, after the submission, we get a txt value from cloudflare and we ask our client to add this txt value in their dns records, and it will be validated after some seconds.

In order to do this via api, we found this:

and we tried following request

## Create Custom Hostnames
curl -X "POST" "" \
     -H 'X-Auth-Key: xxx' \
     -H 'X-Auth-Email: [email protected]' \
     -H 'Authorization: Bearer xxx' \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "ssl": {
    "bundle_method": "ubiquitous",
    "wildcard": false,
    "method": "txt",
    "certificate_authority": "google",
    "type": "dv"
  "custom_metadata": {
    "key": "value"
  "hostname": ""

and cloudflare server always respond with:

  "result": {
    "ssl": null
  "success": false,
  "errors": [
      "code": 1459,
      "message": "Certificate Authority selection is only available on an Enterprise plan.  If you're interested in the Enterprise plan,  please fill out this form and someone from our sales team will contact you:"
  "messages": []

it seemed our post body is wrongly construced, can anyone advise a correct sample body for txt validation?

Hi @mark123456 Have you tried removing this part from the API call

since this is not possible on a non-ENT plan, as the error message mentions?

1 Like

thx @jochen,
its working now…

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