> For the complete documentation index, see [llms.txt](https://docs.tryterra.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tryterra.co/faq/help-topics/something-else/custom-subdomains-ssl-and-security/custom-subdomain-redirect-webhook-setup.md).

# What redirect and webhook URLs do I use for a custom WHOOP subdomain?

For a custom-credential provider connection, the redirect URI registered with the provider must be a **subdomain on your own domain** (for example `whoop.yourdomain.com`), not Terra's API URL.

For Whoop:

* Redirect URL: `https://whoop.yourdomain.com/auth/whoop/oauth2`
* Webhook URL: `https://whoop.yourdomain.com/hooks/whoop/push` (append `/CLIENT_ID` where required, webhook v2)

**Set up the CNAME record pointing to the Terra load balancer** as described in the [WHOOP setup guide](https://docs.tryterra.co/health-and-fitness-api/whoop).

The subdomain is tied to a specific domain. If your production domain changes:

{% stepper %}
{% step %}
Set up a new CNAME for the new subdomain.
{% endstep %}

{% step %}
Add your Client ID, Secret and matching redirect URL in the dashboard.
{% endstep %}

{% step %}
Configure the redirect, webhook and all scopes in the provider's developer portal.
{% endstep %}
{% endstepper %}

Once the CNAME is in place, Terra issues the SSL certificate and sends a validation record. The redirect URL whitelisted in the provider portal must match exactly, or OAuth fails with a redirect mismatch error.
