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

# Create a Digital Twin

> Creates a Digital Twin with the signed-in user as its contact and administrator: the user gets an admin membership with the admin entitlements on it, it becomes their current Digital Twin, and their user account becomes an administrator account. The Digital Twin joins a customer account only when the user manages that account: the one named in `account`; without `account`, the one whose registered domain is exactly `domain`; then the account of the user's current Digital Twin; otherwise no account. The listed managers of that account get an admin membership too. It starts with 50 credits and in persona mode. Fields not listed below are ignored. Only from the user's own session. At most 5 creations per user every 10 minutes (429 beyond). When the upgrade to create Digital Twins is offered (see /api/user/twin-upgrade), only an account that can create Digital Twins may call it, and an account that upgraded itself creates at most 3 Digital Twins.




## OpenAPI

````yaml /mdx/api-reference/runtime/runtime-api.json post /api/user/institution
openapi: 3.0.0
info:
  title: Pria Runtime API
  version: 2.0.199
  description: >-
    Pria API Documentation Praxis's developer platform is a core part of our
    mission to empower organizations to grow better. Our APIs are designed to
    enable teams of any shape or size to build robust integrations that help
    them customize and get the most value out of Pria. All Pria APIs are built
    using REST conventions and designed to have a predictable URL structure.
    <br/>  <br/>They use many standard HTTP features, including methods (POST,
    GET, PUT, DELETE) and error response codes.  <br/> <br/>All API calls are
    made under https://hiimpria.ai/api and all responses return standard JSON.
    In these docs, you'll find lists of all available endpoints for a given API,
    along with interactive code blocks for building requests. For walkthroughs
    of basic usage for these APIs, check out the API guides.
servers:
  - url: https://pria.praxislxp.com
    description: Pria API Server
security: []
tags:
  - name: Authentication
    description: User authentication, registration, and password management (/api/auth)
  - name: OAuth
    description: OAuth authentication providers - Google, GitHub, SSO (/api/auth/oauth)
  - name: User
    description: User profile management and account operations (/api/user)
  - name: User Institutions
    description: User institution memberships and switching (/api/user/institution)
  - name: User Tools
    description: Available tools for authenticated users (/api/user/tools)
  - name: Institutions
    description: Institution settings and configuration (/api/user/institution)
  - name: Conversation
    description: AI conversation and Q&A endpoints (/api/ai)
  - name: Realtime
    description: Real-time voice AI and WebRTC sessions (/api/ai/rt)
  - name: Assistant
    description: AI assistant configuration and management (/api/user/assistant)
  - name: History
    description: Conversation history and favorites (/api/user/history)
  - name: RAG
    description: >-
      Document upload, embedding, and retrieval-augmented generation
      (/api/user/files, /api/user/rag)
  - name: Setting
    description: Instance variables and settings management (/api/user/setting)
  - name: Branding
    description: Digital twin branding and customization (/api/agent/branding)
  - name: Agent
    description: Agent engagement and session management (/api/agent)
  - name: SDK Launch
    description: >-
      SDK launch token signing and verification for secure iframe embedding
      (/api/auth/sdk-sign, /api/auth/sdk-verify)
  - name: Testing
    description: Health checks, diagnostics, and test endpoints (/api/test)
  - name: Admin Accounts
    description: Account management for super admins (/api/admin/account)
  - name: Admin Institutions
    description: Institution management for admins (/api/admin/institution)
  - name: Admin Users
    description: User management for admins (/api/admin/user)
  - name: Admin Entitlements
    description: >-
      User-institution relationships and permissions
      (/api/admin/userInstitution)
  - name: Admin Sessions
    description: Session management for admins (/api/admin/session)
  - name: Admin Histories
    description: Conversation history management and analytics (/api/admin/history)
  - name: Admin Assistants
    description: AI assistant management for admins (/api/admin/assistant)
  - name: Admin Questions
    description: Institution question and prompt management (/api/admin/question)
  - name: Admin Tools
    description: Tool configuration management (/api/admin/tool)
  - name: Admin AI Models
    description: AI model configuration (/api/admin/aimodel)
  - name: Admin MCP Servers
    description: Model Context Protocol server management (/api/admin/mcpserver)
  - name: Admin Feedbacks
    description: User feedback management (/api/admin/feedback)
  - name: Admin Uploads
    description: Upload management (/api/admin/upload)
  - name: Admin Charts
    description: Analytics and visualization chart management (/api/admin/chart)
  - name: Audio Notes
    description: Capture and ingest spoken notes into the personal vault
  - name: Memory
    description: User-facing memory parameters (personal + shared instance memory).
  - name: My Data
    description: >-
      GDPR controls — personal-scope counts, async ZIP-by-email export, and
      scoped soft-delete. Every endpoint pins `user = req.user._id` AND
      `institution: null`; institution-scoped data is governed by the
      institution's own retention policy and never reached from here.
  - name: Questions
    description: >-
      User-facing read of the onboarding question bank used by the "create a
      digital twin" wizard.
  - name: Transcription
    description: >-
      One-shot speech-to-text for in-place dictation. Audio blob in, transcript
      out — no Upload / History / RAG embeddings are persisted. Use
      `/audio-notes` for anything durable.
paths:
  /api/user/institution:
    post:
      tags:
        - Institutions
      summary: Create a Digital Twin
      description: >
        Creates a Digital Twin with the signed-in user as its contact and
        administrator: the user gets an admin membership with the admin
        entitlements on it, it becomes their current Digital Twin, and their
        user account becomes an administrator account. The Digital Twin joins a
        customer account only when the user manages that account: the one named
        in `account`; without `account`, the one whose registered domain is
        exactly `domain`; then the account of the user's current Digital Twin;
        otherwise no account. The listed managers of that account get an admin
        membership too. It starts with 50 credits and in persona mode. Fields
        not listed below are ignored. Only from the user's own session. At most
        5 creations per user every 10 minutes (429 beyond). When the upgrade to
        create Digital Twins is offered (see /api/user/twin-upgrade), only an
        account that can create Digital Twins may call it, and an account that
        upgraded itself creates at most 3 Digital Twins.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: >-
                    The Digital Twin's identifier, unique per minute (409 when
                    taken)
                  example: 29312345.jane.school.edu
                ainame:
                  type: string
                  description: The name the Digital Twin answers to
                  example: Ada
                picture:
                  type: string
                  description: Avatar picture URL
                picture_bg:
                  type: string
                  description: Light-mode background picture URL
                picture_dark_bg:
                  type: string
                  description: Dark-mode background picture URL
                theme:
                  type: string
                  enum:
                    - ''
                    - dark
                    - light
                  description: ''''' lets each user choose; dark or light sets it for everyone'
                prompt:
                  type: string
                  description: The Digital Twin's instructions
                allowJoining:
                  type: string
                  enum:
                    - disabled
                    - account
                    - public
                  description: Who may join the Digital Twin
                  example: disabled
                poolCredits:
                  type: boolean
                  description: Whether users spend the Digital Twin's pooled credits
                questionType:
                  type: string
                  description: The personalization question bank
                  example: PERSONA
                rtEnabled:
                  type: boolean
                  description: Enable real-time voice conversations
                rtAdminOnly:
                  type: boolean
                  description: Restrict real-time conversations to administrators
                personalisationAsked:
                  type: boolean
                  description: >-
                    Whether the personalization prompt was already answered
                    (default false)
                account:
                  type: string
                  description: >-
                    A customer account id, used only when the signed-in user
                    manages that account
                domain:
                  type: string
                  description: >-
                    A host name; the customer account whose registered domain it
                    is exactly, when the user manages that account
                  example: school.edu
      responses:
        '200':
          description: >-
            The Digital Twin created (public fields; its account as `_id` and
            `name` only)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateInstitutionResponse'
        '400':
          description: >-
            No name, a field of the wrong type, or the Digital Twin could not be
            created
        '401':
          description: The signed-in account no longer exists
        '403':
          description: >-
            Not signed in, a session acting for someone else (an impersonation
            or an agent token), an account that has not been upgraded to create
            Digital Twins, or an upgraded account that has created its 3 Digital
            Twins
        '409':
          description: >-
            The name is taken (names are generated per minute; retry a minute
            later)
        '429':
          description: Too many Digital Twins created in a short time
      security:
        - apiKeyAuth: []
components:
  schemas:
    CreateInstitutionResponse:
      type: object
      properties:
        _id:
          type: string
          description: Unique institution identifier
          example: 68793ef2a8a4a5eaff36e7ca
        name:
          type: string
          example: teacher1.domain.edu.instructure
        picture:
          type: string
          format: uri
          example: >-
            https://hiimpria.ai/uploads/6430736fd62d650040420674/Clarkey20Headshot20Animated_1752713782148.gif
        picture_bg:
          type: string
          example: ''
        picture_dark_bg:
          type: string
          example: ''
        picture_animated:
          type: string
          format: uri
          example: >-
            https://hiimpria.ai/uploads/6430736fd62d650040420674/Clarkey20Headshot20Animated_1752713782148.gif
        elevenlabs_agent_id:
          type: string
          description: ElevenLabs Agent ID for Digital Twin Voice
          example: agent_xxxxxxxxxxxxxxxxxxxx
        credits:
          type: number
          description: Total credits allocated
          example: 50
        status:
          type: string
          enum:
            - active
            - inactive
          example: active
        allowJoining:
          type: string
          enum:
            - disabled
            - account
            - public
          example: disabled
        joiningAdminOnly:
          type: boolean
          example: false
        publicId:
          type: string
          format: uuid
          description: Public identifier for the institution
          example: 2e1006ec-5b59-4431-96d2-b0e1b1022a3a
        publicAuthorizedUrls:
          type: array
          items:
            type: string
          example:
            - https://domain.edu
        ainame:
          type: string
          example: Hugo
        prompt:
          type: string
          example: ''
        contactEmail:
          type: string
          format: email
          example: jane.doe@praxis-ai.com
        creditAward:
          type: number
          example: 0
        poolCredits:
          type: boolean
          example: true
        questionType:
          type: string
          description: Personalization question bank type
          example: CORPORATE
        rtEnabled:
          type: boolean
          description: Whether real-time voice conversations are enabled
          example: false
        rtAdminOnly:
          type: boolean
          description: Whether real-time conversations are restricted to admins
          example: true
        created:
          type: string
          format: date-time
          example: '2025-07-17T18:20:34.330Z'
        id:
          type: string
          example: 68793ef2a8a4a5eaff36e7ca
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-access-token
      description: JWT token passed in x-access-token header

````

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