---
title: "Autenticação"
description: "Login, sessão, cadastro e recuperação de senha."
---
<div class="lm-ref-kicker"><code>auth</code><span>namespace</span></div>

Login, sessão, cadastro e recuperação de senha.

<div class="lm-ref-stats lm-ref-stats--compact">
  <div class="lm-ref-stat"><strong>15</strong><span>métodos</span></div>
  <div class="lm-ref-stat"><code>auth</code><span>namespace</span></div>
</div>

> Esta página é gerada automaticamente pelo `@luckymaker/sdk-generator`. Não edite manualmente.

## `changePassword`

<div class="lm-endpoint"><span class="lm-http lm-http--patch">PATCH</span><code>/user/password</code></div>

Assinatura:

```ts
changePassword(body?: ChangePasswordBody, settings?: SdkSettings): Promise<ChangePasswordResponse>
```

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `currentPassword` | `string` | não |
| `newPassword` | `string` | sim |
| `newPasswordConfirmation` | `string` | sim |

### Tipos

```ts
type ChangePasswordBody = { "currentPassword"?: string; "newPassword": string; "newPasswordConfirmation": string; };
type ChangePasswordResponse = unknown;
```

### Exemplo

```ts
const response = await sdk.auth.changePassword({ "newPassword": "string", "newPasswordConfirmation": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=changePassword">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `exchangeImpersonation`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/impersonation/exchange</code></div>

Assinatura:

```ts
exchangeImpersonation(body?: ExchangeImpersonationBody, settings?: SdkSettings): Promise<ExchangeImpersonationResponse>
```

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `code` | `string` | sim |

### Tipos

```ts
type ExchangeImpersonationBody = { "code": string; };
type ExchangeImpersonationResponse = { "token": string; "expiresIn": number; };
```

### Exemplo

```ts
const response = await sdk.auth.exchangeImpersonation({ "code": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=exchangeImpersonation">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

> Esta chamada salva automaticamente o token retornado para as próximas requisições.

## `getIdentification`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/identification</code></div>

Assinatura:

```ts
getIdentification(settings?: SdkSettings): Promise<GetIdentificationResponse>
```

### Tipos

```ts
type GetIdentificationResponse = { "isRegistered"?: boolean; "signUpForm"?: unknown; };
```

### Exemplo

```ts
const response = await sdk.auth.getIdentification();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=getIdentification">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `getRecoveryMethods`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/password/recovery-methods</code></div>

Assinatura:

```ts
getRecoveryMethods(query?: GetRecoveryMethodsQuery, settings?: SdkSettings): Promise<GetRecoveryMethodsResponse>
```

### Query

| Nome | Tipo | Obrigatório |
|---|---|---|
| `cpf` | `string` | não |

### Tipos

```ts
type GetRecoveryMethodsQuery = { "cpf"?: string; };
type GetRecoveryMethodsResponse = Array<{ "id": string; "label": string; }>;
```

### Exemplo

```ts
const response = await sdk.auth.getRecoveryMethods();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=getRecoveryMethods">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `getSession`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/session</code></div>

Assinatura:

```ts
getSession(settings?: SdkSettings): Promise<GetSessionResponse>
```

### Tipos

```ts
type GetSessionResponse = { "user": { "id": number; "name": string; "email": string; "state"?: string; "city"?: string; "isProfileComplete"?: boolean; "isBetaTester"?: boolean; "enabledTests"?: Array<"CREDITS_WITHDRAWAL">; "functions"?: Array<"TEST_ACCOUNT" | "SYSDEV">; }; "session": { "expiresIn": number; }; };
```

### Exemplo

```ts
const response = await sdk.auth.getSession();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=getSession">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `getSignUp`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/sign-up</code></div>

Assinatura:

```ts
getSignUp(settings?: SdkSettings): Promise<GetSignUpResponse>
```

### Tipos

```ts
type GetSignUpResponse = { "form": unknown; };
```

### Exemplo

```ts
const response = await sdk.auth.getSignUp();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=getSignUp">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `identify`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/identification</code></div>

Assinatura:

```ts
identify(body?: IdentifyBody, settings?: SdkSettings<IdentifyQuery>): Promise<IdentifyResponse>
```

### Query

| Nome | Tipo | Obrigatório |
|---|---|---|
| `intent` | `"DOCUMENT_ACCESS"` | não |
| `scope` | `"PURCHASED_TITLES"` | não |

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `captcha` | `string` | não |
| `cpf` | `string` | sim |
| `birthdate` | `string` | não |
| `quick` | `boolean` | não |

### Tipos

```ts
type IdentifyQuery = { "intent"?: "DOCUMENT_ACCESS"; "scope"?: "PURCHASED_TITLES"; };
type IdentifyBody = { "captcha"?: string; "cpf": string; "birthdate"?: string; "quick"?: boolean; };
type IdentifyResponse = { "isRegistered"?: boolean; "signUpForm"?: unknown; "documentAccessToken"?: string; "expiresAt"?: string; "identificationProof"?: string; };
```

### Exemplo

```ts
const response = await sdk.auth.identify({ "cpf": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=identify">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `recoverAffiliatePassword`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/affiliate/recover-password</code></div>

Assinatura:

```ts
recoverAffiliatePassword(body?: RecoverAffiliatePasswordBody, settings?: SdkSettings): Promise<RecoverAffiliatePasswordResponse>
```

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| - | `{ "captcha": string; "stage": "REQUEST_CODE"; "recoveryMethod": "WHATSAPP" \| "EMAIL" \| "SMS"; "document": string; } \| { "captcha": string; "stage": "CONFIRM_CODE"; "recoveryMethod"?: "WHATSAPP" \| "EMAIL" \| "SMS"; "document": string; "code": string; } \| { "captcha": string; "stage": "CHANGE_PASSWORD"; "document": string; "code": string; "newPassword": string; "newPasswordConfirmation": string; }` | - |

### Tipos

```ts
type RecoverAffiliatePasswordBody = { "captcha": string; "stage": "REQUEST_CODE"; "recoveryMethod": "WHATSAPP" | "EMAIL" | "SMS"; "document": string; } | { "captcha": string; "stage": "CONFIRM_CODE"; "recoveryMethod"?: "WHATSAPP" | "EMAIL" | "SMS"; "document": string; "code": string; } | { "captcha": string; "stage": "CHANGE_PASSWORD"; "document": string; "code": string; "newPassword": string; "newPasswordConfirmation": string; };
type RecoverAffiliatePasswordResponse = { "lastDigits": string; };
```

### Exemplo

```ts
const response = await sdk.auth.recoverAffiliatePassword({ "captcha": "string", "stage": "REQUEST_CODE", "recoveryMethod": "WHATSAPP", "document": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=recoverAffiliatePassword">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `recoverPassword`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/password/recover</code></div>

Assinatura:

```ts
recoverPassword(body?: RecoverPasswordBody, settings?: SdkSettings): Promise<RecoverPasswordResponse>
```

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| - | `{ "captcha": string; "stage": "REQUEST_CODE"; "recoveryMethod": "EMAIL" \| "SMS" \| "WHATSAPP"; "cpf": string; "inbox"?: string; } \| { "stage": "CONFIRM_CODE"; "recoveryMethod": "EMAIL" \| "SMS" \| "WHATSAPP"; "cpf": string; "code": string; } \| { "stage": "CHANGE_PASSWORD"; "cpf": string; "code": string; "newPassword": string; "newPasswordConfirmation": string; }` | - |

### Tipos

```ts
type RecoverPasswordBody = { "captcha": string; "stage": "REQUEST_CODE"; "recoveryMethod": "EMAIL" | "SMS" | "WHATSAPP"; "cpf": string; "inbox"?: string; } | { "stage": "CONFIRM_CODE"; "recoveryMethod": "EMAIL" | "SMS" | "WHATSAPP"; "cpf": string; "code": string; } | { "stage": "CHANGE_PASSWORD"; "cpf": string; "code": string; "newPassword": string; "newPasswordConfirmation": string; };
type RecoverPasswordResponse = { "redactedInbox": string; };
```

### Exemplo

```ts
const response = await sdk.auth.recoverPassword({ "captcha": "string", "stage": "REQUEST_CODE", "recoveryMethod": "EMAIL", "cpf": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=recoverPassword">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `renewSession`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/session/renew</code></div>

Assinatura:

```ts
renewSession(settings?: SdkSettings): Promise<RenewSessionResponse>
```

### Tipos

```ts
type RenewSessionResponse = { "token": string; };
```

### Exemplo

```ts
const response = await sdk.auth.renewSession();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=renewSession">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

> Esta chamada salva automaticamente o token retornado para as próximas requisições.

## `signIn`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/sign-in</code></div>

Assinatura:

```ts
signIn(body?: SignInBody, settings?: SdkSettings): Promise<SignInResponse>
```

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `captcha` | `string` | sim |
| `cpf` | `string` | sim |
| `password` | `string` | sim |

### Tipos

```ts
type SignInBody = { "captcha": string; "cpf": string; "password": string; };
type SignInResponse = { "token": string; };
```

### Exemplo

```ts
const response = await sdk.auth.signIn({ "captcha": "string", "cpf": "string", "password": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=signIn">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

> Esta chamada salva automaticamente o token retornado para as próximas requisições.

## `signInWithFacebook`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/sign-in/oauth/facebook</code></div>

Assinatura:

```ts
signInWithFacebook(body?: SignInWithFacebookBody, settings?: SdkSettings): Promise<SignInWithFacebookResponse>
```

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `accessToken` | `string` | sim |
| `cpf` | `string` | não |

### Tipos

```ts
type SignInWithFacebookBody = { "accessToken": string; "cpf"?: string; };
type SignInWithFacebookResponse = unknown;
```

### Exemplo

```ts
const response = await sdk.auth.signInWithFacebook({ "accessToken": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=signInWithFacebook">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `signOut`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/sign-out</code></div>

Assinatura:

```ts
signOut(settings?: SdkSettings): Promise<SignOutResponse>
```

### Tipos

```ts
type SignOutResponse = unknown;
```

### Exemplo

```ts
const response = await sdk.auth.signOut();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=signOut">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

> Esta chamada remove o token salvo pela SDK.

## `signUp`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/sign-up</code></div>

Assinatura:

```ts
signUp(body?: SignUpBody, settings?: SdkSettings<SignUpQuery>): Promise<SignUpResponse>
```

### Query

| Nome | Tipo | Obrigatório |
|---|---|---|
| `utm_source` | `string` | não |
| `utm_medium` | `string` | não |
| `utm_campaign` | `string` | não |
| `utm_term` | `string` | não |
| `utm_content` | `string` | não |
| `utm_id` | `string` | não |
| `affiliate_id` | `string \| number` | não |
| `reseller_id` | `string \| number` | não |
| `reseller_slug` | `string \| number` | não |
| `reseller_uuid` | `string` | não |
| `referrer_domain` | `string` | não |
| `lm_medium` | `string` | não |
| `lm_source` | `string` | não |
| `lm_purchase_source` | `"APP" \| "API" \| "PHYSICAL" \| "DESKTOP_WEB" \| "MOBILE_WEB" \| "TABLET_WEB" \| "EMBED" \| "LANDING_PAGE" \| "WEBSITE" \| "UNKNOWN" \| "STUB" \| "SUBSCRIPTION"` | não |
| `lm_cohort` | `string` | não |
| `device_id` | `string` | não |
| `onesignal_player_id` | `string` | não |
| `fbclid` | `string` | não |
| `click_id` | `string` | não |
| `gclid` | `string` | não |
| `ttclid` | `string` | não |
| `lm_partner_id` | `string` | não |
| `lm_webhook_url` | `string` | não |
| `lm_fast_sell_identifier` | `string` | não |
| `lm_offer_id` | `string` | não |
| `lm_offer_coupon` | `string` | não |
| `lm_plan_id` | `string` | não |

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `captcha` | `string` | sim |
| `cpf` | `string` | sim |
| `tel` | `string` | sim |
| `email` | `string` | não |
| `password` | `string` | não |
| `name` | `string` | não |
| `originalName` | `string` | não |
| `socialName` | `string \| null` | não |
| `birthdate` | `string` | não |
| `gender` | `"M" \| "F" \| "O" \| "N" \| null` | não |
| `idd` | `string` | não |
| `address` | `{ "cep"?: string; "streetName"?: string \| null; "number"?: string; "neighborhood"?: string \| null; "complement"?: string; }` | não |
| `formId` | `string` | não |
| `quickToken` | `string` | não |
| `referralUuid` | `string` | não |
| `affiliate_id` | `string \| number` | não |
| `reseller_id` | `string \| number` | não |
| `reseller_slug` | `string \| number` | não |
| `reseller_uuid` | `string` | não |

### Tipos

```ts
type SignUpQuery = { "utm_source"?: string; "utm_medium"?: string; "utm_campaign"?: string; "utm_term"?: string; "utm_content"?: string; "utm_id"?: string; "affiliate_id"?: string | number; "reseller_id"?: string | number; "reseller_slug"?: string | number; "reseller_uuid"?: string; "referrer_domain"?: string; "lm_medium"?: string; "lm_source"?: string; "lm_purchase_source"?: "APP" | "API" | "PHYSICAL" | "DESKTOP_WEB" | "MOBILE_WEB" | "TABLET_WEB" | "EMBED" | "LANDING_PAGE" | "WEBSITE" | "UNKNOWN" | "STUB" | "SUBSCRIPTION"; "lm_cohort"?: string; "device_id"?: string; "onesignal_player_id"?: string; "fbclid"?: string; "click_id"?: string; "gclid"?: string; "ttclid"?: string; "lm_partner_id"?: string; "lm_webhook_url"?: string; "lm_fast_sell_identifier"?: string; "lm_offer_id"?: string; "lm_offer_coupon"?: string; "lm_plan_id"?: string; };
type SignUpBody = { "captcha": string; "cpf": string; "tel": string; "email"?: string; "password"?: string; "name"?: string; "originalName"?: string; "socialName"?: string | null; "birthdate"?: string; "gender"?: "M" | "F" | "O" | "N" | null; "idd"?: string; "address"?: { "cep"?: string; "streetName"?: string | null; "number"?: string; "neighborhood"?: string | null; "complement"?: string; }; "formId"?: string; "quickToken"?: string; "referralUuid"?: string; "affiliate_id"?: string | number; "reseller_id"?: string | number; "reseller_slug"?: string | number; "reseller_uuid"?: string; };
type SignUpResponse = { "pendingRegistration"?: { "formId": string; "form": unknown; }; [key: string]: unknown; };
```

### Exemplo

```ts
const response = await sdk.auth.signUp({ "captcha": "string", "cpf": "string", "tel": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=signUp">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `updateSignUpPending`

<div class="lm-endpoint"><span class="lm-http lm-http--put">PUT</span><code>/user/sign-up/pending</code></div>

Assinatura:

```ts
updateSignUpPending(body?: UpdateSignUpPendingBody, settings?: SdkSettings): Promise<UpdateSignUpPendingResponse>
```

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `cpf` | `string` | sim |
| `formId` | `string` | sim |

### Tipos

```ts
type UpdateSignUpPendingBody = { "cpf": string; "formId": string; [key: string]: unknown; };
type UpdateSignUpPendingResponse = null;
```

### Exemplo

```ts
const response = await sdk.auth.updateSignUpPending({ "cpf": "string", "formId": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=auth&method=updateSignUpPending">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>