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

# Create Agent

> Create an agent



## OpenAPI

````yaml https://document-assistant.us.aodocs.app/openapi.json post /assistant/api/v1/tenants/{tenant}/agents
openapi: 3.1.0
info:
  title: Document Assistant API
  description: |
    <p>
      The Document Assistant API enables developers to integrate document-based assistant
      functionalities into their applications using AODocs.
    </p>
    <p>
      The first step is to enable AIDA (AODocs Intelligent Document Assistant) in your tenant.
      The support team will provide you with the necessary information on how to get started.
    </p>
    <p>
      The second step is to enable AIDA on libraries. You need to be an administrator of the
      library to do this.<br />
      AIDA can answer questions only from those documents that are in an AIDA enabled
      library.<br />
      We create a vector store index for these documents. This can take some time. The get
      library API provides the status of the indexation and an estimate of the time
      remaining.<br />
      The content of the index is automatically kept up-to-date near real time with the
      content changes.
    </p>
    <p>
      The third step is to ask questions based on the AODocs documents.<br />
      AIDA automatically filters the results based on the user's permissions.
    </p>
    <p>
      <strong>Authentication:</strong> All API endpoints require a valid OAuth2 token in the
      Authorization header. Ensure the client ID of the OAuth2 token is whitelisted in AODocs.
    </p>
  version: 1.1.0
servers:
  - url: https://document-assistant.us.aodocs.app
    description: Production US
  - url: https://document-assistant.eu.aodocs.app
    description: Production EU
security: []
paths:
  /assistant/api/v1/tenants/{tenant}/agents:
    post:
      tags:
        - agent
      summary: Create Agent
      description: Create an agent
      operationId: create_agent_assistant_api_v1_tenants__tenant__agents_post
      parameters:
        - name: tenant
          in: path
          required: true
          schema:
            type: string
            description: The domain of the customer
            examples:
              - example.com
            title: Tenant
          description: The domain of the customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Agent'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Agent:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: The id of the agent
        name:
          type: string
          title: Name
          description: The name of the agent
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: The description of the agent
        audience:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Audience
          description: >-
            Who the agent serves (e.g. 'bank advisors who use AIDA to understand
            internal documents')
        assistant_role:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Assistant Role
          description: >-
            The role the assistant plays (e.g. 'an expert banking assistant that
            helps advisors')
        tone:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Tone
          description: The tone of responses (e.g. 'professional, concise, supportive')
        response_behavior:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Response Behavior
          description: >-
            How the agent should respond (e.g. who to address, how to structure
            answers)
        guardrails:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Guardrails
          description: >-
            Constraints the agent must respect or things it must verify before
            answering
        output_format:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Output Format
          description: The preferred structure or format of the answer
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: The date when the agent was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: The date when the agent was last updated
        permissions:
          anyOf:
            - items:
                $ref: '#/components/schemas/Permission'
              type: array
            - type: 'null'
          title: Permissions
          description: The permissions of the agent
        sources:
          anyOf:
            - items:
                $ref: '#/components/schemas/DataSource'
              type: array
            - type: 'null'
          title: Sources
          description: The sources of the agent
        glossary_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Glossary Ids
          description: The IDs of glossaries associated with the agent
        skill_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Skill Ids
          description: The IDs of skills associated with the agent
        dynamic_filters:
          anyOf:
            - items:
                $ref: '#/components/schemas/AgentMetadataFilterField'
              type: array
            - type: 'null'
          title: Dynamic Filters
          description: >-
            Low-cardinality metadata fields that the agent may use to scope
            searches
        dynamic_filter_instructions:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Dynamic Filter Instructions
          description: >-
            Instructions that help the agent select metadata filter values for a
            question
      type: object
      required:
        - name
      title: Agent
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Permission:
      properties:
        type:
          $ref: '#/components/schemas/PermissionType'
          description: The type of the permission
        value:
          type: string
          title: Value
          description: >-
            The value of the permission. The email for user or group and * from
            everybody
      type: object
      required:
        - type
        - value
      title: Permission
    DataSource:
      properties:
        library_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Library Id
          description: The id of the library in which we want to answer questions
        library_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Library Name
          description: The name of the library in which we want to answer questions
        class_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Class Id
          description: The id of the class in which we want to answer questions
        class_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Class Name
          description: The name of the class in which we want to answer questions
        metadata_filters:
          anyOf:
            - items:
                $ref: '#/components/schemas/DataSourceMetadataFilter'
              type: array
            - type: 'null'
          title: Metadata Filters
          description: >-
            Optional metadata filters applied automatically to both semantic and
            keyword search. Keys are field ids from the library/class schema.
      additionalProperties: false
      type: object
      title: DataSource
    AgentMetadataFilterField:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: The id of the metadata field that the agent may filter on
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            The current display name of the metadata field. This value is
            resolved by the server and ignored when writing an agent.
          readOnly: true
      additionalProperties: false
      type: object
      required:
        - id
      title: AgentMetadataFilterField
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PermissionType:
      type: string
      enum:
        - user
        - group
        - everybody
      title: PermissionType
    DataSourceMetadataFilter:
      properties:
        key:
          type: string
          title: Key
          description: >-
            The field id (not the display name) of the metadata field to filter
            on
        value:
          anyOf:
            - type: integer
            - type: boolean
            - type: number
            - type: string
            - items:
                type: string
              type: array
            - items:
                type: number
              type: array
            - items:
                type: integer
              type: array
          title: Value
          description: The value or list of values to compare against
        operator:
          $ref: '#/components/schemas/AODocsFilterOperator'
          description: The comparison operator
          default: '=='
      additionalProperties: false
      type: object
      required:
        - key
        - value
      title: DataSourceMetadataFilter
    AODocsFilterOperator:
      type: string
      enum:
        - '=='
        - '!='
        - '>'
        - <
        - '>='
        - <=
        - in
        - nin
      title: AODocsFilterOperator
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````