User groups (groups)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/domain/groups

Creating a new user group

GET

/rest/v1/domain/groups

Getting a list of user groups

GET

/rest/v1/domain/groups/<id>

Retrieving user group data

PATCH

/rest/v1/domain/groups/<id>

Changing user group data

DELETE

/rest/v1/domain/groups/<id>

Deleting a user group

LOOKUP

/rest/v1/domain/groups

Searching for a user group ID


Creating a new user group

Request

Field Description: group entity

Request example
POST /rest/v1/domain/groups HTTP/1.1
Content-Type: application/json; charset=utf-8

group entity

Response

Field Description: group entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "afafafaf-0178-3fc1-67fc-7cd30a921f58",
  "code": "groupA",
  "description": "",
  "users": [
    "00000001-abcd-abcd-abcd-abcdabcdabcd",
    "00000002-abcd-abcd-abcd-abcdabcdabcd"
  ],
  "groups": [
    "abcdef00-05b7-8163-948c-3392a9660db9"
  ],
  "opts": {
    "comment": "",
    "title": "",
    "roles": [
      "roleA1",
      "roleA2"
    ]
  },
  "ext": {
    "ct": "2022-04-15T13:37:03.82Z",
    "lwt": "2022-04-15T13:41:42.25Z"
  }
}

Getting a list of user groups

Request

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, code, description, users, groups, opts.title, opts.comment, opts.roles, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/domain/groups?offset=0&limit=2 HTTP/1.1

Response

Field Description: group entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "afafafaf-0178-3fc1-67fc-7cd30a921f58",
    "code": "groupA",
    "description": "",
    "users": [
      "00000001-abcd-abcd-abcd-abcdabcdabcd",
      "00000002-abcd-abcd-abcd-abcdabcdabcd"
    ],
    "groups": [
      "abcdef00-05b7-8163-948c-3392a9660db9"
    ],
    "opts": {
      "comment": "",
      "title": "",
      "roles": [
        "roleA1",
        "roleA2"
      ]
    },
    "ext": {
      "ct": "2022-04-15T13:37:03.82Z",
      "lwt": "2022-04-15T13:41:42.25Z"
    }
  },
  {
    "id": "abcdef00-05b7-8163-948c-3392a9660db9",
    "code": "GroupB",
    "description": "",
    "users": [
      "00000003-abcd-abcd-abcd-abcdabcdabcd"
    ],
    "groups": [],
    "opts": {
      "comment": "",
      "title": "",
      "roles": [
        "roleB1",
        "roleB2"
      ]
    },
    "ext": {
      "ct": "2022-04-15T12:22:25.26Z",
      "lwt": "2022-04-15T12:22:25.26Z"
    }
  }
]

Retrieving user group data

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/domain/groups/afafafaf-0178-3fc1-67fc-7cd30a921f58 HTTP/1.1

Response

Field Description: group entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "afafafaf-0178-3fc1-67fc-7cd30a921f58",
  "code": "groupA",
  "description": "",
  "users": [
    "00000001-abcd-abcd-abcd-abcdabcdabcd",
    "00000002-abcd-abcd-abcd-abcdabcdabcd"
  ],
  "groups": [
    "abcdef00-05b7-8163-948c-3392a9660db9"
  ],
  "opts": {
    "comment": "",
    "title": "",
    "roles": [
      "roleA1",
      "roleA2"
    ]
  },
  "ext": {
    "ct": "2022-04-15T13:37:03.82Z",
    "lwt": "2022-04-15T13:41:42.25Z"
  }
}

Changing user group data

Fields prohibited for modification: id

Request

Field Description: group entity

Request example
PATCH /rest/v1/domain/groups/afafafaf-0178-3fc1-67fc-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8

group entity

Response

Field Description: group entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "afafafaf-0178-3fc1-67fc-7cd30a921f58",
  "code": "groupA",
  "description": "",
  "users": [
    "00000001-abcd-abcd-abcd-abcdabcdabcd",
    "00000002-abcd-abcd-abcd-abcdabcdabcd"
  ],
  "groups": [
  ],
  "opts": {
    "comment": "",
    "title": "",
    "roles": [
      "roleA1",
      "roleA2"
    ]
  },
  "ext": {
    "ct": "2022-04-15T13:37:03.82Z",
    "lwt": "2022-04-15T13:41:42.25Z"
  }
}

Deleting a user group

Request

Request example
DELETE /rest/v1/domain/groups/afafafaf-0178-3fc1-67fc-7cd30a921f58 HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Searching for a user group ID

Searches the resource for the specified key, returns the identifier(s) to build the endpoint.

Key fields to search for: id, name

Request

Request example
LOOKUP /rest/v1/domain/groups HTTP/1.1
Content-Type: application/json; charset=utf-8

"groupA"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "afafafaf-0178-3fc1-67fc-7cd30a921f58"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}