Change current user information

POST /me/change-info

Allow the current authenticated user to change their name, email, and phone number. Name and email cannot be empty if provided.

application/json

Body Required

  • name string

    User's full name (cannot be empty if provided)

    Minimum length is 1.

  • email string(email)

    User's email address (cannot be empty if provided)

    Minimum length is 1.

  • phone string | null

    User's phone number (can be empty to remove)

Responses

  • 200 application/json

    User information changed successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 400 application/json

    Bad request - validation error for name or phone

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • type string

        Value is validation_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

          Values are name, email, or phone.

        • message string

          Validation error message

          Values are name cannot be empty, email cannot be empty, invalid email format, or invalid phone format.

        • value string

          Value that failed validation

  • 401 application/json

    Unauthorized - invalid or missing JWT token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
POST /me/change-info
curl \
 --request POST 'https://collect.your-domain.com/api/me/change-info' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"name":"John Doe","email":"john.doe@example.com","phone":"+39 333 123456"}'
Request examples
{
  "name": "John Doe",
  "email": "john.doe@example.com",
  "phone": "+39 333 123456"
}
Response examples (200)
{
  "code": 200,
  "message": "user information changed successfully",
  "data": {}
}
Response examples (400)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "name",
        "value": "",
        "message": "name cannot be empty"
      }
    ]
  }
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}
Response examples (500)
{
  "code": 500,
  "message": "internal server error",
  "data": {}
}