---
title: "Link email/password to anonymous account"
method: POST
path: "/v1/auth/link-email"
tags: ["Auth"]
---

# Link email/password to anonymous account

`POST /v1/auth/link-email`

## Request

- Base URL: `http://localhost:4000`
- URL: `http://localhost:4000/v1/auth/link-email`
- Auth: HTTP bearer

Links the current anonymous device to an email/password account. If the email already exists on another device, bookmarks and folders are merged to that device and the current device is deactivated (user receives new tokens for the existing account). After linking, the user can login from any device via `/v1/auth/login-email`.

## Request body

- LinkEmailRequest
  - `email` string, email, required: Email address to link
  - `password` string, required: Password (min 6 characters)
  - `name` string: Optional display name (defaults to email prefix)

## Response `200`

Email linked (or account merged)

- LinkEmailResponse: Response after linking email. If merged, includes new tokens for the existing account.
  - `success` boolean
  - `message` string
  - `authProvider` 'email'
  - `merged` boolean: True if data was merged into an existing email account
  - `accessToken` string: New access token (only present if merged)
  - `refreshToken` string: New refresh token (only present if merged)
  - `expiresIn` integer: Token TTL in seconds (only present if merged)

## Other responses

- `400`: Validation error
- `401`: Access token required

---

[API](https://skmtc.dev/reqistry/apis/public-apis-mobile-client-api.md) · [All operations](https://skmtc.dev/reqistry/apis/public-apis-mobile-client-api/llms.txt) · [OpenAPI document](https://skmtc.dev/reqistry/apis/public-apis-mobile-client-api/revisions/7f07b9ca718f?raw)
