Skip to content

User handling#

Create a user#

Second step is creating your first user(s). The minimum information required to create a user is an email address, first & last name, role and if the user is enabled or disabled.

message CreateUsersRequest {
  message CreateKeyCard {
    string uuid = 1;
    string value = 2;
    string nr = 3; // Mandatory
    string label = 4;
  }

  message CreateUser {
    string uuid = 1; // Non-mandatory, UUID to assign to the user
    string email = 2;
    string first_name = 3;
    string last_name = 4;
    string password = 5; // Non-mandatory, would be autogenerated if empty
    repeated string roles = 6; // Possible roles are: orgadmin, normal, operator, guest
    google.protobuf.Timestamp valid_from = 7; // Non-mandatory
    google.protobuf.Timestamp valid_to = 8; // Non-mandatory
    bool enabled = 9;
    map<string, string> preferences = 10;  // Non-mandatory
    CreateKeyCard key_card = 11;  // Non-mandatory
    repeated string initial_access_uuids = 12;  // Non-mandatory
  }

  string organization_slug = 1;
  repeated CreateUser users = 2;
  bool send_welcome_email = 3; // Non-mandatory
}
You can batch create users by sending multiple CreateUser messages in one CreateUsersRequest. The message is sent to the UsersService

sequenceDiagram
    participant Client
    participant UsersService
    Client->>UsersService: CreateUsersRequest
    UsersService-->>Client: CreateUsersResponse

In the response you will be given BizOperation UUID associated with the operation. Use this UUID when listening to the BizOperation stream or when polling the BizOperation endpoint to get status of the ongoing operation.

message CreateUsersResponse {
  repeated BizOperation biz_operations = 1;
}

When the BizOperation has changed status to finished we can continue on to the next step and give our user the permissions they need.