Перейти к основному содержимому

Edit Profile by Admin API

POST /editProfileByAdmin

Description

This API endpoint allows an admin to edit and update a user's profile and account details. The admin can update both the user's account settings, such as email and password, as well as their personal profile information.

Request Body

The request utilizes GraphQL to perform the editProfileByAdmin mutation.

Mutation:

mutation editProfileByAdmin ($id: Int, $updatedUser: UserCreate, $updatedProfile: UserProfileEdit) {
editProfileByAdmin (id: $id, updatedUser: $updatedUser, updatedProfile: $updatedProfile)
}

Variables:

{
"id": 0,
"updatedUser": {
"email": "<User_Email>",
"password": "<User_Password>",
"resellerId": 0
},
"updatedProfile": {
"firstName": "<First_Name>",
"lastName": "<Last_Name>",
"phone": "<Phone_Number>",
"address": "<Address>",
"city": "<City>",
"country": "<Country>",
"postalCode": "<Postal_Code>",
"birthDate": "<YYYY-MM-DD>"
}
}
  • id (Int): The unique identifier of the user whose profile is being updated.
  • updatedUser (UserCreate Object): An object containing the updated account details for the user.
    • email (String): The updated email address of the user.
    • password (String): The updated password for the user's account.
    • resellerId (Int): The updated reseller ID associated with the user.
  • updatedProfile (UserProfileEdit Object): An object containing the updated profile details for the user.
    • firstName (String): The updated first name of the user.
    • lastName (String): The updated last name of the user.
    • phone (String): The updated phone number of the user.
    • address (String): The updated street address of the user.
    • city (String): The updated city where the user resides.
    • country (String): The updated country where the user resides.
    • postalCode (String): The updated postal code for the user's address.
    • birthDate (String): The updated birth date of the user in YYYY-MM-DD format.

Response:

  • Success (200 OK):

    • If the profile update is successful, the response will confirm that the user's profile and account details have been updated.
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid data, missing required fields, or server errors.

Note:

Ensure that the id corresponds to an existing user whose profile is being updated. All required fields should be provided and correctly formatted according to the platform's specifications. This API should be used by admins with the necessary permissions to update user profiles and account settings.