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

# Invite a person

> A new person in the Console.



## OpenAPI

````yaml openapi/en/control.json POST /v1/users
openapi: 3.1.0
info:
  title: Niadra control API
  version: '1'
  description: >-
    Tenants, projects, sources, keys, people, configuration and usage. It never
    receives customer content.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/users:
    post:
      summary: Invite a person
      description: >-
        Creates a person with their role bindings. With `with_totp`, the answer
        carries `totp_uri` once, for enrollment in an authenticator app. Needs
        the admin role.


        **Authentication.** Person token issued by the control plane
        (`Authorization: Bearer <JWT>`), with the role the operation needs.
      operationId: create_user_v1_users_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserCreate'
            example:
              email: rui@acme.example
              password: a-long-passphrase-2026
              roles:
                - role: security
              with_totp: true
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserOut'
              example:
                user_id: 0192f0a0-4e5f-7061-9c72-8d9e0f1a2b35
                email: rui@acme.example
                active: true
                last_login_at: null
                roles:
                  - role: security
                    space_id: null
                    source_ids: []
                totp_uri: >-
                  otpauth://totp/Niadra:rui%40acme.example?secret=JBSWY3DPEHPK3PXP&issuer=Niadra
          description: >-
            The person, with the enrollment URI when a second factor was
            requested.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - personToken: []
components:
  schemas:
    UserCreate:
      additionalProperties: false
      properties:
        email:
          maxLength: 320
          minLength: 3
          title: Email
          type: string
        password:
          maxLength: 1024
          minLength: 12
          title: Password
          type: string
          description: At least 12 characters.
        roles:
          items:
            $ref: '#/components/schemas/BindingIn'
          maxItems: 32
          minItems: 1
          title: Roles
          type: array
        with_totp:
          default: true
          title: With Totp
          type: boolean
          description: Create a TOTP secret and return its enrollment URI once.
      required:
        - email
        - password
        - roles
      title: UserCreate
      type: object
    UserOut:
      additionalProperties: false
      properties:
        active:
          title: Active
          type: boolean
        email:
          title: Email
          type: string
        last_login_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Login At
        roles:
          items:
            $ref: '#/components/schemas/BindingOut'
          title: Roles
          type: array
        totp_uri:
          anyOf:
            - type: string
            - type: 'null'
          description: Shown once, at creation, for enrollment.
          title: Totp Uri
        user_id:
          format: uuid
          title: User Id
          type: string
      required:
        - user_id
        - email
        - active
        - roles
      title: UserOut
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    BindingIn:
      additionalProperties: false
      properties:
        role:
          $ref: '#/components/schemas/Role'
        source_ids:
          items:
            format: uuid
            type: string
          title: Source Ids
          type: array
          description: 'For the vendor role: the sources this person may see.'
        space_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Space Id
          description: >-
            The role holds on this space only. Empty means every space of the
            tenant.
      required:
        - role
      title: BindingIn
      type: object
    BindingOut:
      additionalProperties: false
      properties:
        role:
          $ref: '#/components/schemas/Role'
        source_ids:
          items:
            format: uuid
            type: string
          title: Source Ids
          type: array
        space_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Space Id
      required:
        - role
        - space_id
        - source_ids
      title: BindingOut
      type: object
    Role:
      description: Console roles, combinable.
      enum:
        - admin
        - security
        - integration
        - review
        - analysis
        - vendor
      title: Role
      type: string
  securitySchemes:
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````