# Account takeover detection (/score-api/endpoints/account-takeover)



{/* Written by scripts/build-use-cases.mjs from internal/usecases/catalog.json and use-cases/site.json. Change those, not this file. */}

**Spot the takeover before the money moves.** Score logins, password resets and contact changes as they happen. Describe the activity and what is normal for the account, and get a score for how likely it is that someone else is in control.

| Endpoint                          | Price           | Group               |
| --------------------------------- | --------------- | ------------------- |
| `POST /v1/score/account_takeover` | $0.002 per call | Identity & Accounts |

## Request [#request]

Send what you know in one `context` object. `activity` is required; every other field is optional. A field can hold text, JSON or CSV.

<Tabs items="[&#x22;curl&#x22;, &#x22;Python&#x22;, &#x22;TypeScript&#x22;]">
  <Tab value="curl">
    ```bash
    curl https://api.finic.ai/v1/score/account_takeover \
      --header "Authorization: Bearer $FINIC_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
        "context": {
          "activity": [
            { "at": "2026-11-25T15:02:11Z", "type": "login", "new_device": true },
            { "at": "2026-11-25T15:04:40Z", "type": "password_reset" },
            { "at": "2026-11-25T15:08:02Z", "type": "email_changed" },
            { "at": "2026-11-25T15:09:30Z", "type": "payee_add_started" }
          ],
          "account": { "opened": "2019-04-02", "usual_login_city": "Columbus, OH", "usual_device": "iPhone 15", "email_last_changed": "2020-01-15" },
          "device": { "os": "Windows 11", "browser": "Chrome 131", "seen_on_account": false },
          "ip": { "address": "203.0.113.77", "city": "Lagos", "country": "NG", "network": "mobile" },
          "other_context": "Customer called support at 15:30 to say they cannot log in"
        }
      }'
    ```
  </Tab>

  <Tab value="Python">
    ```python
    import os
    import requests

    response = requests.post(
        "https://api.finic.ai/v1/score/account_takeover",
        headers={"Authorization": f"Bearer {os.environ['FINIC_API_KEY']}"},
        json={
            "context": {
                "activity": [
                  { "at": "2026-11-25T15:02:11Z", "type": "login", "new_device": True },
                  { "at": "2026-11-25T15:04:40Z", "type": "password_reset" },
                  { "at": "2026-11-25T15:08:02Z", "type": "email_changed" },
                  { "at": "2026-11-25T15:09:30Z", "type": "payee_add_started" }
                ],
                "account": { "opened": "2019-04-02", "usual_login_city": "Columbus, OH", "usual_device": "iPhone 15", "email_last_changed": "2020-01-15" },
                "device": { "os": "Windows 11", "browser": "Chrome 131", "seen_on_account": False },
                "ip": { "address": "203.0.113.77", "city": "Lagos", "country": "NG", "network": "mobile" },
                "other_context": "Customer called support at 15:30 to say they cannot log in"
            }
        },
        timeout=30,
    )
    response.raise_for_status()
    print(response.json()["score"])
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const response = await fetch("https://api.finic.ai/v1/score/account_takeover", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.FINIC_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        context: {
          "activity": [
            { "at": "2026-11-25T15:02:11Z", "type": "login", "new_device": true },
            { "at": "2026-11-25T15:04:40Z", "type": "password_reset" },
            { "at": "2026-11-25T15:08:02Z", "type": "email_changed" },
            { "at": "2026-11-25T15:09:30Z", "type": "payee_add_started" }
          ],
          "account": { "opened": "2019-04-02", "usual_login_city": "Columbus, OH", "usual_device": "iPhone 15", "email_last_changed": "2020-01-15" },
          "device": { "os": "Windows 11", "browser": "Chrome 131", "seen_on_account": false },
          "ip": { "address": "203.0.113.77", "city": "Lagos", "country": "NG", "network": "mobile" },
          "other_context": "Customer called support at 15:30 to say they cannot log in"
        },
      }),
    });
    const { score, questions } = await response.json();
    ```
  </Tab>
</Tabs>

## Fields you send [#fields-you-send]

Send the details, not only an ID: an account ID tells the score nothing, but the account's age, profile and history do. Fields that are not in this list are also read.

| Field           |          | Description                                                                                                                   |
| --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `activity`      | Required | The session's events, in order, with timestamps.                                                                              |
| `account`       | Optional | A description of the account, not an account ID: its age, the contact details on file, and how the customer usually signs in. |
| `device`        | Optional | A description of the device in use now: its type, its operating system, and whether this account has used it before.          |
| `ip`            | Optional | The IP address with what your lookup says about it: country, city and network type. An address by itself says little.         |
| `next_action`   | Optional | What the session is trying to do next.                                                                                        |
| `other_context` | Optional | Any other information, structured or unstructured, that is useful for scoring.                                                |

## Response [#response]

`score` runs from 0, the lowest risk, to 1000, the highest. `questions` are the yes/no questions behind it, each with the probability that the answer is yes.

```json title="200 OK"
{
  "score": 884,
  "questions": [
    {
      "text": "Is this the first time the account has used this device?",
      "probability": 0.95
    },
    {
      "text": "Were the password and contact details changed within minutes of each other?",
      "probability": 0.94
    },
    {
      "text": "Is the login far from where the customer usually signs in?",
      "probability": 0.92
    },
    {
      "text": "Is the session about to move money or add a payee?",
      "probability": 0.86
    }
  ],
  "request_id": "req_01M4YF1068X8B4C458ENPD4JHT"
}
```

## The questions behind the score [#the-questions-behind-the-score]

1. Is this the first time the account has used this device?
2. Were the password and contact details changed within minutes of each other?
3. Is the login far from where the customer usually signs in?
4. Is the session about to move money or add a payee?

Every organization gets the same questions for this score. To use your own questions, or to calibrate a score to your own outcomes, copy it to a [custom scoring model](/score-model) in the Finic app (Starter plan and above).

## Turn the score into an action [#turn-the-score-into-an-action]

These thresholds are examples. Choose your own, and change them as you learn.

| Score       | Action  | Example                          |
| ----------- | ------- | -------------------------------- |
| Under 300   | Approve | Let the login or change through. |
| 300 to 599  | Step up | Ask for a second factor.         |
| 600 to 849  | Review  | Hold the change for an analyst.  |
| 850 or more | Block   | Lock the session.                |

## Errors [#errors]

| Status | `type`                 | When                                                                                                            |
| ------ | ---------------------- | --------------------------------------------------------------------------------------------------------------- |
| 400    | `invalid_request`      | `context` is missing, is not a JSON object, or a required field (`activity`) is empty. `param` names the field. |
| 401    | `authentication_error` | The API key is missing or not valid.                                                                            |
| 402    | `insufficient_credit`  | The organization has no credit. Add credit in the Finic app.                                                    |
| 429    | `rate_limited`         | Too many requests. Retry with exponential backoff.                                                              |

See the [API reference](/reference) for every error and limit, and [Pricing](/pricing) for what a call costs.
