Trying to update user app_metadata from node js

Hi @erfan.saraj ,

I understand you want to update the user app_metadata.credit_left attribute via the post request. The endpoint for updating the app_metadata requires the user_id. If the info is missing in the function, it will return the not found error.

Here is what the sample scripts look like:

var params = { id: USER_ID };
var metadata = {
  foo: 'bar'
};

management.updateAppMetadata(params, metadata, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Updated user.
  console.log(user);
});

You may find the details in this doc.

Please let me know if any further queries about this topic. Thanks!