Create group
Create group
client.zones.groups.create(stringzoneID, GroupCreateParams { name, identifier } body, RequestOptionsoptions?): Group { id, created_at, external, 7 more }
POST/zones/{zoneId}/groups
Creates a group in the zone (managed in Keycard). Groups synced from an external directory are created by that directory, not here.
Parameters
zoneID: string
Returns
Create group
import KeycardAPI from '@keycardai/api';
const client = new KeycardAPI({
apiKey: process.env['KEYCARD_API_API_KEY'], // This is the default and can be omitted
});
const group = await client.zones.groups.create('zoneId', { name: 'x' });
console.log(group.id);{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"external": true,
"identifier": "identifier",
"name": "name",
"organization_id": "organization_id",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"member_count": 0,
"roles": [
"string"
]
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"external": true,
"identifier": "identifier",
"name": "name",
"organization_id": "organization_id",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"member_count": 0,
"roles": [
"string"
]
}