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

# Add a Guardian After Wallet Creation

You can add guardian recovery after a wallet already exists, as long as the
wallet's current authority can still sign.

Use this flow when the wallet was created first and recovery needs to be turned
on afterward.

## What happens in this flow

The setup still happens in two steps:

1. add the hidden recovery-authority role
2. configure the guardian public key and recovery delay

The hosted endpoints behind this flow are:

* `POST /transaction/wallet/recovery-authority/add`
* `POST /transaction/recovery/configure`

## Prepare the setup

<CodeGroup dropdown>
  ```typescript TypeScript theme={null}
  const wallet = swig.wallets.use(existingWallet);

  const setup = await wallet.recovery.prepareSetup({
    feePayer,
    requesterAuthority,
    guardianPubkey,
    delaySeconds: 86_400,
  });
  ```

  ```python Python theme={null}
  wallet = swig.wallets.use(existing_wallet)

  setup = await wallet.recovery.prepare_setup(
      fee_payer=fee_payer,
      requester_authority=requester_authority,
      guardian_pubkey=guardian_public_key,
      delay_seconds=86_400,
  )
  ```
</CodeGroup>

This returns:

* `setup.addAuthorityTransaction` / `setup.add_authority_transaction`
* `setup.configureRecoveryTransaction` / `setup.configure_recovery_transaction`

## Signing model

| Transaction                                                                   | Who signs                                      |
| :---------------------------------------------------------------------------- | :--------------------------------------------- |
| `setup.addAuthorityTransaction` / `setup.add_authority_transaction`           | the wallet's current authority                 |
| `setup.configureRecoveryTransaction` / `setup.configure_recovery_transaction` | the backend recovery operator already signs it |

After the current authority signs the add-authority transaction, the remaining
work is fee-payer or sponsor submission for the configure transaction.

## When to use this page instead of initial recovery setup

* use [Set Up Recovery](/developer-sdk/recovery-setup) when recovery is part of
  the initial wallet create flow
* use this page when the wallet already exists and you are enabling recovery later
