How much time does it take to approve a domain being add via api

Hi

I tried an api call from Cloudflare api to add a domain

I got the success response but with status “approving”

{ “result”: { “id”: “d66724ad7-9aa6-4d75-a701-bcf986783932”, “domain_id”: “92724ad7-9aa6-4d75-a701-bcf986383932”, “name”: “xyztestman.net”, “status”: “initializing”, “verification_data”: { “status”: “pending” }, “validation_data”: { “status”: “initializing”, “method”: “http” }, “certificate_authority”: “lets_encrypt”, “created_on”: “2023-08-20T12:12:49.951724Z” }, “success”: true, “errors”: , “messages”: }

Please tell me when the status will change to approved.

Thanks

xyztestman.net does not appear to be a registered domain.

alright, does it mean I have to buy a legitimate domain first to add it to Cloudflare?

Sure, if you don’t own a domain, there’s no point in adding it. You can always purchase it on Cloudflare.

Thanks, but usually I am forced to buy a domain with yearly plan, is there any way to buy a test domain for a month or less validity ?

You need to clarify this with your registrar. On Cloudflare you can only register them for a year.

Thanks, actually I am a new to Cloudflare.

I need to accomplish this task assigned by my organization>

and a rule Forward URL:
*.domain.tld
301 forward
to: http: / / w ww. somedomain .com (always the same, must be set somewhere in the file)

But not actually able to get it

need to add this rule via api

That’s a different question, please open a separate thread on that, however the search and Tutorial should have all the information anyhow.

alright, its been great help. many thanks

Pleasure

I purchased a domain from Godaddy. com

Now I want to add it to Cloudflare using its api.

is it possible?

Sure, but you already did that, didn’t you?

What’s the domain and what did the API say?

The response I showed in my first post was while adding an unregistered domain.

But now I created new one “pepkorn. com” with Godaddy and again tried my api code for adding it to Cloudflare

Well, the response from before obviously won’t work. The point is what you got when you added your domain.

“name”: “pepkorn. com”, “status”: “initializing”, “verification_data”: { “status”: “pending” }, “validation_data”: { “status”: “initializing”, “method”: “http” }, “certificate_authority”: “lets_encrypt”, “created_on”: “2023-08-24T15:38:57.14804Z” }, “success”: true,

Which URL did you call? You can redact the account-specific information.

$account_identifier = ‘my account id here’;
$project_name = ‘smallp’;
curl_setopt_array($curl, [
CURLOPT_URL => “https ://api .cloudflare. com
/client/v4/accounts/$account_identifier/pages/projects/$project_name/domains”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => “{\n "name": "pepkorn . com"\n}”,
CURLOPT_HTTPHEADER => [
“Content-Type: application/json”,
“X-Auth-Key: MY API KEY”,
“X-Auth-Email: MY REGISTERED EMAIL”
],
]);

That is not the correct URL, that seems to be Pages related.

You need to use Cloudflare API Documentation.

but it looks for adding a zone and not the domain?