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

# Create a new agent

> Create a new agent with full configuration options including personality, formatting, policies, and memory settings.



## OpenAPI

````yaml /deploy/api/openapi.json post /api/v2/appuid/{appUid}/agents
openapi: 3.0.1
info:
  title: Mindset API Gateway
  version: 1.2.0
servers:
  - url: https://a.api.mindset.ai
  - url: https://b.api.mindset.ai
  - url: https://c.api.mindset.ai
  - url: https://d.api.mindset.ai
security: []
tags:
  - name: Agent Configuration
  - name: Agent Sessions
  - name: AppStatus
  - name: Context Files
  - name: Contexts
  - name: DynamicComponents
  - name: Labels
  - name: SDK Users
  - name: Threads
  - name: Webhooks
  - name: Agent Management (deprecated)
paths:
  /api/v2/appuid/{appUid}/agents:
    post:
      tags:
        - Agent Configuration
      summary: Create a new agent
      description: >-
        Create a new agent with full configuration options including
        personality, formatting, policies, and memory settings.
      operationId: createAgentV2
      parameters:
        - name: appUid
          in: path
          description: Your application's uid
          required: true
          schema:
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              required:
                - agentName
                - agentPurpose
              type: object
              properties:
                agentName:
                  maxLength: 50
                  minLength: 1
                  type: string
                  description: Name of the agent
                agentPurpose:
                  maxLength: 1000
                  minLength: 1
                  type: string
                  description: Purpose of the agent
                templateAgentUid:
                  type: string
                  description: >-
                    UID of an existing agent to use as a template for sources
                    presentation options (citations, references etc)
                personality:
                  $ref: '#/components/schemas/PersonalityObject'
                formatting:
                  $ref: '#/components/schemas/FormattingObject'
                policies:
                  $ref: '#/components/schemas/PoliciesObject'
                additionalPolicyRules:
                  maxLength: 500
                  type: string
                  description: Additional free-form policy rules
                additionalInformation:
                  maxLength: 65535
                  type: string
                  description: Additional context information for the agent
                iceBreakerMessage:
                  maxLength: 1000
                  type: string
                  description: >-
                    Invisible instruction to prompt the agent to greet users in
                    a specific way
                memory:
                  $ref: '#/components/schemas/MemoryObject'
                options:
                  $ref: '#/components/schemas/SDK3OptionsObject'
                live:
                  type: boolean
                  description: Agent is active and live for end users
                  default: false
                showPromptLibrary:
                  type: boolean
                  description: Show prompt library in SDK UI
                  default: false
                contextUids:
                  maxItems: 30
                  type: array
                  description: Array of existing context UIDs (max 30)
                  items:
                    type: string
                mcpserverUids:
                  maxItems: 5
                  type: array
                  description: Array of existing MCP server UIDs (max 5)
                  items:
                    type: string
                planUids:
                  maxItems: 20
                  type: array
                  description: Array of existing plan UIDs (max 20)
                  items:
                    type: string
                skillUids:
                  maxItems: 20
                  type: array
                  description: Array of existing skill UIDs (max 20)
                  items:
                    type: string
                tags:
                  maxItems: 10
                  type: array
                  description: Array of tags (max 10)
                  items:
                    maxLength: 60
                    minLength: 1
                    type: string
                access:
                  type: string
                  description: Access control mode for this agent
                  default: restrictedAccess
                  enum:
                    - openAccess
                    - restrictedAccess
                externalTenantId:
                  maxLength: 100
                  type: string
                  description: >-
                    External tenant identifier (alphanumeric, underscore, hyphen
                    only)
        required: true
      responses:
        '201':
          description: Agent created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponse'
        '400':
          description: Bad Request - Invalid input
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found - Template agent does not exist
          content: {}
        '422':
          description: Unprocessable Entity - Validation error
          content: {}
        '500':
          description: Internal Server Error
          content: {}
      security:
        - APIKeyHeader: []
components:
  schemas:
    PersonalityObject:
      type: object
      properties:
        preset:
          type: string
          description: >-
            Personality preset. Use 'custom' to provide your own personality
            text.
          default: friendly
          enum:
            - friendly
            - professional
            - analytical
            - strict
            - custom
        customText:
          maxLength: 500
          minLength: 1
          type: string
          description: >-
            Custom personality text (required if preset is 'custom', ignored
            otherwise)
      description: Agent personality configuration
    FormattingObject:
      type: object
      properties:
        preset:
          type: string
          description: >-
            Formatting preset. Use 'custom' to provide your own formatting
            instructions.
          default: conversational
          enum:
            - conversational
            - structured
            - storytelling
            - technical
            - custom
        customText:
          maxLength: 500
          minLength: 1
          type: string
          description: >-
            Custom formatting text (required if preset is 'custom', ignored
            otherwise)
      description: Agent response formatting configuration
    PoliciesObject:
      type: object
      properties:
        focusAndScope:
          $ref: '#/components/schemas/FocusAndScopePolicy'
        knowledgeLimits:
          $ref: '#/components/schemas/KnowledgeLimitsPolicy'
        nonContextSegmentMessage:
          $ref: '#/components/schemas/NonContextSegmentMessagePolicy'
        clarification:
          $ref: '#/components/schemas/ClarificationPolicy'
        recommendations:
          $ref: '#/components/schemas/RecommendationsPolicy'
        neutrality:
          $ref: '#/components/schemas/NeutralityPolicy'
        professionalConduct:
          $ref: '#/components/schemas/ProfessionalConductPolicy'
        legalFinancial:
          $ref: '#/components/schemas/LegalFinancialPolicy'
        safeguarding:
          $ref: '#/components/schemas/SafeguardingPolicy'
        feedback:
          $ref: '#/components/schemas/FeedbackPolicy'
      description: Agent policy configuration with 10 toggleable policies
    MemoryObject:
      type: object
      properties:
        allowAccess:
          type: boolean
          description: Allow agent to access memory
          default: false
        allowContribution:
          type: boolean
          description: Allow agent to contribute to memory
          default: false
        miningGuidance:
          maxLength: 500
          type: string
          description: Guidance for memory mining
      description: >-
        Agent memory configuration. Note: Memory access must be enabled at the
        app level for these settings to take effect.
    SDK3OptionsObject:
      type: object
      properties:
        showSourceContent:
          type: boolean
          description: >-
            Show segments and files from knowledge contexts that informed the
            response
          default: false
        sourceDisplayStyle:
          type: string
          description: >-
            How sources are displayed. 'compact' = expandable list, 'card' =
            carousel
          default: compact
          enum:
            - compact
            - card
        sourceCardType:
          type: string
          description: >-
            What to show as cards in carousel. Only present when
            sourceDisplayStyle is 'card'
          default: segments
          enum:
            - segments
            - files
        showSpeakers:
          type: boolean
          description: Show speaker names from audio and video files
          default: false
        showFollowUpQuestions:
          type: boolean
          description: Show AI-generated follow-up questions based on source topics
          default: false
        showCitations:
          type: boolean
          description: Show citations within response linking to sources
          default: false
        showQuickReplies:
          type: boolean
          description: Display clickable buttons when agent suggests options
          default: true
      description: >-
        SDK3 display options. Only present for apps with SDK3 enabled
        (labsSDKV3Beta: true).
    AgentResponse:
      type: object
      properties:
        uid:
          type: string
          description: Unique ID of the agent
        agentName:
          type: string
          description: Name of the agent
        agentPurpose:
          type: string
          description: Purpose of the agent
        personality:
          $ref: '#/components/schemas/PersonalityObject'
        formatting:
          $ref: '#/components/schemas/FormattingObject'
        policies:
          $ref: '#/components/schemas/PoliciesObject'
        additionalPolicyRules:
          type: string
          description: Additional free-form policy rules
        additionalInformation:
          type: string
          description: Additional context information for the agent
        iceBreakerMessage:
          type: string
          description: >-
            Invisible instruction to prompt the agent to greet users in a
            specific way
        memory:
          $ref: '#/components/schemas/MemoryObject'
        options:
          $ref: '#/components/schemas/SDK3OptionsObject'
        live:
          type: boolean
          description: Agent is active and live for end users
        showPromptLibrary:
          type: boolean
          description: Show prompt library in SDK UI
        contextUids:
          type: array
          description: Array of context UIDs
          items:
            type: string
        mcpserverUids:
          type: array
          description: Array of MCP server UIDs
          items:
            type: string
        planUids:
          maxItems: 20
          type: array
          description: Array of plan UIDs (max 20)
          items:
            type: string
        skillUids:
          maxItems: 20
          type: array
          description: Array of skill UIDs (max 20)
          items:
            type: string
        tags:
          type: array
          description: Array of tags
          items:
            type: string
        access:
          type: string
          description: Access control mode
          enum:
            - openAccess
            - restrictedAccess
        externalTenantId:
          type: string
          description: External tenant identifier
        createdAt:
          type: string
          description: Creation timestamp (ISO 8601)
          format: date-time
    FocusAndScopePolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
        scope:
          maxLength: 65535
          type: string
          description: >-
            The scope of topics the agent should focus on (required when
            enabled)
      description: Focus and Scope policy - restricts agent to specific topics
    KnowledgeLimitsPolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
        themeSpecificAllowance:
          maxLength: 65535
          type: string
          description: Themes the agent can discuss when out of context (optional)
      description: Knowledge Limits and Apologies policy - handles out-of-context queries
    NonContextSegmentMessagePolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
        message:
          maxLength: 65535
          type: string
          description: Message to display for non-context segments (required when enabled)
      description: >-
        Non-Context Segment Message policy - custom message for out-of-context
        responses
    ClarificationPolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
      description: >-
        Clarification and User Understanding policy - helps users understand
        responses better
    RecommendationsPolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
      description: >-
        Recommendations and Examples policy - provides suggestions and examples
        in responses
    NeutralityPolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
      description: Neutrality policy - uses gender-neutral speaker references
    ProfessionalConductPolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
      description: >-
        Professional Conduct and Bias policy - maintains professional tone and
        avoids bias
    LegalFinancialPolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
      description: >-
        Avoid Legal and Financial Advice policy - prevents giving legal or
        financial guidance
    SafeguardingPolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
        email:
          maxLength: 65535
          type: string
          description: Contact email for safeguarding issues (required when enabled)
          format: email
      description: Safeguarding policy - handles sensitive/mental health disclosures
    FeedbackPolicy:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
      description: Feedback Encouragement policy - encourages users to provide feedback
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: x-api-key
      in: header

````