---
title: "Changes the email address of the specified user"
method: POST
path: "/analytics/change-email"
tags: ["analytics"]
---

# Changes the email address of the specified user

`POST /analytics/change-email`

## Request

- Base URL: `https://localhost:3002/api`
- URL: `https://localhost:3002/api/analytics/change-email`
- Auth: none declared

## Request body

- object
  - `email` string
  - `newEmail` string

## Response `200`

OK

- ModelsUser
  - `_id` string: Profile info
  - `calendarAccounts` object: CalendarAccounts is a mapping from {`email_CALENDARTYPE` => CalendarAccount} that contains all the additional accounts the user wants to see google calendar events for
  - `calendarOptions` ModelsCalendarOptions
    - `bufferTime` ModelsBufferTimeOptions
      - `enabled` boolean
      - `time` integer
    - `workingHours` ModelsWorkingHoursOptions
      - `enabled` boolean
      - `endTime` number
      - `startTime` number
  - `email` string
  - `firstName` string
  - `hasCustomName` boolean: Whether the user has set a custom name for themselves, i.e. don't change their name when they sign in
  - `lastName` string
  - `numEventsCreated` integer
  - `picture` string
  - `primaryAccountKey` string: The calendarAccountKey of the account the user first signed in with
  - `timezoneOffset` integer

## Changes

- **2026-10-01** `9f2e1d588102`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/schej-it/apis/schej-it-api/changes/analytics/change-email/post.md)

---

[API](https://skmtc.dev/schej-it/apis/schej-it-api.md) - [All operations](https://skmtc.dev/schej-it/apis/schej-it-api/llms.txt) - [OpenAPI document](https://skmtc.dev/schej-it/apis/schej-it-api/revisions/a2f35d3ff863?raw)
