Create a new, using api?

On your people controller, you can use the user-permissions's add service.

Example how to create an user by using service:

let user = await strapi.plugins['users-permissions'].services.user.add({
    blocked: false,
    confirmed: true, 
    username: 'new_username',
    email: 'test@testemail.com',
    password: 'secretpassword', //will be hashed automatically
    provider: 'local', //provider
    created_by: 1, //user admin id
    updated_by: 1, //user admin id
    role: 1 //role id
});

Where the user will contain the created id. You can use that id to create the people entity:

await strapi.services.people.create({
   //people data here
   // ...
   users_permissions_user: user.id //map relation with the user
});
1 Like