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

# Search Document

> Search document content using embeddings.



## OpenAPI

````yaml /specs/openapi-interactive.json post /api/v1/document/{document_id}/search/
openapi: 3.0.3
info:
  title: Perso Interactive API
  version: 0.0.0
servers:
  - url: https://platform.perso.ai
security: []
tags:
  - name: Embed
paths:
  /api/v1/document/{document_id}/search/:
    post:
      tags:
        - Session Resources
      summary: Search Document
      description: Search document content using embeddings.
      operationId: v1_document_search_create
      parameters:
        - in: path
          name: document_id
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentSearchRequestRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DocumentSearchRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DocumentSearchRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentSearchResponse'
          description: ''
        '400':
          description: Bad Request - Invalid input data or parameters.
        '401':
          description: Unauthorized - Invalid or missing authentication credentials.
        '403':
          description: Forbidden - You do not have permission to perform this action.
        '404':
          description: Not Found - The requested resource could not be found.
        '500':
          description: Internal Server Error - An unexpected error occurred.
      security:
        - {}
components:
  schemas:
    DocumentSearchRequestRequest:
      type: object
      properties:
        text:
          type: string
          minLength: 1
          description: Query string to embed and search against the document.
        count:
          type: integer
          nullable: true
          description: Maximum number of matching chunks to return.
      required:
        - text
    DocumentSearchResponse:
      type: object
      properties:
        result:
          type: array
          items:
            type: string
      required:
        - result

````