> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zapnito.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Groups API

> Create a group in your Zapnito community through the API, then manage its members with the group users endpoints.

Create groups on your community. To manage the users in a group, see [Group users](/api/v1/group-users).

Before you start, read the [API overview](/api/v1/overview) for how authentication, headers, pagination and errors work.

## Create a group

Create a new group. The response includes the group's `uuid`, which you use to identify the group in other endpoints.

<ParamField body="group.name" type="string" required>
  The name of the new group.
</ParamField>

<ParamField body="group.group_type" type="string" required>
  The group type. Must be `Person` or `Organisation`.
</ParamField>

<ParamField body="group.user_type" type="string" required>
  The user type. Must be `Admin` or `Student`.
</ParamField>

```bash title="Create a group" theme={null}
curl -X POST "https://your-community.zapnito.com/api/v1/groups" \
  -H "Authorization: Token token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{"group": {"name": "Expert Users", "group_type": "Person", "user_type": "Admin"}}'
```

`POST https://your-community.zapnito.com/api/v1/groups`

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "group": {
      "name": "Expert Users",
      "group_type": "Person",
      "user_type": "Admin",
      "uuid": "a1ecad96-8849-45ba-821e-20199cde45cd"
    }
  }
  ```

  ```json 422 Unprocessable Entity theme={null}
  {
    "errors": {
      "name": ["can't be blank"],
      "group_type": ["must be one of: Person/Organisation"],
      "user_type": ["must be one of: Admin/Student"]
    }
  }
  ```
</ResponseExample>

* `200 OK`: the group was created.
* `422 Unprocessable Entity`: a required parameter is missing or invalid.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.