---
title: "OTC (One-Time Code) prelogin"
method: POST
path: "/resources/auth/v1/passwordless/code/prelogin"
tags: ["Passwordless"]
---

# OTC (One-Time Code) prelogin

`POST /resources/auth/v1/passwordless/code/prelogin`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/auth/v1/passwordless/code/prelogin`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/auth/v1/passwordless/code/prelogin/post.ts> (a function with typed inputs; its response is checked against the schema)

This route triggers the system to send a one-time code to the user and is the first step when authenticating a local user using the email otc passwordless mechanism. Send the **`frontegg-vendor-host`** as a header to declare which vendor. This is your domain name in the Frontegg Portal ➜ Workspace Settings ➜ Domains ➜ Domain Name. Send the user's email as POST body params. Include the invitation token if the user is signing up by invitation. Send the recaptcha token if the recaptcha is enabled for login.

## Request body

- PasswordlessAuthenticationPreloginDto
  - `recaptchaToken` string
  - `invitationToken` string
  - `email` string, required
  - `userId` string, required

## Response `201`

## Other responses

- `400`: Invalid authentication type, OTC (One-Time Code) authentication should be enabled

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
