RBAC API specification (1.18.2)

Download OpenAPI specification:Download

The RBAC service implements a role based access control infrastructure to GroupAlarm.com

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

personal-access-token

PersonalAccessTokenList

Lists all personal access tokens created by the current user

Responses

200

all personal access tokens

400

userID not found in JWT token

500

unexpected internal error

get /personal-access-token
https://app.groupalarm.com/api/v1/rbac/personal-access-token

Response samples

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

PersonalAccessTokenCreate

Creates a new personal access token for the current user

Request Body schema: application/json
name
string
userID
integer <int64>

Responses

201

newly created personal access token

400

userID not found in JWT token or request malformed

500

unexpected internal error

post /personal-access-token
https://app.groupalarm.com/api/v1/rbac/personal-access-token

Request samples

application/json
Copy
Expand all Collapse all
{
  • "name": "string",
  • "userID": 0
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "name": "string",
  • "token": "string",
  • "userID": 0
}

PersonalAccessTokenRegenerate

Regenerates an existing personal access token for the current user

path Parameters
id
required
int64

Responses

200

regenerated personal access token

400

userID not found in JWT token or request malformed

500

unexpected internal error

post /personal-access-token/{id}
https://app.groupalarm.com/api/v1/rbac/personal-access-token/{id}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "name": "string",
  • "token": "string",
  • "userID": 0
}

PersonalAccessTokenDelete

Deletes the given personal access tokens

path Parameters
id
required
int64

Responses

200

personal access token successfully deleted

400

userID not found in JWT token

404

personal access token not found

500

unexpected internal error

delete /personal-access-token/{id}
https://app.groupalarm.com/api/v1/rbac/personal-access-token/{id}

roles

RoleList

Returns all roles with passed organization id

query Parameters
organization_id
required
int64

Responses

200

All roles from organization

400

query parameter 'organization_id' is missing

500

database error

get /roles
https://app.groupalarm.com/api/v1/rbac/roles

Request samples

Copy
console.log('Hello World');

Response samples

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

RoleCreate

Creates a new role in passed organization id

Request Body schema: application/json
description
string

Optional description for this role

id
integer <int64> >= 1

ID for this role

name
required
string

Name for this role

organizationID
required
integer <int64> >= 1

Connected organization ID

type
string

Definition of default organization roles

Responses

201

created role payload

400

passed role is in the wrong format

500

database error

post /roles
https://app.groupalarm.com/api/v1/rbac/roles

Request samples

application/json
Copy
Expand all Collapse all
{
  • "description": "string",
  • "id": 1,
  • "name": "string",
  • "organizationID": 1,
  • "type": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "description": "string",
  • "id": 1,
  • "name": "string",
  • "organizationID": 1,
  • "type": "string"
}

RoleGet

Get specific role with passed ID

path Parameters
roleID
required
int64

Responses

200

requested role object

400

role ID is not passed in path

500

database error

get /roles/{roleID}
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "description": "string",
  • "id": 1,
  • "name": "string",
  • "organizationID": 1,
  • "type": "string"
}

RoleDelete

Delete specific role with passed ID

path Parameters
roleID
required
int64

Responses

200

role was deleted

400

roleID is not passed in path

401

deleted role is a default role

500

database error

delete /roles/{roleID}
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}

RoleUpdate

Update specific role with passed ID

path Parameters
roleID
required
int64
Request Body schema: application/json
description
string

Optional description for this role

id
integer <int64> >= 1

ID for this role

name
required
string

Name for this role

organizationID
required
integer <int64> >= 1

Connected organization ID

type
string

Definition of default organization roles

Responses

200

updated role object

400

roleID is not passed in path or passed role object has the wrong format

401

edited role is a default role

500

database error

patch /roles/{roleID}
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "description": "string",
  • "id": 1,
  • "name": "string",
  • "organizationID": 1,
  • "type": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "description": "string",
  • "id": 1,
  • "name": "string",
  • "organizationID": 1,
  • "type": "string"
}

roleaccess

RoleAccessList

List all assigned accesses for the passed roleID

path Parameters
roleID
required
int64

Responses

200

returns an array of assigned accesses

400

roleID or userID in the wrong format

403

user is the last admin member

500

database error

get /roles/{roleID}/access
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}/access

Response samples

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

RoleAccessCreate

Creates a role access definition

path Parameters
roleID
required
int64
Request Body schema: application/json
endpoints
required
Array of string

Concerning endpoints/services

id
integer <int64> >= 1

ID of this role access

methods
required
Array of string

Allowed HTTP methods

roleID
integer <int64> >= 1

ID of the role

Responses

201

returns the created role access object

400

role access payload is in a wrong format

500

database error

post /roles/{roleID}/access
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}/access

Request samples

application/json
Copy
Expand all Collapse all
{
  • "endpoints":
    [
    ],
  • "id": 1,
  • "methods":
    [
    ],
  • "roleID": 1
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "endpoints":
    [
    ],
  • "id": 1,
  • "methods":
    [
    ],
  • "roleID": 1
}

RoleAccessDelete

Creates an role access definition

path Parameters
roleID
required
int64
roleAccessID
required
int64

Responses

200

role access assignment deleted

400

roleID and/or roleAccessID in a wrong format

500

database error

delete /roles/{roleID}/access/{roleAccessID}
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}/access/{roleAccessID}

RoleAccessUpdate

Updates a role access definition

path Parameters
roleID
required
int64
roleAccessID
required
int64
Request Body schema: application/json
endpoints
required
Array of string

Concerning endpoints/services

id
integer <int64> >= 1

ID of this role access

methods
required
Array of string

Allowed HTTP methods

roleID
integer <int64> >= 1

ID of the role

Responses

200

returns the the updated role access object

400

role access payload is in a wrong format

500

database error

patch /roles/{roleID}/access/{roleAccessID}
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}/access/{roleAccessID}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "endpoints":
    [
    ],
  • "id": 1,
  • "methods":
    [
    ],
  • "roleID": 1
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "endpoints":
    [
    ],
  • "id": 1,
  • "methods":
    [
    ],
  • "roleID": 1
}

userroles

UserRoleList

List all assigned user for passed roleID

path Parameters
roleID
required
int64

Responses

200

all connected users

400

roleID is not passed in path

500

database error

get /roles/{roleID}/user
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}/user

Response samples

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

UserRoleCreate

Create a user to role assignment

path Parameters
roleID
required
int64
Request Body schema: application/json
roleID
required
integer <int64> >= 1

ID of the role

userID
required
integer <int64> >= 1

ID of the user

Responses

201

user was assigned to role

400

user-role payload is in the wrong format

500

database error

post /roles/{roleID}/user
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}/user

Request samples

application/json
Copy
Expand all Collapse all
{
  • "roleID": 1,
  • "userID": 1
}

DeleteUserRole

Deletes an user-role assignment for the passed IDs

path Parameters
roleID
required
int64
userID
required
int64

Responses

200

user-role assignment deleted

400

roleID or userID in the wrong format

403

user is the last admin member

500

database error

delete /roles/{roleID}/user/{userID}
https://app.groupalarm.com/api/v1/rbac/roles/{roleID}/user/{userID}

GetUserRoles

Returns all roles for the current logged in user (JWT-TOKEN)

Request Body schema: application/json
roleID
required
integer <int64> >= 1

ID of the role

userID
required
integer <int64> >= 1

ID of the user

Responses

201

user was assigned to role

400

user-role payload is in the wrong format

500

database error

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

Request samples

application/json
Copy
Expand all Collapse all
{
  • "roleID": 1,
  • "userID": 1
}

services

ServicesList

List all up and running services from GroupAlarm.com

Responses

200

All up and running services from GroupAlarm.com

500

unexpected internal error

get /services
https://app.groupalarm.com/api/v1/rbac/services

Response samples

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