# Report a Setup Step

Your app tells Aurea what it did on the device: the second ceremony finished, the user kept the backup, the setup is complete.

## Overview

- `step`: `aux_completed` — the second ceremony finished on the device; `backup_confirmed` — the user kept the backup (it also records the second ceremony: a backup is kept of a wallet that can sign); `active` — the setup is complete (it needs the second ceremony done and the backup confirmed).
- **Forward only and idempotent.** A step already reached changes nothing (`changed` `false`); each step that moves the state sends its `wallet.setup.*` event once ([MPC Wallet Setup › Events](https://docs.aureahub.com/docs/guide-wallet-setup.md)).
- A backup proven with [Start a Backup Proof](https://docs.aureahub.com/docs/mpc-backup-proof-start.md) confirms it without a report.
- `409` `MPC_WALLET_SETUP_STEP_REFUSED` when the step cannot be taken now, with `reason` (`aux_not_done`, `backup_not_confirmed` or `retired`), `state` and `nextStep`. A burst of thirty reports, then one a second (beyond: `429` `MPC_SETUP_THROTTLED`, `Retry-After`).
- The wallet's own user only: `403` `MPC_WALLET_NOT_OWNED`, `404` `MPC_WALLET_NOT_FOUND`.

## Endpoint

### `POST /v1/mpc/wallets/{walletId}/setup`

Authentication: bearer token required.

Records a step of the MPC wallet's setup and answers the setup after it.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `walletId` | string (uuid) | yes | The MPC wallet's id |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `step` | string | yes | aux_completed, backup_confirmed or active |
| `at` | string (date-time) | no | When it happened in your app, for a backfill; within the wallet's life. Omitted: now |
| `dryRun` | boolean | no | true: answer what the report would set (wouldSet) and write nothing |

**Responses**

`200` OK

```json
{
  "setup": { "walletId": "7c1e9b24-3f5a-4d8e-9b6c-1a2f3e4d5c6b", "state": "backup_confirmed", "nextStep": "activate", "canReceive": true, "canSpend": true, "…": "…" },
  "changed": true
}
```

`409` Refused

```json
{
  "statusCode": 409,
  "error": "ConflictError",
  "message": "This wallet's backup is not confirmed: confirm it first",
  "details": {
    "code": "MPC_WALLET_SETUP_STEP_REFUSED",
    "reason": "backup_not_confirmed",
    "state": "ready_for_backup",
    "nextStep": "confirm_backup"
  }
}
```

**Example request**

```bash
curl -X POST https://api.aureahub.com/v1/mpc/wallets/7c1e9b24-3f5a-4d8e-9b6c-1a2f3e4d5c6b/setup \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "step": "backup_confirmed" }'
```

## Backfill

For wallets your app set up before this route, send each step your app recorded with its `at` — first with `dryRun: true`, which writes nothing and answers `wouldSet` (`auxCompletedAt`, `backupReportedAt`, `activatedAt`), then without. `422` `MPC_WALLET_SETUP_REPORT_INVALID` when `at` is before the wallet was registered or in the future.

---

Web version: https://docs.aureahub.com/#mpc-setup-report
