> ## 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 Signup

> Sends a magic link email to the provided address for login or signup within an organization. Calls the `POST /sdk/v1/b2b/magic_links/email/login_or_signup` endpoint. Generates and stores a PKCE code pair for use in the subsequent [B2BMagicLinksClient.authenticate] call.

## Parameters

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

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

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

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

<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>
  ```kotlin theme={null}
  StytchB2B.magicLinks.email.loginOrSignup(
      B2BMagicLinksLoginOrSignupParameters(
          emailAddress = "user@example.com",
          organizationId = "org-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
      )
  )
  ```
</RequestExample>
