To register user using core Rest Module you need 5 steps:
Step 1: Download and enable Rest UI module and using it's configuration (admin/config/services/rest) Enable User Registration
Step 2: Then in account setting configuration you should allow user to create account, and if you want user to be added using user name and password you will need to uncheck require email verification else leave it checked.
Step 3: Now you need to allow anonymous user to access user registration (admin/people/permissions/anonymous):
Step 4: Another step to take is to get a xcsrf token from drupal cause you need to use a post method for user creation and post methods are unsafe methods, so drupal protects them using token, to get a XCSRF Token simply call /session/token
endpoint.
Step 5: Now final step is to ask for user creation:
Method: POST
Endpoint: user/register?_format=json
Header:
Content-Type: application/json
Accept: application/json
X-CSRF-Token: "XCSRF TOKEN PROVIDED BY DRUPAL"
Body:
{
"name": [{"value": "USERNAME"}],
"mail": [{"value": "EMAIL"}],
"pass":[{"value": "PASSWORD"}]
}
and that's it.
PS:
Remember that if you have not unchecked "require email verification" in account settings form then you should exclude pass
from your request body. in this case user needs to navigate to your drupal site for email verification which in case of decoupled scenario it sounds wired. so I highly recommend to uncheck this option in account settings configuration.