Skip to main content

Group

  • Create an org group
  • List an org groups
  • Add or invite users to a group
  • View a group members
  • Assign roles to group members
  • Remove a user from a group
  • Enable or disable a group

A group in Frontier looks like

FieldTypeDescription
iduuidUnique group identifier
namestringThe name of the group. The name must be unique within the entire Frontier instance. The name can contain only alphanumeric characters, dashes and underscores.
titlestringThe title can contain any UTF-8 character, used to provide a human-readable name for the group. Can also be left empty.
metadataobjectMetadata object for groups that can hold key value pairs defined in Group Metaschema. The metadata object can be used to store arbitrary information about the group such as labels, descriptions etc. The default Group Metaschema contains labels and descripton fields. Update the Group Metaschema to add more fields.
Example:{"labels": {"key": "value"}, "description": "Group description"}
orgIduuidThe organization ID to which the group belongs to.

Note: group metadata values are validated using MetaSchemas in Frontier Read More

Create an organization group

  1. Using frontier group create CLI command
  2. Calling to POST /v1beta1/organizations/orgId/groups API
 $ curl --location --request POST 'http://localhost:8000/v1beta1/organizations/adf997e8-59d1-4462-a4f2-ab02f60a86e7/groups'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--data-raw '{
"name": "data-batching",
"title": "Data Batching",
"metadata": {
"description": "group for users in data batching domain"
}
}'
  1. To create a group via the Admin Portal:

i. Navigate to Admin Portal > Groups from the sidebar

ii. Select + New Group from top right corner

iii. Enter basic information for the group, and select Add Group

List an organization groups

  1. Using frontier group list CLI command
  2. Calling to GET /v1beta1/organizations/orgId/groups API

View an organization projects

 curl --location 'http://localhost:8000/v1beta1/organizations/adf997e8-59d1-4462-a4f2-ab02f60a86e7/projects' 
--header 'Accept: application/json'

API Interface

Create groups

$ curl --location --request POST 'http://localhost:8000/v1beta1/groups'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--data-raw '{
"name": "Data Batching",
"slug": "data-batching",
"metadata": {
"description": "group for users in data batching domain"
},
"orgId": "4eb3c3b4-962b-4b45-b55b-4c07d3810ca8"
}'

List groups

$ curl --location --request GET 'http://localhost:8000/v1beta1/organizations/4eb3c3b4-962b-4b45-b55b-4c07d3810ca8/groups'
--header 'Accept: application/json'

Get groups

$ curl --location --request GET 'http://localhost:8000/v1beta1/organizations/4eb3c3b4-962b-4b45-b55b-4c07d3810ca8/groups/2105beab-5d04-4fc5-b0ec-8d6f60b67ab2'
--header 'Accept: application/json'

Update group

$ curl --location --request PUT 'http://localhost:8000/v1beta1/organizations/4eb3c3b4-962b-4b45-b55b-4c07d3810ca8/groups/2105beab-5d04-4fc5-b0ec-8d6f60b67ab2'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--data-raw '{
"name": "Data Batching",
"slug": "data-batching",
"orgId": "4eb3c3b4-962b-4b45-b55b-4c07d3810ca8",
"metadata": {
"description": "group for users in data batching domain",
"org-name": "raystack"
}
}'

Get all users in a group

curl --location --request GET 'http://localhost:8000/v1beta1/organizations/4eb3c3b4-962b-4b45-b55b-4c07d3810ca8/groups/86e2f95d-92c7-4c59-8fed-b7686cccbf4f/relations?subjectType=user&role=manager'
--header 'Accept: application/json'