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

# Create Protocol Group

> Create a protocol group in a project.

Parameters
----------
body : CreateProtocolGroupBody
    Group creation data.

Returns
-------
ProtocolGroup
    The created group.

Raises
------
ConflictError
    If the project already has a group with this name (case-insensitive).
AppError
    If the insert returns no row.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /protocol_groups
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /protocol_groups:
    post:
      tags:
        - protocol_groups
      summary: Create Protocol Group
      description: |-
        Create a protocol group in a project.

        Parameters
        ----------
        body : CreateProtocolGroupBody
            Group creation data.

        Returns
        -------
        ProtocolGroup
            The created group.

        Raises
        ------
        ConflictError
            If the project already has a group with this name (case-insensitive).
        AppError
            If the insert returns no row.
      operationId: create_protocol_group_protocol_groups_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProtocolGroupBody'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProtocolGroup'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateProtocolGroupBody:
      properties:
        name:
          type: string
          title: Name
          description: Name of the group, unique within the project
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description
        project_id:
          type: string
          title: Project Id
          description: Project that will own the group
      type: object
      required:
        - name
        - project_id
      title: CreateProtocolGroupBody
      description: Request body for creating a protocol group.
    ProtocolGroup:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the group
        name:
          type: string
          title: Name
          description: Name of the group, unique within the project
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional note on what relates the protocols in this group
        organization_id:
          type: string
          title: Organization Id
          description: ID of the organization that owns this group
        project_id:
          type: string
          title: Project Id
          description: ID of the project that owns this group
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
          description: User ID of the user who created this group
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: When the group was created
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
          description: When the group was last updated
        protocol_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Protocol Count
          description: >-
            Number of protocols in this group. Present on list responses, None
            when the group is fetched on its own.
        created_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Email
          description: Email of the user who created this group
      type: object
      required:
        - name
        - organization_id
        - project_id
      title: ProtocolGroup
      description: Database entity for a protocol group.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````