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

> Search parent agents available to the authenticated tenant.

Allowed filter columns: `active`, `agent_key`, `agent_name`, `id`, `llm_model`, `parent_agent_type_key`, `tenant`.

Allowed sort columns: `active`, `agent_key`, `agent_name`, `id`, `llm_model`, `parent_agent_type_key`, `tenant`.



## OpenAPI

````yaml /api-reference/openapi.json post /api/parent_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/parent_agents/search:
    post:
      tags:
        - Parent agents
      summary: Search Parent Agents
      description: >-
        Search parent agents available to the authenticated tenant.


        Allowed filter columns: `active`, `agent_key`, `agent_name`, `id`,
        `llm_model`, `parent_agent_type_key`, `tenant`.


        Allowed sort columns: `active`, `agent_key`, `agent_name`, `id`,
        `llm_model`, `parent_agent_type_key`, `tenant`.
      operationId: search_parent_agents_api_parent_agents_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParentAgentSearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ParentAgentSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    ParentAgentSearchRequest:
      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.
        active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Active
          description: Filter parent agents by active state.
      additionalProperties: false
      type: object
      title: ParentAgentSearchRequest
      examples:
        - filters:
            - column: provider
              operator: equals
              value: openai
          limit: 100
          offset: 0
          search_value: gpt
          sort:
            column: model_name
            desc: false
    ParentAgentSearchResponse:
      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/ParentAgentSearchData'
          description: Parent agent search results.
      type: object
      required:
        - success
        - data
      title: ParentAgentSearchResponse
    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
    ParentAgentSearchData:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ParentAgentListItem'
          type: array
          title: Items
          description: Parent agents matching the request.
        count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Count
          description: Total matching records when available.
      type: object
      title: ParentAgentSearchData
    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
    ParentAgentListItem:
      properties:
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
          description: Parent agent ID.
        parent_agent_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Agent Type
          description: Human-readable parent agent type.
        parent_agent_type_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Agent Type Key
          description: Parent agent type key.
        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.
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
          description: Human-readable parent agent name.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Parent agent description.
        configs:
          anyOf:
            - $ref: '#/components/schemas/ParentAgentConfigRequest'
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Configs
          description: Parent agent runtime configuration.
        llm_model:
          anyOf:
            - type: integer
            - type: 'null'
          title: Llm Model
          description: Default LLM model ID.
        llm_model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Model Name
          description: Default LLM model name.
        active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Active
          description: Whether the parent agent is active.
        state_function:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: State Function
          description: State-function routing rules.
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp.
      type: object
      title: ParentAgentListItem
    ParentAgentConfigRequest:
      properties:
        last_agent_in_group:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Agent In Group
          description: >-
            Default sub-agent for a continued conversation. If empty, standard
            routing rules are used.
        max_rounds:
          anyOf:
            - type: string
            - type: integer
            - type: 'null'
          title: Max Rounds
          description: >-
            Maximum number of agent-to-agent turns that can occur in one
            parent-agent run.
          default: '10'
        temperature:
          anyOf:
            - type: string
            - type: number
            - type: integer
            - type: 'null'
          title: Temperature
          description: >-
            Default creativity level used when a sub-agent does not specify its
            own temperature.
          default: 0
        max_messages:
          anyOf:
            - type: string
            - type: integer
            - type: 'null'
          title: Max Messages
          description: >-
            Maximum number of non-system messages to keep in the parent-agent
            context.
          default: '10'
        continue_with_last_agent:
          anyOf:
            - type: string
            - type: boolean
          title: Continue With Last Agent
          description: >-
            When a conversation resumes, keep the last sub-agent as the routing
            reference instead of restarting rule logic.
          default: false
        memory_expiration:
          anyOf:
            - $ref: '#/components/schemas/MemoryExpirationConfigRequest'
            - type: 'null'
          description: >-
            Default memory expiration settings for thread, agent, and tenant
            scoped memories.
      type: object
      title: ParentAgentConfigRequest
    MemoryExpirationConfigRequest:
      properties:
        thread_ttl_hours:
          type: integer
          minimum: 1
          title: Thread Ttl Hours
          description: Hours to retain thread-scoped memories.
          default: 24
        agent_ttl_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Agent Ttl Days
          description: Days to retain agent-scoped memories. Null means no expiration.
        tenant_ttl_days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tenant Ttl Days
          description: Days to retain tenant-scoped memories. Null means no expiration.
        clear_thread_on_conversation_end:
          type: boolean
          title: Clear Thread On Conversation End
          description: Clear thread memories when a conversation ends.
          default: false
      type: object
      title: MemoryExpirationConfigRequest
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````