> ## 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.

# Create a group

> Creates a group in the community. The group type decides whether people or organisations can join it, and the user type decides the level of access its members have



## OpenAPI

````yaml https://api.zapnito.com/api/docs/v1/swagger.json post /api/v1/groups
openapi: 3.0.1
info:
  title: API V1
  version: v1
  description: Zapnito API Documentation
servers:
  - url: https://{host}
    description: Your community domain
    variables:
      host:
        default: your-community.com
        description: Your community domain, for example your-community.com
security: []
tags:
  - name: Health Check
    description: Check that the API is reachable and that your API key is valid
  - name: Identity
    description: Find out which community your API key belongs to
  - name: Users
    description: >-
      Look up the people in your community, update their profile and choose
      which notifications they receive
  - name: Organisations
    description: >-
      Create and update the organisations in your community and manage who
      belongs to them
  - name: Groups
    description: Create groups and manage which users belong to them
  - name: Invitations
    description: Invite people to join your community
  - name: Posts
    description: Create, read and update posts on behalf of your community members
  - name: Contents
    description: >-
      Read the published content of your community and publish, schedule or
      unpublish it
  - name: Channels
    description: List the channels in your community and the content published in each
  - name: Rooms
    description: Create and read the rooms where your community members meet
  - name: Tags
    description: Create tags and apply them to content
  - name: Badges
    description: Create badges and award them to content or to users
  - name: Custom Fields
    description: Read the custom profile fields your community asks its members to fill in
  - name: Third-Party Resources
    description: >-
      Link to resources hosted outside your community so they appear alongside
      your content
  - name: Rest Hooks
    description: >-
      Subscribe a URL to events in your community, so you are told when they
      happen
paths:
  /api/v1/groups:
    post:
      tags:
        - Groups
      summary: Create a group
      description: >-
        Creates a group in the community. The group type decides whether people
        or organisations can join it, and the user type decides the level of
        access its members have
      operationId: createGroup
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupCreateRequest'
            examples:
              new_group:
                summary: A group of people with student access
                value:
                  group:
                    name: Engineering
                    group_type: Person
                    user_type: Student
        required: true
        description: Group payload wrapped in a group object
      responses:
        '200':
          description: The group was created
          content:
            application/json:
              examples:
                example:
                  value:
                    group:
                      name: Engineering
                      group_type: Person
                      user_type: Student
                      uuid: 3f1c1c64-1d7e-4b0f-8f6a-0c1d2e3f4a5b
              schema:
                type: object
                properties:
                  group:
                    $ref: '#/components/schemas/Group'
                required:
                  - group
        '401':
          description: >-
            The API key is missing or invalid. The response body is the text
            `HTTP Token: Access denied.`
        '422':
          description: The request failed validation
          content:
            application/json:
              examples:
                error:
                  value:
                    errors:
                      name:
                        - can't be blank
                      group_type:
                        - 'must be one of: Person/Organisation'
                      user_type:
                        - 'must be one of: Admin/Student'
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      name:
                        type: array
                        items:
                          type: string
                        example:
                          - can't be blank
                      group_type:
                        type: array
                        items:
                          type: string
                        example:
                          - 'must be one of: Person/Organisation'
                      user_type:
                        type: array
                        items:
                          type: string
                        example:
                          - 'must be one of: Admin/Student'
                required:
                  - errors
      security:
        - tokenAuth: []
components:
  schemas:
    GroupCreateRequest:
      type: object
      properties:
        group:
          type: object
          properties:
            name:
              type: string
              example: Engineering
            group_type:
              type: string
              enum:
                - Person
                - Organisation
              example: Person
              description: Whether the members of the group are people or organisations
            user_type:
              type: string
              enum:
                - Admin
                - Student
              example: Student
              description: The level of access the members of the group have
          required:
            - name
            - group_type
            - user_type
      required:
        - group
    Group:
      type: object
      properties:
        name:
          type: string
          example: Engineering
        group_type:
          type: string
          enum:
            - Person
            - Organisation
          example: Person
          description: Whether the members of the group are people or organisations
        user_type:
          type: string
          enum:
            - Admin
            - Student
          example: Student
          description: The level of access the members of the group have
        uuid:
          type: string
          example: 3f1c1c64-1d7e-4b0f-8f6a-0c1d2e3f4a5b
      required:
        - name
        - group_type
        - user_type
        - uuid
  securitySchemes:
    tokenAuth:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        API authentication using your community API secret. The value below is
        sent as the Authorization header verbatim, so paste the whole header
        value including the prefix: Token token=<api-key>
      x-default: Token token=<api-key>

````

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