User API specification (1.14.5)

Download OpenAPI specification:Download

The user service implements all user functions for GroupAlarm.

Authentication

API_Token

To use this API, you need an API-Token from the RBAC settings of your GroupAlarm organization. Place the token inside the HTTP-Header API-Token for every request, otherwise the API will return an "401 Unauthorized" error for your request.

Security scheme type: API Key
header parameter name: API-TOKEN

Personal-Access-Token

To use this API, you need a Personal Access Token from your profile settings. Place the token inside the HTTP-Header Personal-Access-Token for every request, otherwise the API will return an "401 Unauthorized" error for your request.

Security scheme type: API Key
header parameter name: Personal-Access-Token

auth

Login

Handles the user login and returns a user payload with JWT token

Request Body schema: application/x-www-form-urlencoded
email
required
string

The email for this account

password
required
string

The password for this account

mfa
string

The user's current mfa code. This code is required if the user enabled mfa for his account, otherwise it can be left empty. To figure out if the user has mfa enabled, you need to login with username and password first. A http 401 error containing "MFA required" allows you to ask the user a current mfa code. Sending username and password again with the mfa code will finalize the login.

Responses

200

user payload with token

401

email or password incorrect / invalid or missing mfa code / user invitation pending

500

error generating token

post /auth/login
https://app.groupalarm.com/api/v1/auth/login

Response samples

application/json
Copy
Expand all Collapse all
{
  • "active": true,
  • "availablePreference": true,
  • "availableStatus": 0,
  • "avatarURL": "string",
  • "editable": true,
  • "email": "string",
  • "id": 0,
  • "name": "string",
  • "pending": true,
  • "surname": "string",
  • "token": "string"
}

mfa

MFAIsActive

Check if the current user has MFA enabled or not

Responses

200

check was successfully completed

400

missing user id in auth token

500

unexpected error

get /mfa
https://app.groupalarm.com/api/v1/mfa

Response samples

application/json
Copy
Expand all Collapse all
{
  • "enabled": true
}

MFACreate

Creates a new, disabled MFA config for the current user

Responses

200

config successfully created

400

missing user id in auth token

500

unexpected error

put /mfa
https://app.groupalarm.com/api/v1/mfa

Response samples

application/json
Copy
Expand all Collapse all
{
  • "image":
    [
    ],
  • "secret": "string",
  • "url": "string"
}

MFAEnable

Enables a new MFA config for the current user

query Parameters
code
required
string

current MFA code

Responses

200

config successfully enabled

400

missing user id in auth token

500

unexpected error

post /mfa
https://app.groupalarm.com/api/v1/mfa

MFADisable

Disables the MFA config for the current user

query Parameters
code
required
string

current MFA code

Responses

200

config successfully disabled

400

missing user id in auth token

500

unexpected error

delete /mfa
https://app.groupalarm.com/api/v1/mfa

MFAGenerateBackupCodes

Creates ten new, one-time-use backup codes

Responses

200

codes successfully created

400

missing user id in auth token

500

unexpected error

get /mfa/backup
https://app.groupalarm.com/api/v1/mfa/backup

Response samples

application/json
Copy
Expand all Collapse all
{
  • "backupCodes":
    [
    ]
}

user

Deletes the current user irreversibly.

Can only be used after leaving all organizations.

Responses

200

user was successfully deleted

400

parameters missing or in wrong format

403

user is still a member of an organization

500

unexpected error

delete /user
https://app.groupalarm.com/api/v1/user

GetUser

Gets the complete user payload from the passed JWT token

Responses

200

complete user payload for JWT token for queried email

403

Bearer token couldn't be parsed

422

Token claims couldn't be parsed

500

unexpected error

get /user/
https://app.groupalarm.com/api/v1/user/

Response samples

application/json
Copy
Expand all Collapse all
{
  • "active": true,
  • "availablePreference": true,
  • "availableStatus": 0,
  • "avatarURL": "string",
  • "editable": true,
  • "email": "string",
  • "id": 0,
  • "name": "string",
  • "pending": true,
  • "surname": "string",
  • "token": "string"
}

UpdateUser

Updates the user profile

Request Body schema: application/json
organizationId
integer <int64>

id of the editing organization not needed if user is editing himself

user
required
object (User)

Definition of an user payload

Responses

200

user was successfully updated

403

user can't be edited from a different organization or user doesn't want to be edited by an organization administrator

500

unexpected error

put /user/
https://app.groupalarm.com/api/v1/user/

Request samples

application/json
Copy
Expand all Collapse all
{
  • "organizationId": 0,
  • "user":
    {
    }
}

InviteUser

Invites an existing or new user to an organization and sends an invitation email to the passed address

Request Body schema: application/json
organization
required
object (Organization)

Definition of an organization payload inside of the user service

users
required
Array of object (BulkUserElement)

array of user bulk elements

Responses

200

user was successfully invited

400

user invite payload is missing or in the wrong format

500

unexpected error

post /user/invite
https://app.groupalarm.com/api/v1/user/invite

Request samples

application/json
Copy
Expand all Collapse all
{
  • "organization":
    {
    },
  • "users":
    [
    ]
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "availablePreference": true,
  • "availableStatus": 0,
  • "avatarURL": "string",
  • "email": "string",
  • "id": 0,
  • "name": "string",
  • "pending": true,
  • "surname": "string"
}

GetSpecificUser

Returns a specific user with the passed api for organization members

path Parameters
userID
required
int64

ID of an user

query Parameters
organization
required
int64

ID of the organization

Responses

200

returns the requested user

500

unexpected error

get /user/{userID}
https://app.groupalarm.com/api/v1/user/{userID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "active": true,
  • "availablePreference": true,
  • "availableStatus": 0,
  • "avatarURL": "string",
  • "editable": true,
  • "email": "string",
  • "id": 0,
  • "name": "string",
  • "pending": true,
  • "surname": "string",
  • "token": "string"
}

DeleteUserFromOrganization

Removes a user from an organization

path Parameters
userID
required
int64

user by his ID

organizationID
required
int64

organization by it's ID

Responses

200

user was successfully removed from organization

400

parameters missing or in the wrong format

403

the last organization admin can not leave the organization

500

unexpected error

delete /user/{userID}/{organizationID}
https://app.groupalarm.com/api/v1/user/{userID}/{organizationID}

settings

GetSettings

Get the current user's saved settings or the default settings if none are found

Responses

200

user-defined settings

400

missing user id in auth token

500

unexpected error

get /user-settings
https://app.groupalarm.com/api/v1/user-settings

Response samples

application/json
Copy
Expand all Collapse all
{
  • "checks":
    [
    ],
  • "defaultOrganizationId": 0,
  • "helpTexts":
    [
    ],
  • "showFeedbackButton": true,
  • "theme": "string",
  • "tracking": true
}

StoreSettings

Saves the current user's settings

Request Body schema: application/json
checks
Array of string
defaultOrganizationId
integer <int64>
helpTexts
Array of string
showFeedbackButton
boolean
theme
string
tracking
boolean

Responses

200

settings successfully saved

400

missing user id in auth token

500

unexpected error

put /user-settings
https://app.groupalarm.com/api/v1/user-settings

Request samples

application/json
Copy
Expand all Collapse all
{
  • "checks":
    [
    ],
  • "defaultOrganizationId": 0,
  • "helpTexts":
    [
    ],
  • "showFeedbackButton": true,
  • "theme": "string",
  • "tracking": true
}

users

GetUsersInOrganization

Returns all users from an organization

query Parameters
organization
required
int64

organization by it's ID

Responses

200

all users from organization with passed id

500

unexpected error

get /users
https://app.groupalarm.com/api/v1/users

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

GetUsersInOrganizationPagination

Returns all users from an organization with pagination

query Parameters
organization
required
int64

organization by it's ID

limit
int64 [ 1 .. 50 ]
Default: 10

max. amount of entries in list

offset
int64
Default: 0

amount of entries to skip

Responses

200

all users from organization with passed id

500

unexpected error

get /users/pagination
https://app.groupalarm.com/api/v1/users/pagination

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]