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

# Create a Group

This endpoint allows you to upsert new or existing Groups. If the group already exists, it will be updated with the new data.
Any property left unchanged will not be modified. Changes to tracking events are append-only.


## OpenAPI

````yaml post /v1/public/groups
openapi: 3.0.0
info:
  title: Frigade API
  description: Official Frigade API documentation
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/public/groups:
    post:
      tags:
        - groups
      summary: Adds a new property or events for a given group group
      operationId: UserGroupsController_post
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddPropertyOrEventsToUserGroupDTO'
      responses:
        '201':
          description: The group has been successfully created or updated
      security:
        - bearer: []
components:
  schemas:
    AddPropertyOrEventsToUserGroupDTO:
      type: object
      properties:
        userId:
          type: string
          description: The ID of the user as defined in your own application
          example: d34daa11-3745-4ac0-880e-d4b4d51fe13f
        groupId:
          type: string
          description: The ID of the group as defined in your own application
          example: x34daa11-3745-4ac0-880e-d4b4d51fe13f
        properties:
          type: object
          description: Optional properties to add to the group
          example:
            name: Acme Inc.
            companyUrl: https://example.com
            logoUrl: https://example.com/logo.jpg
        events:
          description: Optional tracking events to add to the group
          example:
            - event: SignedUp
              properties:
                source: landing-page
                campaign: summer-sale
          type: array
          items:
            $ref: '#/components/schemas/ExternalizedTrackingEvent'
      required:
        - groupId
    ExternalizedTrackingEvent:
      type: object
      properties:
        event:
          type: string
          description: The name of the tracking event
          example: SignedUp
        properties:
          type: object
          description: The properties of the tracking event
          example:
            source: landing-page
            campaign: summer-sale
      required:
        - event
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        Authentication header of the form `Bearer: <token>`, where `<token>` is
        either your public or private API key. [See when to use
        which](/v2/api-reference/authorization)

````