> 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tryterra.co/faq/help-topics/something-else/custom-subdomains-ssl-and-security/custom-subdomain-redirect-webhook-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
