Onboarding invite using API

Onboarding invite using API

i created a custom function and executed that code, it will executed successfully but invite link does not sent.
so kindly anyone know this one let give the details why invite not sent and how it's working through small description.
attach the screen shot below..