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

# Create User

> Create a user



## OpenAPI

````yaml POST /users/create
openapi: 3.1.0
info:
  title: duohub Retriever API
  description: >-
    Retrieve assisted or non-assisted memory from a duohub knowledge graph. For
    best performance, use the official `duohub` Python package.
  version: 1.0.0
servers:
  - url: https://api.duohub.ai
security:
  - APIKeyHeader: []
paths:
  /users/create:
    post:
      tags:
        - Users
      summary: Create User
      description: Create a user
      operationId: createUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - firstName
                - lastName
              properties:
                id:
                  type: string
                  description: >-
                    Optional unique identifier for the user. If not provided, a
                    UUID will be generated.
                firstName:
                  type: string
                  description: User's first name
                lastName:
                  type: string
                  description: User's last name
                email:
                  type: string
                  format: email
                  description: User's email address
                phone:
                  type: string
                  description: User's phone number
              example:
                firstName: John
                lastName: Doe
                email: john.doe@example.com
                phone: '+1234567890'
      responses:
        '201':
          description: User created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                    description: Response status
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Unique identifier for the user
                      firstName:
                        type: string
                        description: User's first name
                      lastName:
                        type: string
                        description: User's last name
                      email:
                        type: string
                        format: email
                        description: User's email address
                      owner:
                        type: string
                        description: Owner identifier
                      userID:
                        type: string
                        description: User identifier
                      createdAt:
                        type: string
                        format: date-time
                        description: Timestamp of user creation
                      updatedAt:
                        type: string
                        format: date-time
                        description: Timestamp of last update
                required:
                  - status
                  - data
                example:
                  status: success
                  data:
                    id: 4ac26c1c-1bbe-49d0-bf4c-77c091d75da1
                    firstName: John
                    lastName: Doe
                    email: john.doe@example.com
                    owner: d99e7428-40e1-7073-aa50-94cee086b518
                    userID: d99e7428-40e1-7073-aa50-94cee086b518
                    createdAt: '2024-11-26T00:58:03.636719Z'
                    updatedAt: '2024-11-26T00:58:03.636719Z'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - bad_request
                required:
                  - error
                  - status
                examples:
                  invalid_json:
                    value:
                      error: Invalid JSON in request body
                      status: bad_request
                  missing_required:
                    value:
                      error: firstName is required
                      status: bad_request
                  duplicate:
                    value:
                      error: User ID already exists
                      status: bad_request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - unauthorized
                required:
                  - error
                  - status
                example:
                  error: API key is required
                  status: unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - forbidden
                required:
                  - error
                  - status
                example:
                  error: Invalid API key
                  status: forbidden
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  status:
                    type: string
                    enum:
                      - error
                required:
                  - error
                  - status
                example:
                  error: Internal server error
                  status: error
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Your duohub API key. Type: str'

````