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

> Search prompt templates available to the authenticated tenant.

Allowed filter columns: `id`, `is_active`, `name`, `tenant_id`, `version`.

Allowed sort columns: `id`, `is_active`, `name`, `tenant_id`, `version`.



## OpenAPI

````yaml /api-reference/openapi.json post /api/prompt_templates/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/prompt_templates/search:
    post:
      tags:
        - Prompt templates
      summary: Search Prompt Templates
      description: >-
        Search prompt templates available to the authenticated tenant.


        Allowed filter columns: `id`, `is_active`, `name`, `tenant_id`,
        `version`.


        Allowed sort columns: `id`, `is_active`, `name`, `tenant_id`, `version`.
      operationId: search_prompt_templates_endpoint_api_prompt_templates_search_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptTemplateSearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptTemplateSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    PromptTemplateSearchRequest:
      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:
          type: boolean
          title: Active
          description: Filter prompt templates by active state.
          default: true
      additionalProperties: false
      type: object
      title: PromptTemplateSearchRequest
      examples:
        - filters:
            - column: provider
              operator: equals
              value: openai
          limit: 100
          offset: 0
          search_value: gpt
          sort:
            column: model_name
            desc: false
    PromptTemplateSearchResponse:
      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/PromptTemplateSearchData'
          description: Prompt template search results.
      type: object
      required:
        - success
        - data
      title: PromptTemplateSearchResponse
    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
    PromptTemplateSearchData:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PromptTemplateListItem'
          type: array
          title: Items
          description: Prompt templates matching the request.
        count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Count
          description: Total matching records when available.
      type: object
      title: PromptTemplateSearchData
    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
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````