> ## 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 or update a User

> Create a user, add properties, and tracking events

This endpoint allows you to upsert new or existing Users. If the user 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/users
openapi: 3.0.0
info:
  title: Frigade API
  description: Official Frigade API documentation
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/public/users:
    post:
      tags:
        - users
      description: Create a user, add properties, and tracking events
      operationId: UsersController_postPublic
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddPropertyOrEventsToUserDTO'
      responses:
        '201':
          description: The user has been successfully created or updated
      security:
        - bearer: []
components:
  schemas:
    AddPropertyOrEventsToUserDTO:
      type: object
      properties:
        userId:
          type: string
          description: The ID of the user as defined in your own application
          example: d34daa11-3745-4ac0-880e-d4b4d51fe13f
        properties:
          type: object
          description: Optional properties to add to the user
          example:
            email: john@doe.com
            firstName: John
            lastName: Doe
            imageUrl: https://example.com/john-doe.jpg
        bootstrapFlowStates:
          type: boolean
          description: >-
            If set to true, the user will automatically complete any eligible
            Flows with `completionCriteria` that have not already been
            completed. This is useful if a Flow has been recently updated with
            new steps and you want to ensure that historic users complete the
            new steps
        events:
          description: Optional tracking events to add to the user
          example:
            - event: SignedUp
              properties:
                source: landing-page
                campaign: summer-sale
          type: array
          items:
            $ref: '#/components/schemas/ExternalizedTrackingEvent'
        linkGuestId:
          type: string
          description: >-
            Merges a guest with a non-guest user. Only works if the provided
            `linkGuestId` is a guest user and the `userId` does not yet have any
            state in any Flows.
      required:
        - userId
    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)

````