Create Magento 2.x API User
First an API role needs to be added. Login to the Magento Admin Panel and navigate to System > User Roles.
This page lists the current API roles. If there none listed yet, click on Add New Role.
Every role needs a name. This can be anything. Just make sure it is descriptive enough for yourself.
The second tab on the left (Role Resources) allows you to select which resources should be available for users with this role. While you can select exactly which privileges are given, we recommend you select All.
Now that the role is created, you can add a user that makes use of this role.
The fields First Name, Last Name and Email just need to be filled in with any value you like. Make sure the User Name and Password are secure enough.
The second tab on the left is called User Role, and that's where you select the role earlier created. Then, Save User.