MeОбновить мой профиль

Обновить мой профиль

Частичное обновление своего профиля: name, username, image (аватар), color, emoji. Все поля опциональны, null — очистить (кроме name). username уникален глобально — занят → 409.

curl -X PATCH "https://policy-engine-rest.ezig.workers.dev/api/v1/me/profile" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "name": "John Doe",
  "username": "ilya",
  "image": "example_string",
  "color": "example_string",
  "emoji": "example_string"
}'
{
  "id": "example_string",
  "email": "user@example.com",
  "role": "example_string",
  "name": "John Doe",
  "username": "John Doe",
  "image": "example_string",
  "color": "#000",
  "emoji": "🦊",
  "createdAt": "2026-07-02T11:25:15.134Z",
  "updatedAt": "2026-07-02T11:25:15.134Z"
}
PATCH
/api/v1/me/profile
PATCH
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

better-auth session token. Мобилка/сервисы. Веб использует cookie.

better-auth session token. Мобилка/сервисы. Веб использует cookie.
API Key (cookie: better-auth.session_token)
Content-Typestring
Required

The media type of the request body

Options: application/json
namestring
Min length: 1
usernamestring

Уникален глобально; null — очистить

imagestring

Ссылка на аватар; null — очистить

colorstring

HEX-цвет; null — очистить

emojistring

Emoji-иконка; null — очистить

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. better-auth session token. Мобилка/сервисы. Веб использует cookie.

path
parameterstring
Required

API Key for authentication. Provide your API key in the cookie.

Body

application/json
usernamestring

Уникален глобально; null — очистить

Example:
ilya
imagestring

Ссылка на аватар; null — очистить

colorstring

HEX-цвет; null — очистить

emojistring

Emoji-иконка; null — очистить

Responses

idstring
Required
emailstring
Required
rolestring
Required
namestring
Required
usernamestring
Required
imagestring
Required

Ссылка на аватар (better-auth-поле image)

colorstring
Required

HEX-цвет

emojistring
Required

Emoji-иконка

createdAtstring
Required
updatedAtstring
Required