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

# Search Agent Files

> Search files by content.



## OpenAPI

````yaml get /api/v1/agent-files/{agent_id}/files/search
openapi: 3.1.0
info:
  title: ThenaAgentStudio
  description: |2-

        ThenaCrew AI CRM Renewal System

        An intelligent platform to automate customer renewal insights and communications through multi-agent workflows.

        Key Features:
        * AI-powered renewal analysis
        * Personalized communication generation
        * Automated opportunity tracking
        * Multi-agent workflow orchestration
        
  version: 1.0.0
servers:
  - url: https://agent-studio.thena.ai
    description: Production server
  - url: http://localhost:8008
    description: Local development server
security:
  - ApiKeyAuth: []
tags:
  - name: Agents
    description: Agent management endpoints
  - name: Chat
    description: Chat and messaging endpoints
paths:
  /api/v1/agent-files/{agent_id}/files/search:
    get:
      tags:
        - Agent Files
        - Agent Files
      summary: Search Agent Files
      description: Search files by content.
      operationId: search_agent_files_api_v1_agent_files__agent_id__files_search_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Agent Id
        - name: query
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            description: Search query text
            title: Query
          description: Search query text
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 20
            minimum: 1
            description: Maximum number of results to return
            default: 5
            title: Limit
          description: Maximum number of results to return
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FileSearchResult'
                title: >-
                  Response Search Agent Files Api V1 Agent Files  Agent Id 
                  Files Search Get
        '401':
          description: Unauthorized - Invalid or missing JWT token
        '403':
          description: Forbidden - Insufficient permissions
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    FileSearchResult:
      properties:
        file:
          $ref: '#/components/schemas/backend__models__agent_file__AgentFile'
        chunk_text:
          type: string
          title: Chunk Text
        similarity:
          type: number
          title: Similarity
      type: object
      required:
        - file
        - chunk_text
        - similarity
      title: FileSearchResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    backend__models__agent_file__AgentFile:
      properties:
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          format: uuid
          title: Id
        agent_id:
          type: string
          format: uuid
          title: Agent Id
        organization_id:
          type: string
          format: uuid
          title: Organization Id
        name:
          type: string
          title: Name
        bucket_path:
          type: string
          title: Bucket Path
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
      type: object
      required:
        - id
        - agent_id
        - organization_id
        - name
        - bucket_path
        - size
        - mime_type
      title: AgentFile
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````