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

# Search Sub-Agents

> Search sub-agents available to the authenticated tenant.

Allowed filter columns: `agent_type`, `id`, `llm_model`, `sub_agent_display_name`, `sub_agent_name`, `sub_agent_name_key`, `system_prompt`, `tenant`.

Allowed sort columns: `agent_type`, `id`, `llm_model`, `sub_agent_display_name`, `sub_agent_name`, `sub_agent_name_key`, `system_prompt`, `tenant`.



## OpenAPI

````yaml /api-reference/openapi.json post /api/sub_agents/search
openapi: 3.1.0
info:
  title: Maadify API
  description: Public and admin API endpoints for Maadify.
  version: 1.0.0
servers:
  - url: https://app.maadify.com
    description: Production
security: []
tags:
  - name: Parent agents
    description: Create, update, and configure parent agents.
  - name: Sub-agents
    description: Create sub-agents and assign them to parent agents.
  - name: Tools
    description: Search tools and manage tool assignments.
  - name: Prompt templates
    description: Search and manage prompt templates.
  - name: Users
    description: Search users available to the authenticated tenant.
  - name: Models
    description: Search available LLM models.
  - name: Files
    description: Check file upload status.
paths:
  /api/sub_agents/search:
    post:
      tags:
        - Sub-agents
      summary: Search Sub-Agents
      description: >-
        Search sub-agents available to the authenticated tenant.


        Allowed filter columns: `agent_type`, `id`, `llm_model`,
        `sub_agent_display_name`, `sub_agent_name`, `sub_agent_name_key`,
        `system_prompt`, `tenant`.


        Allowed sort columns: `agent_type`, `id`, `llm_model`,
        `sub_agent_display_name`, `sub_agent_name`, `sub_agent_name_key`,
        `system_prompt`, `tenant`.
      operationId: search_sub_agents_endpoint_api_sub_agents_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubAgentSearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubAgentSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    SubAgentSearchRequest:
      properties:
        limit:
          type: integer
          maximum: 250
          minimum: 1
          title: Limit
          description: Maximum number of records to return.
          default: 100
        offset:
          type: integer
          minimum: 0
          title: Offset
          description: Number of records to skip before returning results.
          default: 0
        search_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Value
          description: Optional search text used to filter results.
        filters:
          items:
            anyOf:
              - $ref: '#/components/schemas/FilterParam'
              - $ref: '#/components/schemas/FilterOrGroup'
          type: array
          title: Filters
          description: Additional filters applied to the list query.
        sort:
          anyOf:
            - $ref: '#/components/schemas/SortParam'
            - type: 'null'
          description: Optional sort definition.
      additionalProperties: false
      type: object
      title: SubAgentSearchRequest
      examples:
        - filters:
            - column: provider
              operator: equals
              value: openai
          limit: 100
          offset: 0
          search_value: gpt
          sort:
            column: model_name
            desc: false
    SubAgentSearchResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether the request was successful.
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Type of error if the request failed.
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: Error message or informational message.
        data:
          $ref: '#/components/schemas/SubAgentSearchData'
          description: Sub-agent search results.
      type: object
      required:
        - success
        - data
      title: SubAgentSearchResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FilterParam:
      properties:
        column:
          type: string
          minLength: 1
          title: Column
          description: Database or API field name to filter on.
        value:
          title: Value
          description: Filter value to compare against the selected column.
        operator:
          type: string
          enum:
            - equals
            - not equals
            - contains
            - not contains
            - gte
            - lte
            - is
            - is not
            - in
            - not in
          title: Operator
          description: Filter operator. Defaults to equality when omitted.
          default: equals
      type: object
      required:
        - column
        - value
      title: FilterParam
      examples:
        - column: provider
          operator: equals
          value: openai
        - column: tenant
          operator: is
        - column: id
          operator: in
          value:
            - 1
            - 2
            - 3
        - column: description
          operator: contains
          value: billing
    FilterOrGroup:
      properties:
        or:
          items:
            $ref: '#/components/schemas/FilterParam'
          type: array
          minItems: 1
          title: Or
          description: >-
            Filter conditions joined with OR. The group is ANDed with other
            filters.
      type: object
      required:
        - or
      title: FilterOrGroup
      examples:
        - or:
            - column: tenant
              operator: equals
              value: tenant-id
            - column: tenant
              operator: is
    SortParam:
      properties:
        column:
          type: string
          minLength: 1
          title: Column
          description: Database or API field name to sort by.
        desc:
          type: boolean
          title: Desc
          description: Sort descending when true; ascending when false.
          default: false
      type: object
      required:
        - column
      title: SortParam
    SubAgentSearchData:
      properties:
        items:
          items:
            $ref: '#/components/schemas/SubAgentSearchItem'
          type: array
          title: Items
          description: Sub-agents matching the request.
        count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Count
          description: Total matching records when available.
      type: object
      title: SubAgentSearchData
    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
    SubAgentSearchItem:
      properties:
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
          description: Sub-agent ID.
        sub_agent_name_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Sub Agent Name Key
          description: Stored normalized sub-agent key.
        sub_agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Sub Agent Name
          description: Human-readable sub-agent name.
        agent_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Type
          description: Sub-agent type.
        tenant:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tenant
          description: Owning tenant ID or joined tenant object.
        tenants:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tenants
          description: Joined tenant row with id and tenant_name.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Sub-agent description.
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
          description: System prompt template ID.
        llm_model:
          anyOf:
            - type: integer
            - $ref: '#/components/schemas/ParentAgentDetailLLMModel'
            - type: 'null'
          title: Llm Model
          description: LLM model ID or joined model row.
        model_config:
          anyOf:
            - $ref: '#/components/schemas/SubAgentModelConfigRequest'
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Model Config
          description: Sub-agent model configuration.
        config:
          anyOf:
            - $ref: '#/components/schemas/SubAgentConfigRequest'
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Config
          description: Sub-agent runtime configuration.
        prompt_templates:
          anyOf:
            - $ref: '#/components/schemas/PromptTemplateListItem'
            - type: 'null'
          description: Joined system prompt template row.
        agent_groups:
          items:
            $ref: '#/components/schemas/ParentAgentGroupSearchItem'
          type: array
          title: Agent Groups
          description: Parent agents linked to this sub-agent.
        sub_agent_tools:
          items:
            $ref: '#/components/schemas/SubAgentToolSearchItem'
          type: array
          title: Sub Agent Tools
          description: Tools attached to this sub-agent.
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp.
      type: object
      title: SubAgentSearchItem
    ParentAgentDetailLLMModel:
      properties:
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
          description: LLM model ID.
        model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Name
          description: Model name.
        model_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Version
          description: Model version.
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
          description: Model provider.
      type: object
      title: ParentAgentDetailLLMModel
    SubAgentModelConfigRequest:
      properties:
        temperature:
          anyOf:
            - type: number
            - type: integer
          title: Temperature
          description: LLM temperature for this sub-agent.
          default: 0
      type: object
      title: SubAgentModelConfigRequest
    SubAgentConfigRequest:
      properties:
        human_input_mode:
          type: string
          title: Human Input Mode
          description: Autogen human input mode for this sub-agent.
          default: NEVER
        code_execution_config:
          type: boolean
          title: Code Execution Config
          description: Enable code execution for this sub-agent.
          default: false
        max_consecutive_auto_reply:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Consecutive Auto Reply
          description: Maximum consecutive auto replies before stopping.
        visible_senders:
          items:
            type: integer
          type: array
          title: Visible Senders
          description: Limit context to messages from these sub-agent IDs.
        hidden_senders:
          items:
            type: integer
          type: array
          title: Hidden Senders
          description: Suppress messages from these sub-agent IDs.
        hide_tool_calls:
          type: boolean
          title: Hide Tool Calls
          description: Hide tool call metadata from this sub-agent.
          default: false
        hide_tool_responses:
          type: boolean
          title: Hide Tool Responses
          description: Hide tool outputs from this sub-agent.
          default: false
        memory_config:
          $ref: '#/components/schemas/SubAgentMemoryConfigRequest'
          description: Memory settings for this sub-agent.
        json_schema:
          additionalProperties: true
          type: object
          title: Json Schema
          description: >-
            Structured output JSON schema for predictable JSON responses. Config
            fields are generated from this schema server-side.
      type: object
      title: SubAgentConfigRequest
    PromptTemplateListItem:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Prompt template ID.
        tenant_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tenant Id
          description: Owning tenant ID.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Prompt template name.
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
          description: Prompt template version.
        is_active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Active
          description: Whether this prompt template version is active.
        content:
          anyOf:
            - type: string
            - type: 'null'
          title: Content
          description: Prompt template content.
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Prompt template metadata.
        latest_version:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Latest Version
          description: Whether this row is marked as the latest template version.
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp.
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
          description: Last update timestamp.
      type: object
      title: PromptTemplateListItem
    ParentAgentGroupSearchItem:
      properties:
        parent_agent_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Agent Type
          description: Human-readable parent agent type from agents.agent_displayName.
        parent_agent_type_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Agent Type Key
          description: Parent agent type key from agents.agent_name.
        agent_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Key
          description: Stored parent agent key.
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
          description: >-
            User-facing agent name derived from agent_key with underscores
            converted to spaces.
        full_display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Full Display Name
          description: Full display name for the parent agent.
        tenant:
          anyOf:
            - type: string
            - type: 'null'
          title: Tenant
          description: Owning tenant ID.
      type: object
      title: ParentAgentGroupSearchItem
    SubAgentToolSearchItem:
      properties:
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
          description: Sub-agent tool link ID.
        agent_tool_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Agent Tool Id
          description: Linked agent tool ID.
        option:
          anyOf:
            - type: string
            - type: 'null'
          title: Option
          description: How the sub-agent can use the tool.
        tenant:
          anyOf:
            - type: string
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tenant
          description: Owning tenant ID or joined tenant object.
        system_agent_tool:
          anyOf:
            - type: integer
            - type: 'null'
          title: System Agent Tool
          description: Linked system tool ID.
        setting_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Setting Id
          description: Connector settings ID used by this tool.
        default_tool_owner_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Default Tool Owner Config
          description: Owner default configuration for quick assignment.
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
          description: Effective system tool name.
        tool_name_display:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name Display
          description: Effective display name for the tool.
        tool_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Description
          description: Effective system tool description.
        tool_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Type
          description: Effective system tool type.
        custom_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Name
          description: Tenant-specific tool name override.
        custom_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Description
          description: Tenant-specific tool description override.
        connector_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Name
          description: Connector key from the linked system tool.
        connector_name_display:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Name Display
          description: Human-readable connector name.
        connector_image:
          anyOf:
            - type: string
            - type: 'null'
          title: Connector Image
          description: Connector image URL.
        custom_connection_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Connection Name
          description: Tenant-specific connection display name.
        custom_connection_description:
          anyOf:
            - type: string
            - type: 'null'
          title: Custom Connection Description
          description: Tenant-specific connection description.
        index_setting_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Index Setting Id
          description: Linked index store setting ID.
        is_orphaned:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Orphaned
          description: Whether the tool is orphaned from its source system tool.
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Agent tool creation timestamp.
      type: object
      title: SubAgentToolSearchItem
    SubAgentMemoryConfigRequest:
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: >-
            Master memory toggle. When off, the sub-agent only sees the current
            conversation.
          default: false
        store_memories:
          type: boolean
          title: Store Memories
          description: Persist this sub-agent's messages after each turn.
          default: true
        use_memory_tools:
          type: boolean
          title: Use Memory Tools
          description: >-
            Register memory query tools so the sub-agent can search, summarize,
            and recall memories.
          default: true
        store_to_scope:
          type: string
          enum:
            - thread
            - agent
            - tenant
          title: Store To Scope
          description: 'Scope where new memories are written: thread, agent, or tenant.'
          default: thread
        search_scopes:
          items:
            type: string
            enum:
              - thread
              - agent
              - tenant
          type: array
          title: Search Scopes
          description: Memory scopes this sub-agent can search and inject from.
        inject_memory_context:
          type: boolean
          title: Inject Memory Context
          description: >-
            Fetch relevant memories from the selected scopes and prepend them
            before the next turn.
          default: true
        memory_context_limit:
          type: integer
          minimum: 0
          title: Memory Context Limit
          description: Maximum number of memories to inject into the sub-agent context.
          default: 3
        allow_compression:
          type: boolean
          title: Allow Compression
          description: >-
            Summarize large messages from other agents and tool responses before
            each turn.
          default: true
        compression_threshold:
          anyOf:
            - type: integer
            - type: 'null'
          title: Compression Threshold
          description: >-
            Message size in characters at which compression can begin. Defaults
            to runtime settings when empty.
        context_limit_mode:
          type: string
          enum:
            - messages
            - tokens
            - chars
          title: Context Limit Mode
          description: How the prompt window is bounded before each turn.
          default: messages
        max_active_messages:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Active Messages
          description: >-
            Maximum non-system messages kept when context_limit_mode is
            messages.
        max_context_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Context Tokens
          description: Maximum prompt tokens kept when context_limit_mode is tokens.
        max_context_chars:
          anyOf:
            - type: integer
            - type: 'null'
          title: Max Context Chars
          description: Maximum prompt characters kept when context_limit_mode is chars.
      additionalProperties: true
      type: object
      title: SubAgentMemoryConfigRequest
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````