Set Custom Domain
Attach a custom domain to an application with POST /v2/apps//network/custom, or send @ to remove it. Available on Standard, Pro and Enterprise.
POST
Set Custom Domain
Is necessary to have at least the Standard plan to use this route.
The same account may attach one domain to multiple applications (load balancing): up to 2 applications on Standard, 5 on Pro, and 10 on Enterprise. See List Load Balancers.
Requires an API key with the
On failure, the response includes an error
string
required
The API key for your account. You can find this in your account settings.
apps:write scope.
Replacing an existing custom domain releases the previous hostname at the edge before attaching the new one, unless another application on the same account still points at it. The same validation runs whether attaching or removing (custom: "@"): on a workspace-shared application, the caller needs the workspace admin role or ownership.
A domain can only be claimed by one account at a time: attaching a hostname already held by another account returns DOMAIN_ALREADY_EXISTS. To see every hostname configured across your applications, see List Domains. Once attached, fetch the required validation records with Get DNS Records.
Parameters
string
required
The ID of the application. You can find this in the URL of your application’s dashboard.
string
required
The fully qualified domain to attach, or
@ to remove the application’s current custom domain. It cannot be a Square Cloud domain (squareweb.app, squarecloud.app, …).Response
string
Indicates whether the call was successful:
success if it was, error if not.code:
Related
- CLI:
squarecloud app network domain - SDKs:
api.apps.network.setDomain()(JavaScript),client.apps.network.set_domain()(Python),c.Apps.Network.SetDomain()(Go)

