> ## 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



## OpenAPI

````yaml /deploy/api/openapi.json post /api/v1/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/v1/appuid/{appUid}/agents:
    post:
      tags:
        - Agent Management (deprecated)
      summary: Create a new agent
      operationId: createAgent
      parameters:
        - name: appUid
          in: path
          description: Your application's uid
          required: true
          schema:
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              required:
                - agentName
              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
                formatting:
                  maxLength: 500
                  minLength: 1
                  type: string
                  description: Output formatting instructions
                agentPersonality:
                  maxLength: 500
                  type: string
                  description: Personality of the agent
                agentPolicyRules:
                  maxLength: 500
                  type: string
                  description: Policy rules for the agent
                iceBreakerMessage:
                  maxLength: 1000
                  type: string
                  description: >-
                    Invisible instruction to prompt the agent to greet users in
                    a specific way or style
                live:
                  type: boolean
                  description: Agent is active and live for end users
                  default: false
                contextUids:
                  maxItems: 30
                  type: array
                  description: Array of existing context Uids (max 30)
                  items:
                    maxLength: 30
                    minLength: 1
                    type: string
                mcpserverUids:
                  maxItems: 5
                  type: array
                  description: Array of existing MCP server Uids (max 5)
                  items:
                    maxLength: 20
                    minLength: 20
                    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. Use Agent Sessions with
                    restrictedAccess agents.
                  default: restrictedAccess
                  enum:
                    - openAccess
                    - restrictedAccess
                externalTenantId:
                  maxLength: 100
                  type: string
                  description: >-
                    External tenant identifier. Valid characters are
                    A-Za-z0-9_-.
        required: true
      responses:
        '201':
          description: Agent created successfully
          content:
            application/json:
              schema:
                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
                  formatting:
                    type: string
                    description: Output formatting instructions
                  agentPersonality:
                    type: string
                    description: Personality of the agent
                  agentPolicyRules:
                    type: string
                    description: Policy rules for the agent
                  iceBreakerMessage:
                    type: string
                    description: >-
                      Invisible instruction to prompt the agent to greet users
                      in a specific way or style
                  live:
                    type: boolean
                    description: Activate the agent and make it live for end users
                    default: false
                  createdAt:
                    type: string
                    description: Creation timestamp (ISO 8601)
                    format: date-time
                  contextUids:
                    maxItems: 30
                    type: array
                    description: Array of existing context Uids (max 30)
                    items:
                      maxLength: 30
                      minLength: 1
                      type: string
                  mcpserverUids:
                    maxItems: 5
                    type: array
                    description: Array of existing MCP server Uids (max 5)
                    items:
                      maxLength: 20
                      minLength: 20
                      type: string
                  tags:
                    maxItems: 10
                    type: array
                    description: Array of tags (max 10)
                    items:
                      maxLength: 60
                      minLength: 1
                      type: string
                  access:
                    type: string
                    enum:
                      - openAccess
                      - restrictedAccess
                  externalTenantId:
                    maxLength: 100
                    type: string
                    description: External tenant identifier
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '422':
          description: Unprocessable Entity
          content: {}
        '500':
          description: Internal Server Error
          content: {}
      security:
        - APIKeyHeader: []
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      name: x-api-key
      in: header

````