Yokoy User API
Users in Yokoy reflect the fundamental roles of submitter, approver, and finance user. Mandatory user information depends on the specific organization requirements and Yokoy features enabled. Email addresses must be unique for the organization. You cannot create two users with the same email address. If the email address provided already exists in the organization, the API returns an error. Bank information can be provided as part of POST, PUT, and PATCH requests, however, the response does not return this information for security reasons. **Note**: You can‘t use the User endpoints to determine the roles and permissions assigned to a user. You can only use the endpoints to create a new user. Roles and permissions are granted to a user in Yokoy (**Admin > Finance/HR roles**). You must have previously created the user before assigning roles and permissions. - **Booking strategy**: You can export expenses based on the user selected currency (instead of the company currency or the original expense currency). If you choose this option, you need to provide the user's currency. - **Approval strategy**: If you plan to approve expenses using a line manager approval strategy, then you need to enter a line manager for each user. - **Expense accounting**: If expenses are to be posted via the employee vendor account, the field `employeeId` should reflect employee vendor account number. If you want to track the employee number, you should set up a custom field to add this information. - **User policy**: You can assign rank-specific expense policies to certain users and user groups to determine applicable expense rules, per diem and mileage rates, as well as expense categories. If you choose this option, then you need to enter the policy ID. For any unrecognized IDs, Yokoy creates or updates the user attribute with the value `null`. For example, if you pass `Y6cp2G30M` as the `lineManagerId` and no user exists for that ID, Yokoy updates the line manager ID attribute as `null`. To guarantee spend data traceability, when you delete a user via the Yokoy API, the email is changed to an email address with the format: `deleted_user_` + user ID. For example, `deleted_user_lK6jo1GmSkXJzSyZSA2f@localhost.invalid`. The user is still displayed in **HR > User management** with a deleted tag and can’t be re-activated or edited. The user can still be retrieved via the Yokoy API using the Yokoy user ID. However, the user is not returned if you retrieve all users using a GET method. Deleted users can’t be re-activated in any way.