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

# Create Tenant User

> Creates a new Tenant User. This creates the user and sends him an email with a registration code. The user is created without any permissions.

#### Authentication

❌ Organization User (`CustomerEmployee`)\
❌ Delegated User (`EndUser`)\
❌ Service Account

#### Required Permissions

`Tenant:Users:Create`: Always required.


## OpenAPI

````yaml /openapi.yaml post /tenant/users
openapi: 3.1.0
info:
  version: 2.0.249
  title: Dfns
servers:
  - url: https://api.dfns.io
    description: Default - Europe
  - url: https://api.uae.dfns.io
    description: UAE
  - url: https://api.dfns.ninja
    description: <Deprecated> Staging
security: []
paths:
  /tenant/users:
    post:
      tags:
        - Tenant
      summary: Create Tenant User
      description: >-
        Creates a new Tenant User. This creates the user and sends him an email
        with a registration code. The user is created without any permissions.
      operationId: createTenantUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  description: The email address of the new user.
                externalId:
                  type: string
                  description: >-
                    Value that can be used to correlate the entity with an
                    external system.
                isSSORequired:
                  type: boolean
                  default: false
                  description: If set to true, the user will have to authenticate via SSO
              required:
                - email
              additionalProperties: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TenantUser'
      security:
        - authenticationToken: []
          userActionSignature: []
components:
  schemas:
    TenantUser:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^us-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
          description: User id.
          example: us-6b58p-r53sr-rlrd3l5cj3uc4ome
        kind:
          type: string
          enum:
            - TenantUser
        username:
          type: string
        isRegistered:
          type: boolean
        isActive:
          type: boolean
        isSSORequired:
          type: boolean
        externalId:
          type: string
        permissions:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              operations:
                type: array
                items:
                  type: string
            required:
              - id
              - name
              - operations
        orgs:
          type: array
          items:
            type: object
            properties:
              orgId:
                type: string
              name:
                type: string
            required:
              - orgId
              - name
          description: orgs this user has access to
      required:
        - id
        - kind
        - username
        - isRegistered
        - isActive
        - isSSORequired
        - permissions
        - orgs
  securitySchemes:
    authenticationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        **Bearer Token:** Used to authenticate API requests.

        More details how to generate the token: [Authentication
        flows](https://docs.dfns.co/api-reference/auth/login-flows)
    userActionSignature:
      type: apiKey
      in: header
      name: X-DFNS-USERACTION
      description: >-
        **User Action Signature:** Used to sign the change-inducing API
        requests.

        More details how to generate the token: [User Action Signing
        flows](https://docs.dfns.co/api-reference/auth/signing-flows)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.