Skip to main content

Modify User Basic Information

POST 

/auth/v1/user/basic/edit

API Description

Modify user basic information, supports modifying nickname, username, phone number, email, avatar, gender, description and other basic information

Input Requirements:

  • Authorization: Current logged-in user's access_token (required, passed in request header, format Bearer xxx)
  • client_id: Client ID corresponding to the application (optional, defaults to environment ID)
  • x-device-id: Device ID (optional, current logged-in device ID)
  • Request body parameters:
    • user_id: User ID (optional, requires administrator privileges when modifying other users' information)
    • nickname: Nickname (optional, 2-48 characters)
    • username: Username (optional, 2-48 characters, supports English uppercase and lowercase, numbers, special characters)
    • phone: Phone number (optional, format: +86 13000000000)
    • description: Description (optional, user personal introduction)
    • avatar_url: Avatar URL (optional)
    • gender: Gender (optional, MALE-Male, FEMALE-Female)
    • email: Email (optional, valid email format)

Prerequisites:

  • Need valid access_token
  • Can only modify own information unless have administrator privileges
  • Username modification requires uniqueness verification
  • Phone number and email modification may require verification code verification

Output:

  • Returns empty object indicating successful modification
  • Returns error information on error

Modify User Information Request Example

POST /auth/v1/user/basic/edit
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsInN1YiI6Ijk4NzY1NDMyMTAxMjM0NTY3ODkiLCJhdWQiOiJkZW1vLWFwcC0yZjhhOWMzZTFiNGQiLCJleHAiOjE3MzQ2NzU4ODksImlhdCI6MTczNDY2ODY4OSwic2NvcGUiOiJ1c2VyIn0.dGhpc19pc19hX2Zha2Vfc2lnbmF0dXJlX2Zvcl9leGFtcGxlX3B1cnBvc2VzX29ubHlfZG9fbm90X3VzZV9pbl9wcm9kdWN0aW9uX2Vudmlyb25tZW50X3RoaXNfaXNfbm90X3JlYWxfdG9rZW5fZGF0YQ
x-device-id: device_123456
Content-Type: application/json

{
"nickname": "Zhang San",
"username": "zhangsan",
"phone": "+86 13000000000",
"description": "A developer who loves technology",
"avatar_url": "https://example/avatar.jpg",
"gender": "MALE",
"email": "zhangsan@example"
}

Modify User Information Response Example (Success)

{}

Modify User Information Response Example (Failure)

{
"error": "username_already_exists",
"error_code": 409,
"error_description": "Username already exists"
}

Usage Scenarios:

  • User modifies personal profile
  • Administrator modifies user information
  • User binds or changes phone number, email
  • Update user avatar and basic information

Notes:

  • Username modification requires uniqueness verification
  • Phone number and email modification require sending verification code
  • Sensitive information modification may require secondary verification
  • Administrator can modify other users' information, regular users can only modify their own information

Request

Query Parameters

    client_id string

    Client ID corresponding to the application, can be obtained from Cloud Development Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted

Header Parameters

    x-device-id string

    Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.

    Authorization stringrequired

    The access_token of the current logged-in user, format is Bearer xxx

    Example: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2FwaS5leGFtcGxlLmNvbSIsInN1YiI6Ijk4NzY1NDMyMTAxMjM0NTY3ODkiLCJhdWQiOiJkZW1vLWFwcC0yZjhhOWMzZTFiNGQiLCJleHAiOjE3MzQ2NzU4ODksImlhdCI6MTczNDY2ODY4OSwic2NvcGUiOiJ1c2VyIn0.dGhpc19pc19hX2Zha2Vfc2lnbmF0dXJlX2Zvcl9leGFtcGxlX3B1cnBvc2VzX29ubHlfZG9fbm90X3VzZV9pbl9wcm9kdWN0aW9uX2Vudmlyb25tZW50X3RoaXNfaXNfbm90X3JlYWxfdG9rZW5fZGF0YQ

Body

    user_id string

    User ID

    nickname string

    Nickname

    username string

    Username

    phone string

    Phone number

    description string

    Description

    avatar_url string

    Avatar

    gender string

    Gender, MALE-Male, FEMALE-Female

    email string

    Email

Responses

A successful response.

Response Headers
    Schema
      any
    Loading...