---
title: "Update username"
method: PATCH
path: "/me"
tags: ["Me"]
---

# Update username

`PATCH /me`

## Request

- Base URL: `https://console-api.blockvectra.com/v1`
- URL: `https://console-api.blockvectra.com/v1/me`
- Auth: HTTP bearer

`{"username": string | null}`: leading/trailing whitespace stripped, empty string treated as null (clears username), up to 64 Unicode characters, without control characters (Unicode category `Cc`), otherwise 400 `invalid_request` (`reason: invalid_username`). Returns same body as `GET /me` on success. Not unique, no other format constraints.

## Request body

- UsernameRequest
  - `username` string, nullable, required: Username: populated with default value on first login (GitHub login for GitHub, null for SIWE and Google; SIWE accounts start with no username and clients derive the display from the address); modified via `PATCH /me` only; linking identities does not alter it. Not unique, not queryable. Stripped of leading/trailing whitespace on `PATCH`, empty string treated as null, up to 64 Unicode characters, without control characters (Unicode category `Cc`), otherwise 400 `invalid_request` (`reason: invalid_username`).

## Response `200`

Updated current user (matching `GET /me` shape).

- MeResponse
  - `username` string, nullable, required: Username: populated with default value on first login (GitHub login for GitHub, null for SIWE and Google; SIWE accounts start with no username and clients derive the display from the address); modified via `PATCH /me` only; linking identities does not alter it. Not unique, not queryable. Stripped of leading/trailing whitespace on `PATCH`, empty string treated as null, up to 64 Unicode characters, without control characters (Unicode category `Cc`), otherwise 400 `invalid_request` (`reason: invalid_username`).
  - `created_at` string, date-time, required: RFC 3339 UTC, second precision, ending in `Z` (`2026-09-26T08:00:00Z`); no fractional seconds, without `+00:00` timezone offsets.
  - `identities` IdentityView[], required
    - `identity_id` string, required
    - `provider` 'siwe' | 'github' | 'google', required
    - `subject` string, required: SIWE: `eip155:1:<lowercase address>`; GitHub: numeric id; Google: `sub`.
    - `display` string, nullable, required: EIP-55 address for SIWE, login for GitHub (display only), null for Google.
    - `created_at` string, date-time, required: RFC 3339 UTC, second precision, ending in `Z` (`2026-09-26T08:00:00Z`); no fractional seconds, without `+00:00` timezone offsets.
    - `last_login_at` string, date-time, required: RFC 3339 UTC, second precision, ending in `Z` (`2026-09-26T08:00:00Z`); no fractional seconds, without `+00:00` timezone offsets.
  - `session` object, required
    - `expires_at` string, date-time, required: RFC 3339 UTC, second precision, ending in `Z` (`2026-09-26T08:00:00Z`); no fractional seconds, without `+00:00` timezone offsets.
    - `idle_timeout_secs` integer, required

## Other responses

- `400`: Username exceeds length limit, contains control characters, or unknown fields.
- `401`: Missing or invalid session (without distinguishing cause).
- `413`: Request body exceeds 64 KiB limit. Exceeding this limit returns 413 (`payload_too_large`).
- `429`: Rate limit exceeded.
- `500`: Internal server error.

---

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