OpenRCS API reference · v1 ← Back to console Swagger UI
Accounts

Enrol a phone number for optional SMS MFA (step 1 — sends the code)

POST /account/mfa bearer_auth

Step 1 of the optional SMS MFA opt-in. Registers the `phone_number`, then texts a 6-digit verification code to it. The response returns only the masked delivery destination — the raw phone number is never echoed. Finish with `POST /account/mfa/confirm`. `phone_number` must be a valid E.164 number within the deployment's allowed prefixes (default `+33`). No account-status gate — enrolment is available as soon as the account exists.

Parameters

NameInTypeRequiredDescription
Authorization header string yes Bearer token obtained from `POST /login`.

Request body

FieldTypeRequiredDescription
phone_number string yes E.164 phone number to enrol (allowed prefixes only).
access_token string yes The caller's access token, as returned by `POST /login`. Enrolment is authorized with this access token, which travels as an explicit body field on all three MFA routes — the `Authorization` header carries the id token.
{
  "phone_number": "+33612345678",
  "access_token": "<access_token>"
}

Responses

StatusDescription
200 Verification code texted to the phone.
400 Missing, non-string or oversized `phone_number` / `access_token`, a non-E.164 phone, or a phone outside the allowed prefixes.
401 Missing authorizer claims (`unauthorized`), or an invalid body `access_token` (`invalid access token`).
429 Too many attempts; retry later.
502 Upstream authentication call failed; a generic error is returned and no internals are leaked.

200 example

{
  "mfa_enrolment": "code_sent",
  "delivery_medium": "SMS",
  "destination": "+*******78"
}