---
title: "Finalize an inbound loginV2 auth request against the caller's session"
method: POST
path: "/auth/oidc/finalize"
tags: ["Auth"]
---

# Finalize an inbound loginV2 auth request against the caller's session

`POST /auth/oidc/finalize`

## Request

- Base URL: `https://api.mnemom.ai/v1`
- URL: `https://api.mnemom.ai/v1/auth/oidc/finalize`
- Auth: none required

loginV2 finalize. id.mnemom.ai has no hosted loginV2 UI, so the mnemom login page is the loginV2 `baseUri` target: after it authenticates the user (issuing the `__Host-mnemom_session` cookie), it posts the inbound Zitadel auth-request id here. The endpoint reuses the caller's stashed Zitadel login session (falling back to a fresh user-only vouch session if that has aged past `passwordCheckLifetime`) to finalize the request, returning the RP `callbackUrl` for the browser to follow. Requires an authenticated session cookie; the `authRequestId` must resolve to an allowed first-party client. Returns 503 unless the cell is configured with `AUTH_PROVIDER=zitadel`.

## Request body

- object
  - `authRequestId` string, required: The inbound Zitadel V2 auth-request handle (`V2_<id>`).

## Response `200`

The auth request was finalized; follow the returned callback URL.

- object
  - `callbackUrl` string, uri, required: The RP callback URL carrying the authorization `code`.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Cross-origin write refused (`cross_origin_rejected`). A state-changing request that carries the browser session cookie must come from a first-party origin (`Origin`, or failing that `Referer`) and must not send a form-style body (text/plain, urlencoded, multipart) the operation does not declare. Bearer and API-key callers are never subject to this check.
- `429`: Rate-limit exceeded. The global per-IP limiter (100 requests/minute, applied to every `/v1/*` route) rejected this request. Back off until the window resets — `Retry-After` carries the cooldown in seconds and `X-RateLimit-Reset` the absolute reset time.
- `500`: Server error — request was well-formed but the server failed to fulfill it. Typically a downstream dependency (DB / RPC / external API) returned an unexpected error.
- `502`: An upstream dependency returned an invalid response.
- `503`: An upstream dependency is currently unavailable. The request was not processed; retry after the cooldown window.

---

[API](https://skmtc.dev/mnemom/apis/mnemom-api.md) · [All operations](https://skmtc.dev/mnemom/apis/mnemom-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mnemom/apis/mnemom-api/revisions/274b7a6ea182?raw)
