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

# POST /api/public/apps/group

> The group call lets you assign or unassign a user to a group, along with optionally adding traits to the group.



## OpenAPI

````yaml post /api/public/apps/group
openapi: 3.1.0
info:
  title: Dittofeed API
  description: Dittofeed API Swagger Documentation
  version: 0.0.1
servers: []
security: []
paths:
  /api/public/apps/group:
    post:
      tags:
        - Public Apps
      description: >-
        The group call lets you assign or unassign a user to a group, along with
        optionally adding traits to the group.
      parameters:
        - schema:
            type: string
          example: >-
            Basic
            YzQ2MDllYjMtYTE2OC00MGI5LWI1ZWMtYTdiYTFkYzY2NWYwOjI5NGYwYjkyOTI1YWZhNzM=
          in: header
          name: authorization
          required: true
          description: >-
            Authorization header for the request, in the format `Bearer
            <token>`. Find your token at
            https://app.dittofeed.com/dashboard/settings#write-key.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    messageId:
                      description: >-
                        Unique identifier for the message, used as an
                        idempotency key for safe retries. Can provide a UUID.
                      examples:
                        - 23d04926-78e5-4ebc-853f-f26c84ff629e
                      type: string
                    timestamp:
                      description: >-
                        ISO 8601 formatted timestamp of when the event occurred.
                        If not provided, the current server time will be used.
                      examples:
                        - '2024-04-22T07:00:00.000Z'
                      type: string
                    groupId:
                      type: string
                    assigned:
                      type: boolean
                    traits:
                      description: Traits of the group.
                      type: object
                      additionalProperties: {}
                    context:
                      description: >-
                        Provides metadata about the user submitting the event
                        and the context in which the event occurred.
                      examples:
                        - ip: 192.0.2.1
                      type: object
                      additionalProperties: {}
                    userId:
                      description: >-
                        Unique identifier for the user. Should be the id of the
                        user in your system. Only applicable to logged in users.
                      examples:
                        - '1043'
                        - user-123
                        - 0a58e5e4-c753-477e-a6c4-f9b0e3396b9b
                      type: string
                  required:
                    - messageId
                    - groupId
                    - userId
                - type: object
                  properties:
                    messageId:
                      description: >-
                        Unique identifier for the message, used as an
                        idempotency key for safe retries. Can provide a UUID.
                      examples:
                        - 23d04926-78e5-4ebc-853f-f26c84ff629e
                      type: string
                    timestamp:
                      description: >-
                        ISO 8601 formatted timestamp of when the event occurred.
                        If not provided, the current server time will be used.
                      examples:
                        - '2024-04-22T07:00:00.000Z'
                      type: string
                    groupId:
                      type: string
                    assigned:
                      type: boolean
                    traits:
                      description: Traits of the group.
                      type: object
                      additionalProperties: {}
                    context:
                      description: >-
                        Provides metadata about the user submitting the event
                        and the context in which the event occurred.
                      examples:
                        - ip: 192.0.2.1
                      type: object
                      additionalProperties: {}
                    anonymousId:
                      description: >-
                        Identifier for a logged out user. It can be any
                        pseudo-unique identifier, for example a session Id or a
                        UUID.
                      examples:
                        - 0a58e5e4-c753-477e-a6c4-f9b0e3396b9b
                        - session-123
                      type: string
                  required:
                    - messageId
                    - groupId
                    - anonymousId
      responses:
        '200':
          description: Default Response
      security:
        - publicWriteKey: []
components:
  securitySchemes:
    publicWriteKey:
      type: apiKey
      description: >-
        Authorization header for the request, in the format `Bearer <token>`.
        Find your token at
        https://app.dittofeed.com/dashboard/settings#write-key.
      name: PublicWriteKey
      in: header

````