---
title: "Update the authenticated account username (the email cannot be changed through the API)"
method: PATCH
path: "/api/v1/me"
tags: ["Account"]
---

# Update the authenticated account username (the email cannot be changed through the API)

`PATCH /api/v1/me`

## Request

- Base URL: `https://spoonjoy.app`
- URL: `https://spoonjoy.app/api/v1/me`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__session`
  - OAuth 2 (authorization code, authorization URL `https://spoonjoy.app/oauth/authorize`, token URL `https://spoonjoy.app/oauth/token`, scopes: `account:write`)

## Headers

- `X-Request-Id` string

## Request body

- UpdateAccountProfileRequest
  - `clientMutationId` string, required
  - `email` string, email, required: The API never changes the email. A different address is refused with 403 email_change_requires_web when the username is unchanged, and ignored when the username changes in the same request. Email changes happen only in Account settings on the website, and a new address starts unverified. Surrounding whitespace is trimmed and the address is lowercased before it is validated, checked against other accounts regardless of case, and stored.
  - `username` string, required: Surrounding whitespace is trimmed; a value that is empty after trimming fails with validation_error, message "Invalid account profile fields" and details.fields including "username". Sending the account's current username keeps it unchanged, even if it predates the username rule. A new username must be 3-50 characters matching ^[A-Za-z0-9._-]+$, include a letter or a number, and not look like an account ID, or the request fails with validation_error, the rule's message and details.field "username". A new username that another account holds in any letter case, or that equals another account's ID, fails the same way with "This username is already taken".

## Response `200`

Success

- AccountProfileMutationEnvelope
  - `ok` unknown, required
  - `requestId` string, required
  - `data` AccountProfileMutationData, required
    - `id` string, required
    - `email` string, email, required
    - `username` string, required
    - `photoUrl` string, nullable, required: Absolute /photos URL, data URL in local mode, or null.
    - `hasPassword` boolean, required
    - `oauthAccounts` LinkedAuthProvider[], required
      - `provider` 'apple' | 'github' | 'google', required
      - `providerUsername` string, required
    - `passkeys` PasskeySummary[], required
      - `id` string, required
      - `name` string, required
      - `transports` string, nullable, required
      - `createdAt` string, date-time, nullable, required
    - `mutation` MutationMetadata, required
      - `clientMutationId` string, required
      - `replayed` boolean, required

## Other responses

- `400`: Errors: invalid_json, validation_error
- `401`: Errors: authentication_required, invalid_token
- `403`: Errors: insufficient_scope, email_change_requires_web
- `404`: Errors: not_found
- `405`: Errors: method_not_allowed
- `409`: Errors: idempotency_conflict, idempotency_in_progress
- `429`: Errors: rate_limited
- `500`: Errors: internal_error
- `503`: Errors: temporarily_unavailable

---

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