Add a new user account to the system. Whenever a valid invitation token
has been provided, the user will automatically be accepted onto the Maastricht Study team with a given Invite's role.
{info} This will trigger an email verification notification if token has not been provided. Invited users will be verified directly.
Method | Uri | Auth | Permissions |
---|---|---|---|
POST |
/v1/auth/register |
None | none |
The API requires a header Accept
to be submitted with the request:
{
"Accept": "application/json"
}
{
"firstName": "required",
"lastName": "required",
"email": "required_without:token, unique",
"token": "required_without:email, exists:invitations,token,deleted_at,NULL",
"password": "required, min of 6 characters",
"password_confirmation": "required, min of 6 characters, equal to password"
}
Condition : All required data provided is valid and added to the request body.
Code : 201 Created
Content example : Response will reflect back the created message':
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3M...",
"token_type": "bearer",
"expires_in": 3600
}
Condition : If provided data is invalid or not added to the request body.
Code : 422 Unprocessable Entity
Content example :
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email has already been taken."
]
}
}