Delete a custom domain by its name in the GraphQL api

!Hi there!

Render seems absolutely great to me due to the fact that they have a GraphQL api (I am super aware of the rest api) to handle custom domains: https://render.com/docs/api

Without a doubt, this is something super differential with respect to the competition.

However, I would like to know if there is any way to delete a custom domain by its name (example.com) and not by its id (cd-XXX) using the current GraphQL api while we wait for the rest api.

I think it would be much easier to save the domain name in my database and not be looking at the id (there should be no duplicates anyway).

Thank you very much in advance.

Hey, thanks for the kind words! If you have the server ID of the service your domain is used for, you will be able to query for the domain ID like this:

query customDomains($serverId: String!) {
  customDomains(serverId: $serverId) {
    id
    name
  }
}

This gives you all the domains you are using for that given service, but then it will be easy to find the domain ID for the name you have in mind. Let me know if this helps.

Thank you!

And if I want to get the details and the status of only a specific domain? (not including all)

Hi @eduardo.devop, there’s no endpoint for this in the GraphQL API, but the REST API will have endpoints for accessing/operating on specific domains by name or id. Are you interested in early access to the REST API?

Yes! Absolutely yes, we already have our backend integrated with the GraphQL api, but if you give me early access, we can switch to the REST API.

I would greatly appreciate it.

Fantastic! You’ll hear from us soon @eduardo.devop.

1 Like