# ovok_sdk.auth.saved_accounts_store

Canonical page: https://docs.ovok.com/python-sdk/reference/auth/saved_accounts_store

The accounts a user has signed in to on this client, kept in `OvokStorage`.

## SavedAccount [#savedaccount]

```python
SavedAccount(
    id: str,
    profile: OvokReference,
    project: OvokReference,
    active: bool,
    expired: bool,
)
```

An account signed in to on this client, without its tokens.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `id` | `str` | The account's profile reference, such as `Patient/123`. |
| `profile` | `OvokReference` | The account's profile. |
| `project` | `OvokReference` | The project the account signed in to. |
| `active` | `bool` | Whether it is the account signed in now. |
| `expired` | `bool` | Whether its session ended; signing in again renews it. |

## StoredSavedAccount [#storedsavedaccount]

```python
StoredSavedAccount(session: Session, expired: bool)
```

A saved account's session and whether it has expired.

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `session` | `Session` | The account's last session; its tokens are empty once it expired. |
| `expired` | `bool` | Whether the session ended. |

### account_id [#account_id]

```python
account_id: str
```

The account's profile reference.

## SavedAccountsStore [#savedaccountsstore]

```python
SavedAccountsStore(storage: OvokStorage, key: str)
```

Keeps saved accounts as JSON in the TypeScript SDK's shape, newest first.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `storage` | `OvokStorage` |  | Where the accounts are kept. |
| `key` | `str` |  | Storage key of the accounts. |

### for_tenant() [#for_tenant]

```python
for_tenant(storage: OvokStorage, tenant_code: str) -> SavedAccountsStore
```

One key per tenant, next to the tenant's session.

### list() [#list]

```python
list(active_account_id: str | None) -> list[SavedAccount]
```

List the saved accounts, marking `active_account_id` active.

### get() [#get]

```python
get(account_id: str) -> StoredSavedAccount | None
```

Return the saved account `account_id`, or None.

### save() [#save]

```python
save(session: Session) -> None
```

Save `session` as a live account, replacing the same account or adding it first.

### mark_expired() [#mark_expired]

```python
mark_expired(account_id: str) -> None
```

Forget the tokens of `account_id` and mark it expired.

### remove() [#remove]

```python
remove(account_id: str) -> None
```

Forget `account_id`.
