Roles not added to invited user after he/she signs up

I am using Auth0 management API to create user invitation with a role to be assigned to the user as seen below;

let params = { id : req.params.organisationId};
let data = {
client_id: ‘MY CLIENT ID’,
invitee: { email: req.body.email },
inviter: { name: req.body.inviter },
roles: [‘rol_m3qbxCMGB7uBr7z4’]
};
auth0.managementApi.organizations.createInvitation(params, data, function (err) {
if (err) {
console.log(“Unable to send invite>>>”,err)
res.status(201).send({msg:“Unable to add organisations”,data:err});

    }
    else{
      console.log("Invite sent successfully>>>",data)
      res.status(201).send({msg:"Invite sent successfully",data:data});

    }
  });

The invitation is sent to the user, and he is able to sign up to the organisation. However the role specified is not added to him when i check the Auth0 dashboard.Everything works fine but the role is not applied to the signed up user. Please help me out. Thank you

Hi @daudaa - check the Organization Member Role (as opposed to the User’s Role). They are separate. The invitation feature invites a user to an Organization with a role that applies when the user is logging in via that Organization.

You can see this in the Manage Dashboard by navigating to Organizations > [Organization Name] > Members > and then clicking on the name of the member that accepted the invitation.

Wow, I’ve seen it. Spent hours trying to find this. Thanks a lot Adam.Housman