# Subscribe to IdP Radar alerts

<div class="api-op" data-api-operation>
<div class="api-op__main">

<p class="api-endpoint"><span class="method method-put">PUT</span> <code>/v1/idp_radar/alert_subscription</code></p>

Opts the environment in to IdP Radar alerts: an idp_radar.alert event and an email to `email` when sign-ins through an IdP type fail well above their baseline across at least 50 organizations. `idps` limits the alerts to those IdP types; empty or absent means every IdP type. Replaces any existing subscription.

<dl class="api-facts"><div><dt>Scope</dt><dd><code>environment:write</code></dd></div><div><dt>Auth</dt><dd>Secret key (<code>sk_…</code>)</dd></div><div><dt>Since</dt><dd>1.0</dd></div></dl>

## Headers

<ul class="api-fields">
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">OhAuthCat-Version</code> <span class="api-field__type">string</span></p>
Minor version; defaults to the environment's pin.
</li>
</ul>

## Request body

<ul class="api-fields">
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">email</code> <span class="api-field__type">string (email)</span> <span class="api-field__required">Required</span></p>

<p class="api-field__chips">min length 3 · max length 254</p>
</li>
<li class="api-field">
<p class="api-field__head"><code class="api-field__name">idps</code> <span class="api-field__type">array of string</span></p>

<p class="api-field__chips">max items 8</p>
</li>
</ul>

## Responses

<ul class="api-responses">
<li class="api-response"><span class="api-status api-status--ok">200</span> <span>OK <span class="api-field__type">RadarAlertSubscription</span></span></li>
<li class="api-response"><span class="api-status api-status--neutral">default</span> <span>Any other error, including <a href="/errors/internal_error/">internal_error</a>. Every code is in the error catalogue. <span class="api-field__type">Error</span></span></li>
</ul>

Errors share one shape; see the [error code catalogue](/errors/).

</div>
<div class="api-op__code">

**curl**

```sh wrap
curl -X PUT \
  "https://api.ohauthcat.com/v1/idp_radar/alert_subscription" \
  -H "Authorization: Bearer $OHAUTHCAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "jane@acme.com"
}'
```

**Node**

```javascript wrap
const response = await fetch(
  "https://api.ohauthcat.com/v1/idp_radar/alert_subscription",
  {
    method: "PUT",
    headers: {
      Authorization: `Bearer ${process.env.OHAUTHCAT_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      email: "jane@acme.com",
    }),
  },
);
const data = await response.json();
```

**Python**

```python wrap
import os
import requests

response = requests.put(
    "https://api.ohauthcat.com/v1/idp_radar/alert_subscription",
    headers={"Authorization": f"Bearer {os.environ['OHAUTHCAT_API_KEY']}"},
    json={
        "email": "jane@acme.com",
    },
)
data = response.json()
```

```json title="Response 200" wrap
{
  "object": "radar_alert_subscription",
  "email": "jane@acme.com",
  "idps": ["okta"],
  "created_at": "2026-01-15T09:30:00Z"
}
```

</div>
</div>
