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

# Create a user

> Create a new user in the database.<br />Only available for self-hosted Formbricks.



## OpenAPI

````yaml /api-v2-reference/openapi.yml post /organizations/{organizationId}/users
openapi: 3.1.0
info:
  title: Formbricks API
  description: Manage Formbricks resources programmatically.
  version: 2.0.0
servers:
  - url: https://app.formbricks.com/api/v2
    description: Formbricks Cloud
security:
  - apiKeyAuth: []
tags:
  - name: Health
    description: Operations for checking critical application dependencies health status.
  - name: Roles
    description: Operations for managing roles.
  - name: Me
    description: Operations for managing your API key.
  - name: Management API - Responses
    description: Operations for managing responses.
  - name: Management API - Contacts
    description: Operations for managing contacts.
  - name: Management API - Contact Attributes
    description: Operations for managing contact attributes.
  - name: Management API - Contact Attribute Keys
    description: Operations for managing contact attribute keys.
  - name: Management API - Surveys
    description: Operations for managing surveys.
  - name: Management API - Surveys - Contact Links
    description: Operations for generating personalized survey links for contacts.
  - name: Management API - Webhooks
    description: Operations for managing webhooks.
  - name: Organizations API - Teams
    description: Operations for managing teams.
  - name: Organizations API - Project Teams
    description: Operations for managing project teams.
  - name: Organizations API - Users
    description: Operations for managing users.
paths:
  /organizations/{organizationId}/users:
    post:
      tags:
        - Organizations API - Users
      summary: Create a user
      description: >-
        Create a new user in the database.<br />Only available for self-hosted
        Formbricks.
      operationId: createUser
      parameters:
        - in: path
          name: organizationId
          description: The ID of the organization
          schema:
            $ref: '#/components/schemas/organizationId'
          required: true
      requestBody:
        required: true
        description: The user to create
        content:
          application/json:
            schema:
              type: object
              properties:
                isActive:
                  type: boolean
                  description: Whether the user is active
                  example: true
                name:
                  type: string
                  pattern: ^[\p{L}\p{M}\s'\d-]+$
                  minLength: 1
                  description: The name of the user
                  example: John Doe
                email:
                  type: string
                  format: email
                  maxLength: 255
                  description: The email of the user
                  example: example@example.com
                role:
                  type: string
                  enum:
                    - owner
                    - manager
                    - member
                  description: The role of the user in the organization
                  example: member
                teams:
                  type: array
                  items:
                    type: string
                  description: The list of teams the user is a member of
                  example:
                    - team1
                    - team2
              required:
                - name
                - email
                - role
      responses:
        '201':
          description: User created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The ID of the user
                  createdAt:
                    type: string
                    description: The date and time the user was created
                    example: '2021-01-01T00:00:00.000Z'
                  updatedAt:
                    type: string
                    description: The date and time the user was last updated
                    example: '2021-01-01T00:00:00.000Z'
                  lastLoginAt:
                    type: string
                    description: The date and time the user last logged in
                    example: '2021-01-01T00:00:00.000Z'
                  isActive:
                    type: boolean
                    description: Whether the user is active
                    example: true
                  name:
                    type: string
                    pattern: ^[\p{L}\p{M}\s'\d-]+$
                    minLength: 1
                    description: The name of the user
                    example: John Doe
                  email:
                    type: string
                    format: email
                    maxLength: 255
                    description: The email of the user
                    example: example@example.com
                  role:
                    type: string
                    enum:
                      - owner
                      - manager
                      - member
                    description: The role of the user in the organization
                    example: member
                  teams:
                    type: array
                    items:
                      type: string
                    description: The list of teams the user is a member of
                    example:
                      - team1
                      - team2
components:
  schemas:
    organizationId:
      type: string
      description: The ID of the organization
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Use your Formbricks x-api-key to authenticate.

````