> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stablepay.global/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Primary Bank Account

> Choose the default account a user's payouts are sent to

# Set Primary Bank Account

Makes this account the user's default payout destination and clears the flag on their other accounts. No request body.

The first verified account is primary automatically. Verifying more accounts later does not change it.

**userId** `string` *required*

The user ID

**bankAccountId** `string` *required*

The account to make primary, from [List Bank Accounts](https://docs.stablepay.global/api-reference/users/list-bank-accounts.md). Must be verified.

> [!NOTE]
>
> To send a single payout to a non-primary account, pass `bankAccountId` on [Create Transaction](https://docs.stablepay.global/api-reference/transactions/create-transaction.md) instead. Switching the primary before each payout is racy when two payouts for the same user are in flight.

## Request

```bash theme={null}
curl -X PUT https://api.stablepay.global/v2/users/usr_abc123/bank-accounts/8b1d07e2-3c4f-4a90-b6d1-2e7f9a0c5b18/primary \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Response

```json theme={null}
{
  "success": true,
  "data": {
    "bankAccountId": "8b1d07e2-3c4f-4a90-b6d1-2e7f9a0c5b18",
    "instrumentId": "8b1d07e2-3c4f-4a90-b6d1-2e7f9a0c5b18",
    "externalId": "pi_90457",
    "isPrimary": true,
    "maskedAccountNumber": "XXXXXX4412",
    "ifsc": "ICIC0000123",
    "bankName": "ICICI Bank"
  }
}
```

If the account is already primary, the call succeeds without changes:

```json theme={null}
{
  "success": true,
  "data": { "bankAccountId": "8b1d07e2-3c4f-4a90-b6d1-2e7f9a0c5b18", "isPrimary": true, "unchanged": true }
}
```

## Errors

| Status | `code` / `error` | Description |
| - | - | - |
| 400 | `BANK_NOT_VERIFIED` | Only a verified account can be made primary |
| 404 | `Not Found` | User not found, or the account doesn't belong to this user |
| 500 | `Internal Server Error` | Unexpected failure |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.