Create a Group in an Organization

The createGroup mutation creates a group in an organization and makes the caller its owner.

Before You Begin

🔗 Use the GraphQL Playground to execute the queries in this guide.

➡️ New to GraphQL? Learn how to navigate the Playground with our Playground Basics Guide.

Prerequisites

  1. Authentication: Use a Service Account token (Personal Access Tokens are deprecated).
  2. Permissions: The caller's organization role must include the create_group permission.
  3. Organization UUID: Identify the organization the group will belong to.

Step 1: Find Your Organization UUID

Step 2: Create the Group

The createGroup mutation creates an empty group in the organization. The caller becomes an owner of the new group.

mutation {
  createGroup(
    input: {
      organizationUuid: "organization-uuid-here"
      name: "Marketing Team"
      description: "Marketing staff"
    }
  ) {
    success
    group {
      id
      uuid
      name
      description
      createdAt
    }
  }
}

Arguments

  • organizationUuid (ID!, required): the UUID of the organization.
  • name (String!, required): the group name. Up to 50 characters, unique within the organization.
  • description (String, optional): up to 140 characters.
  • clientMutationId (String, optional): a Relay client id. When you send it, the payload echoes it.

Sample response

{
  "data": {
    "createGroup": {
      "success": true,
      "group": {
        "id": "123",
        "uuid": "group-uuid-here",
        "name": "Marketing Team",
        "description": "Marketing staff",
        "createdAt": "2026-11-30T12:00:00Z"
      }
    }
  }
}

Step 3: Add Users to the Group

Add organization members to the new group with Add Organization Users to a Group, using the uuid returned above.

Key Notes

  • Permission: when the caller's role lacks create_group, the error is Permission denied with extensions.code set to PERMISSION_DENIED.
  • Unknown organization: an unknown UUID returns Organization not found with UUID: ... with extensions.code set to RESOURCE_NOT_FOUND.
  • Invalid group data: a duplicate name in the organization, a blank name, a name over 50 characters or a description over 140 characters returns the validation messages (for example Name has already been taken) with extensions.code set to RECORD_INVALID.
  • These failures are GraphQL errors with createGroup: null. success: false is not a response. A failed call creates no group.