Management

Endpoints to manage user's authorization for certain acts.

Endpoints

Get workspace groups

GET/management/groups

Roles:

groups:read

Arguments

No arguments needed

Response

{
"status": "ok",
"data": [
{
"id": "06decgcf-9804-452a-77dc-b2b5628e9bee",
"name": "Intenseye Team",
"roles": [
{
"resource": "users",
"action": "read"
},
{
"resource": "users",
"action": "write"
},
{
"resource": "users",
"action": "delete"
},
{
"resource": "workspaces",
"action": "read"
},
{
"resource": "workspaces",
"action": "write"
},
{
"resource": "facilities",
"action": "read"
},
{
"resource": "facilities",
"action": "write"
},
{
"resource": "facilities",
"action": "delete"
},
{
"resource": "cameras",
"action": "read"
},
{
"resource": "cameras",
"action": "write"
},
{
"resource": "cameras",
"action": "delete"
},
{
"resource": "drawingboard",
"action": "read"
},
{
"resource": "drawingboard",
"action": "write"
},
{
"resource": "alerts",
"action": "read"
},
{
"resource": "alerts",
"action": "write"
},
{
"resource": "alerts",
"action": "delete"
}
]
},
{
"id": "221b29de-9c43-461c-bd6a-5fd3e98e8065",
"name": "Workspace Owner",
"roles": [
{
"resource": "users",
"action": "read"
},
{
"resource": "users",
"action": "write"
},
{
"resource": "users",
"action": "delete"
},
{
"resource": "workspaces",
"action": "read"
},
{
"resource": "workspaces",
"action": "write"
},
{
"resource": "facilities",
"action": "read"
},
{
"resource": "facilities",
"action": "write"
},
{
"resource": "facilities",
"action": "delete"
},
{
"resource": "cameras",
"action": "read"
},
{
"resource": "cameras",
"action": "write"
},
{
"resource": "cameras",
"action": "delete"
},
{
"resource": "drawingboard",
"action": "read"
},
{
"resource": "drawingboard",
"action": "write"
},
{
"resource": "alerts",
"action": "read"
},
{
"resource": "alerts",
"action": "write"
}
]
},
{
"id": "gg89137e-1b54-44d9-8e8e-4c73a3577e84",
"name": "Workspace Admin",
"roles": [
{
"resource": "users",
"action": "read"
},
{
"resource": "workspaces",
"action": "read"
},
{
"resource": "workspaces",
"action": "write"
},
{
"resource": "cameras",
"action": "read"
},
{
"resource": "cameras",
"action": "write"
},
{
"resource": "cameras",
"action": "delete"
},
{
"resource": "drawingboard",
"action": "read"
},
{
"resource": "drawingboard",
"action": "write"
},
{
"resource": "alerts",
"action": "read"
},
{
"resource": "alerts",
"action": "write"
}
]
},
{
"id": "f6063358-3e40-4f37-90a4-f1a9441f39f7",
"name": "Workspace User",
"roles": [
{
"resource": "users",
"action": "read"
},
{
"resource": "workspaces",
"action": "read"
},
{
"resource": "cameras",
"action": "read"
},
{
"resource": "drawingboard",
"action": "read"
},
{
"resource": "alerts",
"action": "read"
}
]
}
]
}

Create a workspace groups

POST/management/groups

Roles:

groups:write

Arguments

BODY
  • name UUID required Group name
  • roles List[String]` required List of roles

Response

{
"status": "ok",
"data": "f6063358-3e40-4f37-90a4-f1a9441f39f7"
}

Update a workspace group

PATCH/management/groups/:id

Roles:

groups:write

Arguments

PATH PARAMETER
  • id UUID required The id of the group
BODY
  • name UUID required Group name
  • roles List[String]` required List of roles
  • isDefault Boolean optional Default group config

Response

{
"status": "ok",
"message": "Group updated."
}

Delete a workspace group

DELETE/management/groups/:id

Roles:

groups:write

Arguments

PATH PARAMETER
  • id UUID required The id of the group

Response

{
"status": "ok",
"data": 1
}

Update a users group

POST/management/update_users_group

Roles:

permissions:write

Change a users current group.

Arguments

BODY
  • userId UUID required The id of the user
  • groupId UUID required The id of the group

Returns

{
"status": "ok",
"message": "User group updated."
}

Add role to user

POST/management/add_role

Roles:

users:write

Add a role to a user

Arguments

BODY
  • userId UUID required The id of the user.
  • resource Enum required The type of the resource. Can be one of:
    • alerts
    • assigned_alerts
    • cameras
    • drawingboard
    • facilityanalytics
    • facilities
    • groups
    • invitations
    • maia
    • overviewanalytics
    • permissions
    • reporting
    • users
    • videos
    • workspaces
  • actions Array[Enum] required List of actions to give user's role. Can be one of read, write, delete.
  • resourceId UUID optional If the role is for a sub-resource, the resource id must be given. Currently only applies for facilities.

Returns

{
"status": "ok",
"message": "Role added to the user"
}

Remove role from user

POST/management/remove_role

Roles:

users:write

Remove a role from user

Arguments

BODY
  • userId UUID required The id of the user.
  • resource Resource required The type of the resource. Can be one of:
    • alerts
    • assigned_alerts
    • cameras
    • drawingboard
    • facilityanalytics
    • facilities
    • groups
    • invitations
    • maia
    • overviewanalytics
    • permissions
    • reporting
    • users
    • videos
    • workspaces
  • actions Array[Enum] required List of actions to give user's role. Can be one of read, write, delete.
  • resourceId UUID optional If the role is for a sub-resource, the resource id must be given. Currently only applies for facilities.

Returns

{
"status": "ok",
"message": "Roles removed to the user"
}

Get roles

GET/management/roles

Arguments

No arguments needed

Returns

Return list of all roles.

{
"status": "ok",
"data": [
{
"resource": "users",
"action": "read"
},
{
"resource": "users",
"action": "write"
},
{
"resource": "users",
"action": "delete"
}
]
}