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

# Onboard a user in the authenticated tenant.

> Creates or resolves a user by email and/or username. At least one of email or username must be provided. Behavior varies by combination — see 409 responses for conflict scenarios.



## OpenAPI

````yaml products/didx-me/api-reference/v1/consumer-onboarding.json post /users
openapi: 3.0.0
info:
  version: 1.0.0
  title: Consumer Onboarding API
  description: |2-

          
    OpenAPI documentation for Consumer Onboarding API

          
          
     - [JSON - OpenAPI Specification](/consumer-onboarding/api/openapi.json)
servers:
  - url: https://test.didxtech.com/consumer-onboarding/api
security:
  - bearerAuth: []
paths:
  /users:
    post:
      tags:
        - users
      summary: Onboard a user in the authenticated tenant.
      description: >-
        Creates or resolves a user by email and/or username. At least one of
        email or username must be provided. Behavior varies by combination — see
        409 responses for conflict scenarios.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserRequest'
      responses:
        '201':
          description: User onboarded successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateUserApiResponse'
        '400':
          description: >-
            Bad request. Validation failed (e.g. neither email nor username
            provided, invalid email format).
        '401':
          description: Unauthorized. Invalid or missing token.
        '409':
          description: >-
            Conflict. Username taken by another org, email/username belong to
            different users, or other conflict scenarios.
      security:
        - bearerAuth: []
components:
  schemas:
    CreateUserRequest:
      type: object
      properties:
        email:
          type: string
          format: email
        username:
          type: string
          minLength: 1
          pattern: ^[a-zA-Z0-9._-]+$
        firstName:
          type: string
        lastName:
          type: string
        externalIdentifier:
          type: string
          minLength: 1
      description: At least one of email or username must be provided.
      example:
        email: user@example.com
        username: johndoe
        firstName: John
        lastName: Doe
        externalIdentifier: PARTNER-ID-12345
    CreateUserApiResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CreateUserResponse'
        links:
          $ref: '#/components/schemas/ApiLinks'
        meta:
          $ref: '#/components/schemas/ApiMeta'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
      required:
        - data
    CreateUserResponse:
      type: object
      properties:
        email:
          type: string
          format: email
        username:
          type: string
        tempPassword:
          type: string
      required:
        - tempPassword
      example:
        email: user@example.com
        tempPassword: Test@12345
    ApiLinks:
      type: object
      properties:
        self:
          type: string
          format: uri
        first:
          type: string
          format: uri
        last:
          type: string
          format: uri
        prev:
          type: string
          format: uri
        next:
          type: string
          format: uri
        related:
          type: string
          format: uri
    ApiMeta:
      type: object
      additionalProperties:
        nullable: true
    ApiError:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              type: string
            parameter:
              type: string
        meta:
          type: object
          additionalProperties:
            nullable: true
      required:
        - detail
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````