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

# Add user to group

> Add a user to a group.



## OpenAPI

````yaml post /api/v1/groups/{group_id}/users
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/groups/{group_id}/users:
    post:
      tags:
        - groups
        - Groups
      summary: Add user to group
      description: Add a user to a group.
      operationId: add_user_to_group_api_v1_groups__group_id__users_post
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
            title: Group Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserGroupUpdate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
                title: Response Add User To Group Api V1 Groups  Group Id  Users Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UserGroupUpdate:
      properties:
        user_id:
          type: string
          title: User Id
          description: User ID to add/remove
      type: object
      required:
        - user_id
      title: UserGroupUpdate
      description: Schema for adding/removing users from a 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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````