anyone successfully manage to use the public API to dynamically generate a custom domain?
just want to check if anyone has been able to and if they can share their graphql query https://docs.railway.app/reference/public-api#examples
otherwise i'm planning to try it later in the week and will report back
thanks!
Solution:Jump to solution
```graphql
mutation customDomainCreate($input: CustomDomainCreateInput!) {
customDomainCreate(input: $input) {
id
domain...
17 Replies
Project ID:
63b7280d-bfb7-499f-89d2-73fd8e2a081b
63b7280d-bfb7-499f-89d2-73fd8e2a081b
well you can only generate a single railway provided domain
do you mean to ask how to add custom domains to a service?
ah i meant like a custom domain - cname + target
being able to generate dynamically would be awesome
since right now we have clients who use our subdomains
e.g. myapp.kalder.app
well I don't know what you mean by dynamically, you need to own the domain you are adding
and would be cool if they can point their own custom domains, in a self-serve way from our app
like if we can just give them the cname + target (from railway api) and tell them to do it themselves in cloudflare or wherever
ah okay so if user has domain.xyz you want to add that domain to the railway service and get back the cname to give to the client
yes! that would be amazing
right now it's kind of manual
(on our end)
sure that can be done, are you on the pro plan by chance?
not yet - but will upgrade as necessary!
generally once a project that hosted with railway gains a userbase it would be required to upgrade to pro
but just stating that, you can make this mutation on any plan type
gotcha we'll upgrade tmrw thanks for lmk
just upgraded!
appreciate the help - glad to know it's possible!
ill get you that mutation now
Solution
you may also want this query too
ive been told there is no limit on the amount of custom domains you can create on a service
awesome, this is super helpful, appreciate it a ton!!
no problem!