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"
}
{
"token": ["required_without:email", "string","exists:invitations,token,deleted_at,NULL"],
"email": ["required_without:token", "string", "email", "max:255", "unique:users,email"],
"firstName": ["required", "string"],
"lastName": ["required", "string"],
"position": ["required", "string"],
"address": ["required", "string"],
"country": ["required", "string"],
"institute": ["required", "string"],
"postal": ["required", "string"],
"phone": ["required", "string"],
"password": ["required", "string", "min:6", "confirmed"],
"agreed_terms": ["required","accepted"]
}
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."
]
}
}