but sadly, after weeks of work no results,
can you guide me to correct API and its doc (if any)
i also tried to inspect on UI to look for APIs but unable to get the proper one.
The custom_domain attribute is part of the site object and it is updated there.
Note, the URLs that the UI use are slightly different and look like this:
https://app.netlify.com/access-control/bb-api/api/v1/sites/<site id goes here>
The JSON payload looks like this:
{"custom_domain":"subdomain.example.com"}
Please let us know if that does not work as promised or if there are other questions.
I also want to mention one more important detail to know about the site creation APIs at Netlify. It is a detail which is not well documented (but I have discussed it repeatedly in these support forum posts) which is this:
most settings cannot be configured when creating the site during the initial API call
This means that two API calls are required to set all settings for a site. The two API calls are:
an initial API call to create the site in the database
a second API call to update all the other attributes of the site after it exists
So, if you try to set a custom domain when creating a site, it will not work. However, if you create the site with one API call and then update the custom domain with a second API call, that will succeed.