Update User

Method: PUT
Endpoint: /api/updateUser/{idOrEmail}


Parameter Type Required


idOrEmail id or email Yes id or email you want to update
name string No Name of the user you're updating
email string No Email of the user you're updating
password string No Password of the user you're updating
package_id int No Package id for user 
country_code string No Country code of user i.e (PK,US)
address_line_1 string No Address 1 of user
address_line_2 string No Address 2 of user
city string No Residential city of user
state string No State of user where he is living
post_code int No Postal/Zip code of user
phone int No Phone number of user
mobile int No Mobile number of user
mobile_country_code int Yes if mobile is set Mobile Country Code of user, i.e (92,1,91)
timezone string (default: 00:00) No Timezone of user you're updating
login_ips coma seprated valid ips No Restrict access to user your account by adding a range of trusted IP addresses
status active, suspended, closed No active = Active user
suspended = user account has been suspended
closed = user account has been closed
response 0, 1 (default: 0) No Get full response of the operation

Response Parameters

Parameter Type Description
status JSON Success or Error
result JSON Result of the operation
response JSON Output of the operation

Example Request (CURL)

// Authentication
$api_token	=	'API_KEY'; // Mumara API Key (can be found in Settings -> API Key)
$domain		=	''; // Your Mumara Domain Name

// API Endpoint
$endpoint	=	'/api/updateUser/';

//User Id
$user_id = 24;

$params = [
    'email'                 => '[email protected]',
    'password'              => 'secret789',
    'package_id'            => 1,
    'timezone'              => '+05:00',
    'login_ips'             => ',',
    'name'                  => 'David Seagal',
    'country_code'          => 'PK',
    'mobile'                => 3317667,
    'phone'                 => 66427868,
    'post_code'             => 40410,
    'mobile_country_code'   => 92,
    'address_line_1'        => 'St # 1',
    'address_line_2'        => 'St # 2',
    'status'                => 'active',
    'state'                 => 'Punjab',
    'city'                  => 'Bhalwal',
    'response'              => 1

// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$user_id);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_HTTPHEADER,
    array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Executing cURL
$output = curl_exec ($ch);

// Printing Output
echo "<pre>";
echo json_encode(json_decode($output),JSON_PRETTY_PRINT );

// Closing cURL
curl_close ($ch);


Example Response (JSON)

    "status": "success",
    "result": "Success: User has been successfully updated.",
    "response": {
        "id": 24,
        "name": "David Seagal",
        "email": "[email protected]",
        "one_time_password": null,
        "login_ips": ",",
        "countrycode": 92,
        "country": "PK",
        "time_zone": "+5:+00",
        "address_line_1": "St # 1",
        "address_line_2": "St # 2",
        "city": "Bhalwal",
        "state": "Punjab",
        "post_code": 40410,
        "phone": 66427868,
        "mobile": 3317667,
        "user_id": 2,
        "role": "client",
        "role_id": 3,
        "package_id": 1,
        "is_admin": 0,
        "is_staff": 0,
        "is_client": 1,
        "status": "active",
        "parent_id": 0,
        "logout": 0,
        "deleted_at": null,
        "created_at": "2020-12-29 12:56:19",
        "updated_at": "2020-12-29 13:52:20"
Status value of the success response will be "success"


Example Error Response (JSON)

    "status": "error",
    "result": {
        "mobile": [
            "The mobile must be an integer."
        "phone": [
            "The phone must be an integer."
        "post_code": [
            "The post code must be an integer."
        "mobile_country_code": [
            "Error: Invalid format mobile country code"


Possible Errors

  • Error: Invalid format mobile country code
  • The mobile must be an integer.
Try it out