Import users to Klaus via API

Connect or invite users who don't exist in your help desk

Daniel Figueiredo avatar
Written by Daniel Figueiredo
Updated over a week ago

Role: Admin, Account Manager

First, if you haven't already, go ahead and set up an API connection in your Klaus account. You will only need the API token from that step to continue.


How to import users with API?


We'll need to make a POST request to https://pub.klausapp.com/v1/users & set the API token as a Bearer token in the Authorization header.

For each user, we'd want to construct a small user object:

{ "userEmail": "string", "userName": "string" }

If we, for example, wanted to add 3 new users: Alice, Robert & Jane, then we'd pass in 3 objects in a data field under the payload, like so:

{
"data": [
{ "userEmail": "alice@example.com", "userName": "Alice" },
{ "userEmail": "robert@example.com", "userName": "Robert" },
{ "userEmail": "jane@example.com", "userName": "Jane" }
]
}

An example request with curl would look like this:

curl 'https://pub.klausapp.com/v1/users' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <api_token>' \
--request POST \
--data '{ "data": [ { "userEmail": "alice@example.com", "userName": "Alice" }, { "userEmail": "robert@example.com", "userName": "Robert" }, { "userEmail": "jane@example.com", "userName": "Jane" } ] }'


Now that the users are imported to Klaus, you can go to your Users & Workspaces settings to either Connect or Invite the users just as if they were your help desk users.

Users have successfully been added to Klaus, so you can now go ahead and Connect or Invite them.

Please refer to our public API's specification page for all the available endpoints & parameters.


โ€‹

Did this answer your question?