User management and user invitation use cases
User management and user invitation – use case guide
This guide explains how to invite users to a Netvisor company (käyttäjän kutsuminen) and how to manage existing users' access rights (käyttäjänhallinta) through the API. For element-level details, see the API reference.
The Finnish UI term is shown in italics after the English description, for example accountant (Kirjanpitäjä).
Before you start
Required rights: the API user must have access to the company and, in addition, the User administrator role (käyttäjähallitsija, KH) or Accounting office administrator role (tilitoimiston pääkäyttäjä, TPK) rights.
Production only: the user invitation and user management resources only work in the production environment.
Identifiers: users and companies are identified by their Netvisor keys. The company's key is given in
company, and a user's key inuserwith the attributetype="netvisorkey". Users' keys are returned bygetuseraccessrightssummary.nv.
Resources
Area | Resource | Method | Purpose |
|---|---|---|---|
User invitation | POST | Send a user invitation (käyttäjäkutsu) | |
GET | List invitations and their statuses | ||
POST | Verify an invitation and open the user's access | ||
POST | Cancel an invitation | ||
User management | GET | List users and their roles, profiles and validity | |
POST | Change a user's roles and access profiles | ||
POST | Set the validity period of a user's access | ||
POST | Remove a user's access to a company |
Use case: invite a user
The invitation lifecycle
Step | What happens | Invitation status |
|---|---|---|
1. Send | Your integration sends the invitation with |
|
2. Authenticate | The invitee opens the link and authenticates. |
|
3. Verify | Your integration verifies the invitation with |
|
An invitation can also end in Cancelled (cancelled with canceluserinvitation.nv), or in one of the error statuses EmailSendingFailed, SmsSendingFailed or TwoFaFailed. The invitation is valid for a limited time; its expiry time is returned by getuserinvitations.nv.
Step 1 – Send the invitation
senduserinvitation.nv sends an invitation to a new or existing user. The invitee's email address becomes their username.
Element | Notes |
|---|---|
| Invitation type: |
| Invitee's first names, max 50 characters. Required. |
| Invitee's last name, max 50 characters. Required. |
| Recipient's email address, max 100 characters. Becomes the username. Required. |
| Recipient's phone number, max 20 characters. Required. |
| Netvisor key of the company the user is invited to. Required. |
| Netvisor key of an existing user, |
| Email address that receives a notification when the invitation has been verified. Optional. |
The two invitation types work differently:
|
| |
|---|---|---|
Payroll requirement | None. | Payroll (palkanlaskenta) must be in use in the company; otherwise the invitation fails with an error. |
| Optional. | Required: the user must already exist in Netvisor and already be an employee in payroll. |
Creates a new user | Can create a completely new user. | Never creates a new user. |
If the user already has access to the company | The invitation is rejected with an error. | Access rights are not added again. |
Role the user gets | Company user (Yrityskäyttäjä) | Company user (Yrityskäyttäjä) |
Example:
Step 2 – Follow the invitation
getuserinvitations.nv lists invitations issued by your integration, in pages (page, itemsonpage).
Parameter | Use |
|---|---|
| Company's Netvisor key. Defaults to the API user's current company. |
| Comma-separated invitation IDs. |
|
|
|
|
| Exact-match filters on the invitee's details. |
Each invitation contains the company, the invitee's name, whether the invitee is an existing Netvisor user (ExistingNetvisorUser), the email address and phone number given in the invitation, the invitation type and status, and timestamps for creation, expiry, authentication and verification, together with who created and verified the invitation.
Step 3 – Verify the invitation
When the invitee has authenticated, call verifyuserinvitation.nv with the invitation's Netvisor key in netvisorkey. The invitation moves from Authenticated to Verified, and the user's access to the company opens. The call returns FAILED if the invitation is not in the Authenticated status.
Cancel an invitation
canceluserinvitation.nv cancels an invitation that has not been completed (netvisorkey). The invitation is marked Cancelled and the invitation link stops working immediately. The call returns FAILED if the invitation does not exist or has already reached Authenticated, Verified or Cancelled.
Use case: manage users' access rights
List users and their rights
getuseraccessrightssummary.nv returns the users of one company with their roles, access profiles and validity.
Parameter | Use |
|---|---|
| Company's Netvisor key. Defaults to the API user's current company. |
| Comma-separated user Netvisor keys. Without it, all users the API user can see are returned. |
|
|
For each user, the response contains the Netvisor key, first name, last name, roles, access profiles and, when both are set, the validity period (ValidFrom, ValidTo).
Role in the response | Netvisor UI name |
|---|---|
| Company administrator (Yrityksen pääkäyttäjä) |
| Accounting office super user (Tilitoimiston pääkäyttäjä) |
| User administrator (Käyttäjähallitsija) |
| Auditor (Tilintarkastaja) |
| Accountant (Kirjanpitäjä) |
| Payroll accountant (Palkanlaskija) |
| Supervisor (Esihenkilö, E) |
| Personal data administrator (Henkilötietojen hallinnoija, HH) |
Change roles and access profiles
edituseraccessrights.nv changes an existing user's roles and access profiles in one company. user and company are required. The update is partial: elements you leave out are not changed.
Element | Netvisor UI name | Values |
|---|---|---|
| User administrator (Käyttäjähallitsija) | 0 = off, 1 = on |
| Accountant (Kirjanpitäjä) | 0 = off, 1 = on |
| Auditor (Tilintarkastaja) | 0 = off, 1 = on |
| Payroll accountant (Palkanlaskija) | 0 = off, 1 = on |
| Supervisor (Esihenkilö, E) | 0 = off, 1 = on |
| Personal data administrator (Henkilötietojen hallinnoija, HH) | 0 = off, 1 = on |
| Accounting access profile (Kirjanpidon käyttöoikeusprofiili) |
|
| Payroll access profile (Palkkahallinnon käyttöoikeusprofiili) |
|
To turn a role off, send it explicitly with the value 0. Profile values are not case-sensitive.
Example: give a user the accountant role and full accounting rights, without changing anything else:
Set the validity period of access
changeuseraccessrightsvalidity.nv sets from when and until when a user's access is valid, without changing their roles or profiles. Use it, for example, for time-limited audits or temporary access.
Element | Notes |
|---|---|
| User's Netvisor key, |
| Company's Netvisor key, |
| 0 = apply only to the given company. 1 = apply to every company the API user has access to; |
| Start and end date, |
The call returns FAILED if the user has no access to the company or the date range is invalid.
Remove access
deleteuseraccessright.nv removes a user's access to a company (user and company). A user cannot remove their own access with this resource. The call returns FAILED if the user and company combination does not exist or the API user lacks user administrator rights.
Glossary: English – Finnish
English | Finnish (Netvisor UI) |
|---|---|
User management | Käyttäjänhallinta |
User invitation | Käyttäjän kutsuminen / käyttäjäkutsu |
New user | Uusi käyttäjä |
Employee | Työntekijä |
Company user | Yrityskäyttäjä |
Company administrator | Yrityksen pääkäyttäjä |
Accounting office administrator role | Tilitoimiston pääkäyttäjä (TPK) |
User administrator role | Käyttäjähallitsija (KH) |
Auditor | Tilintarkastaja |
Accountant | Kirjanpitäjä |
Payroll accountant | Palkanlaskija |
Supervisor | Esihenkilö (E) |
Personal data administrator | Henkilötietojen hallinnoija (HH) |
Accounting access profile | Kirjanpidon käyttöoikeusprofiili |
Payroll access profile | Palkkahallinnon käyttöoikeusprofiili |
Payroll | Palkanlaskenta |