Create group
Create group
zones.groups.create(strzone_id, GroupCreateParams**kwargs) -> Group
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
zone_id: str
name: str
Human-readable group name
minLength1
maxLength255
formatsafe-text
identifier: Optional[str]
User-specified identifier, unique within the zone. Derived from the name when omitted (a suffix is appended if it collides).
minLength1
maxLength2048
formatsafe-text
Returns
Create group
import os
from keycardai_api import KeycardAPI
client = KeycardAPI(
api_key=os.environ.get("KEYCARD_API_API_KEY"), # This is the default and can be omitted
)
group = client.zones.groups.create(
zone_id="zoneId",
name="x",
)
print(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"
]
}