How do I change the auto assigned Subdomain via API

Hi Community!

Today, I was trying to change a subdomain of one of my koyeb instances via API. But the issue is, I couldn’t really find a way to do that. I noticed that this works on the UI, but I’m not sure, if it works via API. Since I really need a programatic way to change the subdomain from x.koyeb.app to y.koyeb.app, I’d really be happy for every answer!

Hey!

You need to use PATCH /v1/domains/{id}. The payload should be
{subdomain: "y"}

You can get the domain id by listing domains or checking the App model

Here’s the API documentation about this endpoint: