How to create a issue security scheme programmatically

Hi everyone,

I am trying to create a security scheme programmatically but I am facing some difficulties.
I have successfully created a scheme with security levels in it but I haven’t successfully added users, roles and groups.
Has anyone useful information to do that ?

Thank you