PrincipalGroup

List all the Groups of a Directory

Changed on

Retrieves a paginated list of all groups within the specified directory. Results can be sorted by name, created_at, or updated_at, and filtered by name, description, id, labels, or type.

get/v2/directories/{directoryId}/groups

Request

  • Base URL
    https://global.api.konghq.com
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Path parameters

directoryId, string uuid required

ID of the directory

Query parameters

page, CursorPageParameters
size, integer

The number of items included per page.

after, string

Cursor param specifying the page (i.e. the next page) of data returned.

before, string

Cursor param specifying the page (i.e. the previous page) of data returned.

Determines which page of the collection to retrieve.

{
  "size": 10,
  "after": "ewogICJpZCI6ICJoZWxsbyB3b3JsZCIKfQ",
  "before": "ewogICJpZCI6ICJoZWxsbyB3b3JsZCIKfQ"
}
sort, string

The asc suffix is optional as the default sort order is ascending. The desc suffix is used to specify a descending order. Multiple sort attributes may be provided via a comma separated list. JSONPath notation may be used to specify a sub-attribute (eg: 'foo.bar desc').

Example:created_at desc

Sorts a collection of groups. Supported sort attributes are:

  • name
  • created_at
  • updated_at
filter, object
name, LegacyStringFieldFilter

Filter using one of the following operators: eq, contains

description, LegacyStringFieldFilter

Filter using one of the following operators: eq, contains

id, StringFieldEqualsFilter

Filters on the given string field value by exact match.

labels, StringFieldEqualsFilter

Filters on the given string field value by exact match.

type, object

Filter using one of the following operators: eq, oeq

Filter groups by field. Supported filter fields:

  • name: exact match or contains. Example: filter[name]="PlatformEngineers" or filter[name][contains]="Platform"
  • description: exact match or contains. Example: filter[description]="platform team"
  • id: exact match. Example: filter[id]="<uuid>"
  • labels.<key>: exact match on a specific label key. Example: filter[labels.env]="prod"
  • type: exact match on one or more group types. Accepted values: group, team, project. Example: filter[type]="team" or filter[type][oeq]="group,team"

Response

List of Kong Groups

ListKongGroups required
meta, CursorMeta required

Pagination metadata.

data, KongGroup[] required

Example response

{
  "meta": {
    "page": {
      "size": 10
    }
  },
  "data": [
    {
      "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
      "labels": {
        "env": "test"
      },
      "created_at": "2022-11-04T20:10:06.927Z",
      "updated_at": "2022-11-04T20:10:06.927Z",
      "managed_by": {
        "owner": "terraform"
      },
      "team_manager": {
        "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
        "display_name": "josh",
        "email": "josh@acme.com"
      }
    }
  ]
}

Changes

    • breaking

      the data/items/managed_by/additionalProperties response property's maxLength was increased from 63 to 127 for the response status

    • info

      the data/items/managed_by/additionalProperties response's property pattern was changed from ^[a-z0-9A-Z]{1}([a-z0-9A-Z-._]*[a-z0-9A-Z]+)?$ to ^[^\s\x00-\x1F\x7F-\x9F]+$ for the status

    • info

      the data/items/name response's property pattern was changed from ^[A-Za-z0-9]+$ to ^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$ for the status