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

# Create new user (CLI/SDK)

> Creates a new user via CLI/SDK.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/runtime/users
openapi: 3.0.0
info:
  title: Runflow Runtime API
  description: >-
    Programmatic surface for the Runflow platform — used by the SDK, the CLI,
    the execution engine, and any server-to-server caller. Authenticate with an
    `x-api-key` header (or `Authorization: Bearer ...`).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.runflow.ai
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags: []
paths:
  /api/v1/runtime/users:
    post:
      tags:
        - Runtime API - Users Management
      summary: Create new user (CLI/SDK)
      description: Creates a new user via CLI/SDK.
      operationId: RuntimeUsersController_createUser
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserDto'
      responses:
        '201':
          description: User created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponseDto'
      security:
        - bearer: []
components:
  schemas:
    CreateUserDto:
      type: object
      properties:
        email:
          type: string
          description: User email address
          example: john.doe@acme.com
          format: email
        phone:
          type: string
          description: User phone number
          example: '+5511999999999'
        name:
          type: string
          description: User full name
          example: John Doe
          minLength: 2
          maxLength: 100
        password:
          type: string
          description: User password (for local authentication)
          example: SecurePassword123!
          minLength: 8
          maxLength: 100
        role:
          type: string
          description: User role within the tenant
          enum:
            - ADMIN
            - USER
            - VIEWER
            - SUPER_ADMIN
            - HUB_USER
          example: USER
          default: USER
        avatarUrl:
          type: string
          description: User avatar URL
          example: https://example.com/avatar.jpg
          maxLength: 500
      required:
        - email
        - name
    UserResponseDto:
      type: object
      properties:
        id:
          type: string
          description: User unique identifier
          example: 123e4567-e89b-12d3-a456-426614174000
        email:
          type: string
          description: User email address
          example: john.doe@acme.com
        phone:
          type: string
          description: User phone number
          example: '+5511999999999'
        name:
          type: string
          description: User full name
          example: John Doe
        role:
          type: string
          description: User role within the tenant
          enum:
            - ADMIN
            - USER
            - VIEWER
            - SUPER_ADMIN
            - HUB_USER
          example: USER
        avatarUrl:
          type: string
          description: User avatar URL
          example: https://example.com/avatar.jpg
        isActive:
          type: boolean
          description: Whether the user is active
          example: true
        lastLoginAt:
          format: date-time
          type: string
          description: User last login timestamp
          example: '2025-01-01T00:00:00.000Z'
        createdAt:
          format: date-time
          type: string
          description: Creation timestamp
          example: '2025-01-01T00:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: Last update timestamp
          example: '2025-01-01T00:00:00.000Z'
        tenantId:
          type: string
          description: Tenant ID that the user belongs to
          example: 123e4567-e89b-12d3-a456-426614174000
        metadata:
          type: object
          description: User metadata (Auth0 integration data)
          example:
            auth0_user_id: auth0|1234567890
            auth0_created: true
            invite_sent: false
        _count:
          type: object
          description: User related statistics
          example:
            agents: 3
            credentials: 5
            executions: 12
      required:
        - id
        - email
        - name
        - role
        - isActive
        - lastLoginAt
        - createdAt
        - updatedAt
        - tenantId

````