> ## Documentation Index
> Fetch the complete documentation index at: https://botpress-ak-docs-20-document-updating-variables-from-outsid.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getOrCreateUser

> Get or create a new [User](#schema_user)



## OpenAPI

````yaml chat-openapi.json post /users/get-or-create
openapi: 3.0.0
info:
  title: Chat API
  description: API for the Chat Integration
  version: 0.0.0
servers:
  - url: https://chat.botpress.cloud/{webhookUrl}
    variables:
      webhookUrl:
        default: your_default_webhook_url
        description: The webhook URL
security: []
paths:
  /users/get-or-create:
    post:
      tags:
        - Endpoints
      summary: Get Or Create User
      description: Get or create a new [User](#schema_user)
      operationId: getOrCreateUser
      parameters:
        - name: x-user-key
          in: header
          description: Authentication Key
          required: true
          schema:
            type: string
      requestBody:
        description: User data
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the [User](#schema_user) (not a unique identifier)
                pictureUrl:
                  type: string
                  description: Picture url of the [User](#schema_user)
                profile:
                  type: string
                  maxLength: 1000
                  description: >-
                    Custom profile data of the [User](#schema_user) encoded as a
                    string
              title: getOrCreateUserBody
              additionalProperties: false
      responses:
        '201':
          description: Returns a [User](#schema_user)
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Identifier of the [User](#schema_user)
                      name:
                        type: string
                        description: Name of the [User](#schema_user)
                      pictureUrl:
                        type: string
                        description: Picture url of the [User](#schema_user)
                      profile:
                        type: string
                        description: >-
                          Custom profile data of the [User](#schema_user)
                          encoded as a string
                      createdAt:
                        type: string
                        format: date-time
                        description: >-
                          Creation date of the [User](#schema_user) in ISO 8601
                          format
                      updatedAt:
                        type: string
                        format: date-time
                        description: >-
                          Updating date of the [User](#schema_user) in ISO 8601
                          format
                    required:
                      - id
                      - createdAt
                      - updatedAt
                    description: >-
                      The user object represents someone interacting with the
                      bot within a specific integration. The same person
                      interacting with a bot in slack and messenger will be
                      represented with two different users.
                    additionalProperties: false
                    x-readme-ref-name: User
                required:
                  - user
                title: getOrCreateUserResponse
                additionalProperties: false
        default:
          description: Returns a [User](#schema_user)
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Identifier of the [User](#schema_user)
                      name:
                        type: string
                        description: Name of the [User](#schema_user)
                      pictureUrl:
                        type: string
                        description: Picture url of the [User](#schema_user)
                      profile:
                        type: string
                        description: >-
                          Custom profile data of the [User](#schema_user)
                          encoded as a string
                      createdAt:
                        type: string
                        format: date-time
                        description: >-
                          Creation date of the [User](#schema_user) in ISO 8601
                          format
                      updatedAt:
                        type: string
                        format: date-time
                        description: >-
                          Updating date of the [User](#schema_user) in ISO 8601
                          format
                    required:
                      - id
                      - createdAt
                      - updatedAt
                    description: >-
                      The user object represents someone interacting with the
                      bot within a specific integration. The same person
                      interacting with a bot in slack and messenger will be
                      represented with two different users.
                    additionalProperties: false
                    x-readme-ref-name: User
                required:
                  - user
                title: getOrCreateUserResponse
                additionalProperties: false

````