Programmable Messaging API  ·  View 04 of 22  ·  People and journeys

Journey — The Login Code

Five phases, and a trough at the resend that explains most of the architecture.

Editable source SVG draw.io All views
Message recipient mid-login, on a bank app Goal — Finish signing in without starting again Trigger — Tapped "send me a code" on a login screen Done when — One code, once, inside the time the page allows 1 · Tap send code page starts a timer 2 · Wait 3 · Tap it again ◆ moment of truth 4 · Code arrives ◆ moment of truth 5 · Type it in What they do Asks for a code Watches the lock screen Presses resend Reads six digits Submits and is in What the platform does Accepts, interactive class Ledger write, then ack Paced to the route Carrier accepts Same client reference Dedup returns message 1 Receipt correlated Status becomes delivered Usage event emitted How it feels Fine Anxious Giving up Where it hurts No receipt yet, so no answer Resend without dedup = two codes A carrier receipt can be a lie What the architecture owes it Ack means durably owned p95 to carrier under 2 s Client reference is the key Unknown stays unknown Attempt-level cost record Journey — The Login Code That Has To Arrive Now The trough is the resend, and the resend is where duplicates are made. v 1.0 · owner Integration Platform Architecture

What the trough teaches

  • The resend is a design input, not user error: a person who cannot see progress will press the button again, and the platform must make that free.
  • Client-reference idempotency exists for this phase specifically — the second request returns the first message, so one human gets one code.
  • Phase four is where the platform's honesty is tested: a carrier receipt saying "delivered" to a handset that was off is still only a claim.

Assumptions

  • A login page typically allows 30–60 seconds before the user gives up; the interactive budget is set under that.
  • Interactive submit-to-carrier-acceptance p95 ≤ 2 s; receipt visible p95 ≤ 2 s from carrier receipt.

Risks

  • A duplicate code on one handset is worse than a late one: it trains people to distrust the channel and can lock an account.
  • If the dedup window is shorter than the user's patience, the resend creates a genuine second message.