# Customer account activity

Send customer registration and login events to Stripe.

> #### Availability
> 
> You can use the Account Activities API in a sandbox with any Radar plan. To use the API in live mode, you must have Radar Pro or a Radar Pro trial.

Use the [Account Activities API](https://docs.stripe.com/api/v2/signals/account-activities/create.md?api-version=preview) to send registration and login events to Stripe without requesting a risk evaluation. These events build an activity history for your customers, allowing you to integrate activity reporting before adding risk-based decisions to your registration or login flow.

Creating an `AccountActivity` records the event but doesn’t return a risk score. To receive multi-accounting or account-sharing scores, use [Customer account evaluations](https://docs.stripe.com/radar/customer-account-evaluations.md). An evaluation request can also record the activity in the same call.

## Before you begin

- [Create a customer](https://docs.stripe.com/api/customers/create.md) or use an existing `Customer`. Use the same customer ID for the customer’s registration, login, and payment activity. Make sure all objects belong to the same sandbox or live environment as the API request.
- Send Account Activities API requests from your back-end server. Store your API key in an environment variable or secrets manager, and use a restricted key with the required permissions when possible. See [best practices for managing secret keys](https://docs.stripe.com/keys-best-practices.md).

## Capture device data

When a customer attempts to register or log in, use Stripe.js to [create a Radar Session](https://docs.stripe.com/radar/radar-session.md) on the client. Send the session ID to your server with the event. Create a Radar Session shortly before reporting each attempt because sessions expire soon after creation.

If you can’t create a Radar Session, provide the customer’s IP address in `client_details.data.ip` instead of `client_details.radar_session`. You can also provide `client_details.data.user_agent` and `client_details.data.referrer`. Radar Sessions provide more device information than IP addresses alone.

## Report a registration attempt

Send a `registration_attempt` activity when a customer attempts to create an account with your business. Include the customer ID and Radar Session for the attempt:

```curl
curl -X POST https://api.stripe.com/v2/signals/account_activity \
  -H "Authorization: Bearer <<YOUR_SECRET_KEY>>" \
  -H "Stripe-Version: 2026-08-26.preview" \
  --json '{
    "account_details": {
        "customer": "cus_****"
    },
    "type": "registration_attempt",
    "registration_attempt": {
        "client_details": {
            "radar_session": "rse_****"
        }
    }
  }'
```

Stripe returns an `AccountActivity` with `type` set to `registration_attempt`. You don’t need to create an `AccountEvaluation` to send this event.

## Report a login attempt

Send a `login_attempt` activity when an existing customer attempts to log in. Include the same customer ID and a Radar Session created for the login attempt:

```curl
curl -X POST https://api.stripe.com/v2/signals/account_activity \
  -H "Authorization: Bearer <<YOUR_SECRET_KEY>>" \
  -H "Stripe-Version: 2026-08-26.preview" \
  --json '{
    "account_details": {
        "customer": "cus_****"
    },
    "type": "login_attempt",
    "login_attempt": {
        "client_details": {
            "radar_session": "rse_****"
        }
    }
  }'
```

Stripe returns an `AccountActivity` with `type` set to `login_attempt`. Send every login attempt, including attempts for which you don’t request a risk evaluation.

## Record when an activity occurred

By default, `occurred_at` is the activity’s creation time. To report an earlier event, set `occurred_at` to when the event occurred using an ISO 8601 timestamp, such as `2026-09-10T12:00:00Z`.

## Test your integration

Use a sandbox customer and a Radar Session created in the same environment to send each attempt type. Confirm that the returned `AccountActivity` contains:

- The expected `type`: `registration_attempt` or `login_attempt`.
- Your customer ID in `account_details.customer`.
- The Radar Session ID in the attempt’s `client_details.radar_session`.

A successful response confirms that Stripe recorded the activity, but doesn’t indicate whether the attempt is abusive. To test risk scores and report the decisions based on them, follow the [customer account evaluation integration guide](https://docs.stripe.com/radar/customer-account-evaluations.md#test-integration).
