> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Login Or Create

> Sends a magic link email to the provided address, logging in an existing user or creating a new one. Calls the `POST /sdk/v1/magic_links/email/login_or_create` endpoint. Generates and stores a PKCE code pair for use in the subsequent [MagicLinksClient.authenticate] call.

## Parameters

<ParamField body="email" type="String" required />

<ParamField body="loginMagicLinkUrl" type="String?" />

<ParamField body="signupMagicLinkUrl" type="String?" />

<ParamField body="loginExpirationMinutes" type="Int?" />

<ParamField body="signupExpirationMinutes" type="Int?" />

<ParamField body="loginTemplateId" type="String?" />

<ParamField body="signupTemplateId" type="String?" />

<ParamField body="locale" type="String?" />

## Returns

<ResponseField name="requestId" type="String" required />

<ResponseField name="statusCode" type="Int" required />

<RequestExample>
  ```swift theme={null}
  let params = MagicLinksEmailLoginOrCreateParameters(email: "user@example.com")
  let response = try await StytchConsumer.magicLinks.email.loginOrCreate(params)
  ```
</RequestExample>
