# IAM Account

Version: `2.9.8`

## Purpose

These APIs sync user data between the SaaS backend and IAM.

## Rule

- server-to-server only
- never call them from the browser
- use `app_key` + `secret_key`

## Methods

- `linkPhone()`
- `linkEmail()`
- `refreshUserInfo()`
- `refreshUserInfoBulk()`
- `updateAvatar()`
- `resetAvatar()`

## Update profile info

`update_infos` belongs with the profile sync flow. IAM is the source of truth, the SaaS mirrors the result after a successful update.

## Profile token rule

The profile helpers in `profile.ts` and `profileMedia.ts` require the current
`iam_token` to already be available in local auth storage.

- `getProfile()`
- `updateProfile()`
- `uploadProfileImage()`

If the session is not established yet, those helpers fail with `Token manquant`.
That error means the local IAM session is missing, not that `appAccess` is missing.

## Keep in mind

- `secret_key` must stay server-side
- these helpers do not replace the main SSO flow
