# Sign-in

The step-based sign-in surface, SAML and the exit surface of a suspended tenant.

0 operation(s) for tokens, 43 app-only. The full schemas are in [openapi.json](https://docs.youniton.com/openapi.json) (search the operation ID).

## Ask for an independent account recovery (always the same answer)

`POST /auth/account-recovery`

- Operation ID: `requestAccountRecovery`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

Request body (application/json, required): `AccountRecoveryStart`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | Accepted; an e-mail goes out only for an eligible account. |  |  |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Cancel with the e-mail's single-use link, without signing in

`POST /auth/account-recovery/cancel`

- Operation ID: `cancelAccountRecoveryByLink`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

Request body (application/json, required): `AccountRecoveryCancel`

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Cancelled (also when it was already ended). |  |  |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The open request of this browser (bound with E1), without a session

`GET /auth/account-recovery/current`

- Operation ID: `getBoundAccountRecovery`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

XM-1024 (G-REC-01). The recovery page reads its request after an E2 provider round trip and on a reload. The answer is the same 204 when no request is open and when the open request belongs to another browser.

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The open request of this browser, with the waits and the E2 providers. | application/json | `object` |
| 204 | No open request is bound to this browser. |  |  |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## E1 — the token from the e-mail's link binds the request to this browser

`POST /auth/account-recovery/email`

- Operation ID: `proveRecoveryEmailControl`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

Request body (application/json, required): `AccountRecoveryEmailProof`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The request with its evidence and what is missing. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Cancel the open request from the recovery browser, without a session

`POST /auth/account-recovery/{requestId}/cancel`

- Operation ID: `cancelBoundAccountRecovery`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

XM-1026 (G-REC-03). Only the browser that the request is bound to can cancel this way. The e-mail's cancel link and a session also cancel.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `requestId` | path | string (uuid) | yes | An account-recovery request id. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | Cancelled. |  |  |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## P1 — the bound browser presents a trusted device of the account

`POST /auth/account-recovery/{requestId}/evidence/device`

- Operation ID: `recordRecoveryDeviceEvidence`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `requestId` | path | string (uuid) | yes | An account-recovery request id. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The updated request. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## E2 — the account's own password, or a Google or Microsoft round trip

`POST /auth/account-recovery/{requestId}/evidence/primary`

- Operation ID: `recordRecoveryPrimaryEvidence`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `requestId` | path | string (uuid) | yes | An account-recovery request id. |

Request body (application/json, required): `AccountRecoveryPrimaryEvidence`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The updated request, or a redirect for a provider round trip. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## P3 — a personal access token of the account, compared by hash

`POST /auth/account-recovery/{requestId}/evidence/token`

- Operation ID: `recordRecoveryTokenEvidence`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `requestId` | path | string (uuid) | yes | An account-recovery request id. |

Request body (application/json, required): `AccountRecoveryTokenEvidence`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The updated request. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Hand the request to Youniton's support for review

`POST /auth/account-recovery/{requestId}/submit`

- Operation ID: `submitAccountRecovery`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-15

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `requestId` | path | string (uuid) | yes | An account-recovery request id. |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The submitted request. | application/json | `object` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Abandon the current sign-in attempt

`POST /auth/cancel`

- Operation ID: `cancelSignInAttempt`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-05

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The attempt is gone (also when none existed). |  |  |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 419 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Issue a pending authenticator secret during a sign-in that requires 2FA

`POST /auth/enrolment`

- Operation ID: `startEnrolmentAtSignIn`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-09

Request body (application/json): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 201 | The pending secret as QR code, setup key and URI, valid 10 minutes. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Confirm the pending secret with a code; returns the recovery codes once and the session (an exit attempt gets its grant, no codes)

`POST /auth/enrolment/confirm`

- Operation ID: `confirmEnrolmentAtSignIn`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-09

Request body (application/json, required): `AuthenticatorConfirmRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The attempt view and, for every attempt except an exit attempt, the eight recovery codes (shown once). An exit attempt (intent exit_export, R09) answers only the attempt view in state exit_granted; its factor issues no recovery codes (XM-1072). | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 410 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Start an exit attempt bound to one tenant; the same neutral attempt view for any slug

`POST /auth/exit`

- Operation ID: `startExitAttempt`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-09

`404 tenant.not_found` only on a tenant-pinned host (XM-1048: the trusted `X-Kanso-Pinned-Tenant` of its edge proxy): there a slug that does not name the pinned tenant (another tenant's, an unknown one, one that cannot exist) gets this one answer. Every other host answers every slug with the same neutral attempt view.

Request body (application/json, required): `ExitStartRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The attempt view with intent exit_export. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Exchange the one-time entry token for an app session as the user

`POST /auth/impersonation/enter`

- Operation ID: `enterImpersonation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-22

Request body (application/json, required): `ImpersonationEntryInput`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The app session now acts as the user; the state for the banner. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Accept with a password (new or existing account) or with the current session

`POST /auth/invitations/accept`

- Operation ID: `acceptInvitation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-TEN-08

Request body (application/json, required): `InvitationAcceptRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The sign-in attempt view — pending_enrolment, pending_second_factor or session with its landing. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 410 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Resolve an invitation token into the landing card

`POST /auth/invitations/lookup`

- Operation ID: `lookUpInvitation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-TEN-08

Request body (application/json, required): `InvitationLookupRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A usable invitation; Cache-Control no-store. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 410 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The provider's redirect back; continues the attempt

`GET /auth/oidc/{provider}/callback`

- Operation ID: `completeOidc`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `provider` | path | string | yes |  |
| `code` | query | string | no |  |
| `state` | query | string | yes |  |
| `error` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 303 | To /sign-in/continue (on the console origin, to the console's sign-in page, R10); the outcome is read from GET /auth/state. |  |  |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Start a Google or Microsoft round trip for an intent

`POST /auth/oidc/{provider}/start`

- Operation ID: `startOidc`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-03

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `provider` | path | string | yes |  |

Request body (application/json, required): `OidcStartRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The provider's authorization URL for a top-level navigation. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Start the console attempt that proves the invited e-mail and enrols TOTP before activation

`POST /auth/operator-invitations/accept`

- Operation ID: `acceptOperatorInvitation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-17

Request body (application/json, required): `OperatorInvitationAcceptRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The console attempt view after the password step — pending_second_factor for an enrolled existing account, else pending_enrolment (R04, R12). | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Resolve an operator invitation token on the console (one neutral 404 for every invalid token)

`POST /auth/operator-invitations/lookup`

- Operation ID: `lookupOperatorInvitation`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-17

Request body (application/json, required): `OperatorInvitationToken`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The invitation's name, e-mail, role and expiry. | application/json | `object` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Verify an e-mail and password and continue the sign-in

`POST /auth/password`

- Operation ID: `signInWithPassword`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-02

Request body (application/json, required): `PasswordSignInRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The attempt view after the evaluation — pending_second_factor, pending_enrolment or session with the landing. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 419 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Ask for a password-reset link (always the same answer)

`POST /auth/password-reset`

- Operation ID: `requestPasswordReset`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-10

Request body (application/json, required): `PasswordResetRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | Accepted; an e-mail goes out only to an active account with a password. |  |  |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Set a new password with the token from the link and continue the sign-in

`POST /auth/password-reset/complete`

- Operation ID: `completePasswordReset`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-10

Request body (application/json, required): `PasswordResetCompleteRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The attempt view (pending_second_factor, pending_enrolment or session). | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Read the password rules of an open reset link (the minimum of the strictest tenant)

`POST /auth/password-reset/policy`

- Operation ID: `readPasswordResetPolicy`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-10

XM-1050 (G-SGN-02; R11). The token goes in the body, never in the address. The answer names no tenant and no account. The completion's limiter applies (per IP, one budget for reads and completions). Every unusable token answers the same `400 password_reset.invalid_token` as the completion. The read writes nothing; the link stays open.

Request body (application/json, required): `PasswordResetPolicyRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The password rules of the link's account. | application/json | `object` |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Record a fresh proof for a re-authentication window

`POST /auth/reauthenticate`

- Operation ID: `reauthenticate`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-05

Request body (application/json, required): `ReauthenticateRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The stamp's window and validity, or a redirect URL for a provider round trip. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Complete the pending sign-in with a recovery code

`POST /auth/recovery-code`

- Operation ID: `verifyRecoveryCode`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-16

Request body (application/json, required): `SecondFactorRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The attempt view in state session with recoveryCodesRemaining. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 410 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Consume the one-time handoff in the browser that started the attempt

`GET /auth/saml/continue`

- Operation ID: `continueSamlSignIn`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `handoff` | query | string | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 303 | To /sign-in/continue. |  |  |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The neutral SAML exit start's one-time hand-off — to the tenant's IdP, or ending like a refused assertion

`GET /auth/saml/exit`

- Operation ID: `handOffExitSaml`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-09

Register §41.10 (c); S04: `POST /auth/sso` with intent `exit_export` (the e-mail optional, only a login hint; the tenant is the exit attempt's, XM-1072) answers this app-origin URL and an empty tenant name for every slug — unknown, without SAML, with it — so the API answer reveals neither SAML use nor the IdP. Followed once (60 seconds), by the browser that started it only (another browser gets `401 auth.attempt_expired` and its own attempt is untouched; REV-XP11-18): `302` to the tenant's IdP with `ForceAuthn` (or its HTTP-POST page), else `303` to `/sign-in/continue`, the attempt ended `auth.failed` as after an assertion the IdP refused. Following it necessarily shows whoever follows it the tenant's IdP — the credential is entered there; this is inherent to SAML and bounded by the `exit` start limiter (REV-XP11-16, accepted by the coordinator).

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `handle` | query | string | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 302 | To the tenant's IdP (no-store, no referrer). |  |  |
| 303 | To /sign-in/continue, the attempt failed. |  |  |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The one-time page that posts a signed AuthnRequest to an IdP taking only the HTTP-POST binding

`GET /auth/saml/post`

- Operation ID: `postSamlAuthnRequest`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-04

XM-34 (SAML bindings §3.5): the redirectUrl of the SSO start, a step-up or a test sign-in when the IdP's metadata offers only HTTP-POST. An HTML form carrying the base64 `SAMLRequest` (enveloped RSA-SHA256 signature), submitted by a nonce'd script; the CSP allows nothing else and `form-action` only the IdP's origin. The handle is single use and lives 60 seconds.

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `handle` | query | string | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The auto-submitting form (text/html, no-store). | text/html | `string` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## End the current session (and, for SAML with the tenant's opt-in, start the IdP logout)

`POST /auth/sign-out`

- Operation ID: `signOut`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-13

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | Signed out locally; continue the identity provider's logout at redirectUrl. | application/json | `object` |
| 204 | Signed out (or there was no session). |  |  |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 419 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Resolve the tenant from the work e-mail and start its SAML sign-in

`POST /auth/sso`

- Operation ID: `startSsoSignIn`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-04

sign_in and invitation need the work e-mail. With intent exit_export (F-PLT-09.R08; XM-1072) the tenant is the browser's started exit attempt's (POST /auth/exit); the e-mail is optional and only the IdP's login hint. That start answers the neutral hand-off of handOffExitSaml and an empty tenant name for every exit slug, and 401 auth.attempt_expired without a started exit attempt. Every intent answers 503 service.unavailable while the service provider is not configured.

Request body (application/json, required): `SsoStartRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The tenant's name and the IdP redirect URL. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 410 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The current attempt, or the signed-in landing

`GET /auth/state`

- Operation ID: `getAuthState`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-05

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The attempt view, or state session with the landing. | application/json | `object` |
| 204 | Neither an attempt nor a session. |  |  |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## Start a step-up for a tenant whose policy the session does not yet satisfy

`POST /auth/step-up`

- Operation ID: `startStepUp`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-05

Request body (application/json, required): `StepUpRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The step-up attempt view (pending_second_factor, pending_enrolment) or, for `reason` saml, the IdP redirect (F-IDN-04.R05 rule 4; XM-34). | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 503 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Verify the authenticator code of the pending sign-in or step-up

`POST /auth/totp`

- Operation ID: `verifyTotpCode`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-07

Request body (application/json, required): `SecondFactorRequest`

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The attempt view in state session with the landing (or the completed step-up). | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 410 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 422 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The exit grant's view — tenant, administrator, expiry and the tenant's exports

`GET /exit`

- Operation ID: `getExitGrant`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-09

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The grant view. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Request a fresh tenant export (an export-class operation that runs during the suspension)

`POST /exit/exports`

- Operation ID: `requestExitExport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-09

Exempt from `Idempotency-Key` (REV-XP11-10): one export runs per tenant at a time, so a retry after a lost `202` cannot start a second one — it answers `409 exit.export_in_progress`, and `GET /exit` lists the running export to continue with.

| Status | Description | Content type | Type |
|---|---|---|---|
| 202 | The export in state queued or generating. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 409 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## State and manifest summary of one export of the grant's tenant

`GET /exit/exports/{exportId}`

- Operation ID: `getExitExport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `exportId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | The export; Retry-After while generating. | application/json | `object` |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Redirect to a 60-second signed download URL (at most five per grant)

`GET /exit/exports/{exportId}/download`

- Operation ID: `downloadExitExport`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-09

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `exportId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 302 | To the signed URL with Content-Disposition attachment. |  |  |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 403 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## Revoke the exit grant and clear its cookie

`POST /exit/sign-out`

- Operation ID: `signOutExitGrant`
- Call with: Session of the Youniton apps (app only)
- Feature: F-PLT-09

| Status | Description | Content type | Type |
|---|---|---|---|
| 204 | The grant is revoked. |  |  |
| 401 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The tenant's assertion consumer service (HTTP-POST binding)

`POST /saml/{tenantId}/acs`

- Operation ID: `consumeSamlResponse`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `tenantId` | path | string (uuid) | yes |  |

Request body (application/x-www-form-urlencoded, required): `object`

| Status | Description | Content type | Type |
|---|---|---|---|
| 303 | To /auth/saml/continue with a one-time handoff code. |  |  |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
| 429 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The tenant's SAML service-provider metadata (XML) for its IdP

`GET /saml/{tenantId}/metadata`

- Operation ID: `getServiceProviderMetadata`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-22

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `tenantId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | SP entityID, ACS, SLS and the platform SP certificate(s) as application/samlmetadata+xml. |  |  |
| 404 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |

## The same over the HTTP-Redirect binding

`GET /saml/{tenantId}/sls`

- Operation ID: `receiveSamlLogoutRedirect`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `tenantId` | path | string (uuid) | yes |  |
| `SAMLRequest` | query | string | no |  |
| `SAMLResponse` | query | string | no |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 302 | The LogoutResponse to the IdP, or /sign-in after an SP-initiated logout. |  |  |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |

## IdP-initiated LogoutRequest or the LogoutResponse to an SP-initiated logout (POST binding)

`POST /saml/{tenantId}/sls`

- Operation ID: `receiveSamlLogout`
- Call with: Session of the Youniton apps (app only)
- Feature: F-IDN-04

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `tenantId` | path | string (uuid) | yes |  |

| Status | Description | Content type | Type |
|---|---|---|---|
| 200 | A LogoutResponse (auto-posting form) or a redirect to /sign-in. |  |  |
| 400 | A problem (application/problem+json); the code names the reason. | application/problem+json | `Problem` |
| 404 | Not found (05-api §6.4; XM-787). The code is route.not_found (no route for the URL, a path value outside the route's pattern, or an audience outside the route's area), tenant.not_found (an unknown, foreign or inactive X-Kanso-Tenant) or <resource>.not_found (an unknown resource or a resource that the caller cannot see). A hidden resource and a missing resource get the same body: only instance and traceId change from call to call. | application/problem+json | `Problem` |
