# User

Users related to the platform and all actions required

## Get the logged in user

 - [GET /user](https://docs.transportial.com/apis/user/handle_8.md): Get the currently logged in user

## Update the user

 - [PUT /user](https://docs.transportial.com/apis/user/handle_280.md): Update the password of the currently logged in user. The current password has to be known for this change

## Create a new user

 - [POST /user](https://docs.transportial.com/apis/user/handle_270.md): Invite a new user to the platform through an invitation e-mail, the user has to reset his password.

## Creates new access_token

 - [POST /user/session/refresh](https://docs.transportial.com/apis/user/handle_22.md): Creates new access_token if refresh_token isn't expired and extends refresh_token with one day time also.

## Setup a users 2FA

 - [POST /user/2fa/disable](https://docs.transportial.com/apis/user/handle_33.md): Get the 2FA QR image and the recovery codes

## Decline an access request

 - [POST /user/access-request/{id}/decline](https://docs.transportial.com/apis/user/handle_40.md): Decline a pending access request and soft-delete the user record

## User login

 - [POST /user/login](https://docs.transportial.com/apis/user/handle_46.md): Authenticate a user by logging in

## Create and assign chauffeur to user

 - [POST /user/{id}/create-chauffeur](https://docs.transportial.com/apis/user/create:chauffeur:user.md): Creates a new Chauffeur from payload and links it to the specified User; User must not already have a chauffeur.

## Get if the e-mail exists yes or no

 - [POST /user/email/exists/{email}](https://docs.transportial.com/apis/user/handle_83.md): Check if an e-mail is already in use for another user

## Get the user by id

 - [GET /user/{id}](https://docs.transportial.com/apis/user/handle_94.md): Get a user by the given ID

## Unblock a user

 - [DELETE /user/{id}](https://docs.transportial.com/apis/user/handle_405.md): Unblock a user from the platform

## Get all the users

 - [GET /users/{offset}/{amount}](https://docs.transportial.com/apis/user/handle_344.md): Get all users

## Search users by search parameters

 - [POST /users/{offset}/{amount}](https://docs.transportial.com/apis/user/handle_117.md): Search users by search parameters and

## Get a user's session

 - [GET /user/{id}/sessions/{offset}/{amount}](https://docs.transportial.com/apis/user/handle_133.md): Get user's sessions

## Request register user

 - [POST /user/register/request](https://docs.transportial.com/apis/user/handle_138.md): Register a new user

## Recover user login details

 - [POST /user/recover](https://docs.transportial.com/apis/user/handle_168.md): Authenticate a user by logging in

## Add FCM device

 - [POST /user/fcm](https://docs.transportial.com/apis/user/handle_170.md): Add a device FCM token for a user. This enables notification sending

## Unblock a user

 - [POST /user/unblock/{id}](https://docs.transportial.com/apis/user/handle_190.md): Unblock a user from the platform

## Recover 2FA

 - [POST /user/2fa/recover](https://docs.transportial.com/apis/user/handle_207.md): Recover your account with a recovery code

## Get the login method

 - [POST /user/login-method](https://docs.transportial.com/apis/user/handle_209.md): Get the login method to be used for this users authentication

## Get if the username exists yes or no

 - [POST /user/username/exists/{username}](https://docs.transportial.com/apis/user/handle_237.md): Check if the given username is already in use for another user

## Log all user session out

 - [GET /user/logout/all](https://docs.transportial.com/apis/user/handle_254.md): End the all the sessions of the logged in user. Meaning over all devices the sessions are invalidated

## Approve an access request

 - [POST /user/access-request/{id}/approve](https://docs.transportial.com/apis/user/handle_284.md): Approve a pending access request, confirming the user and adding them to the platform

## Verify 2FA code

 - [POST /user/2fa/verify](https://docs.transportial.com/apis/user/handle_308.md): Verify an incoming 2FA code. In case of a first save this endpoint will also enable the 2FA

## Start of recovering password

 - [POST /user/forgot](https://docs.transportial.com/apis/user/handle_312.md): The start of recovering

## Invite a new user to the platform

 - [POST /user/invite](https://docs.transportial.com/apis/user/handle_314.md): Invite a new user to the platform through an invitation e-mail, the user has to reset his password.

## Verify e-mail address

 - [GET /user/{id}/verify/{token}](https://docs.transportial.com/apis/user/handle_323.md): End the current session of the logged in user

## Get pending access requests

 - [GET /user/access-requests/{offset}/{amount}](https://docs.transportial.com/apis/user/handle_354.md): Returns users who have submitted an access request and are awaiting approval

## User login otp

 - [POST /user/login:otp](https://docs.transportial.com/apis/user/handle_365.md): Authenticate a user with the OTP

## Log user out

 - [GET /user/logout](https://docs.transportial.com/apis/user/handle_414.md): End the current session of the logged in user

## Assign chauffeur to user

 - [POST /user/{id}/assign-chauffeur](https://docs.transportial.com/apis/user/assign:chauffeur:user.md): Links an existing Chauffeur to an existing User; both must not already be linked.

## Get a user active session

 - [GET /user/sessions](https://docs.transportial.com/apis/user/handle_442.md): Get the currently active sessions for a user

## Setup a users 2FA

 - [POST /user/2fa/setup](https://docs.transportial.com/apis/user/handle_443.md): Get the 2FA QR image and the recovery codes

## Get a user active session by login token

 - [GET /user/session](https://docs.transportial.com/apis/user/handle_454.md): Get a user active session by active 'login attempt session''s token. Note: 'login attempt session' is a session for any specific login attemptSuch sessions would usually have short time window, hence endpoint usable only in that short duration.

## Register user

 - [POST /user/register](https://docs.transportial.com/apis/user/handle_455.md): Register a new user

## Block user

 - [POST /user/block/{id}](https://docs.transportial.com/apis/user/handle_487.md): Block a user from the platform

## Update logged in user password

 - [PUT /user/password](https://docs.transportial.com/apis/user/handle_491.md): Update the password of the currently logged in user. The current password has to be known for this change

