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

# Semantic search over indexed document content

> Vector-similarity search over indexed document bodies and attachments. Returns at most one result per document, best match first.



## OpenAPI

````yaml /api/openapi.yaml get /v1/search/semantic
openapi: 3.0.3
info:
  title: Documentation Service API
  description: API documentation for Documentation Service
  version: 1.0.0
servers:
  - url: https://api.us.lexful.app
    description: US pod
security:
  - bearerAuth: []
paths:
  /v1/search/semantic:
    get:
      tags:
        - Search
      summary: Semantic search over indexed document content
      description: >-
        Vector-similarity search over indexed document bodies and attachments.
        Returns at most one result per document, best match first.
      parameters:
        - in: header
          name: X-Account-ID
          required: true
          schema:
            type: string
            format: uuid
          description: Account ID
        - schema:
            type: string
            minLength: 1
          in: query
          name: term
          required: true
          description: Search term (required)
        - schema:
            type: number
            default: 10
            minimum: 1
            maximum: 20
          in: query
          name: limit
          required: false
          description: Maximum number of documents to return
        - schema:
            type: string
          in: query
          name: organization_ids
          required: false
          description: Comma-separated list of organization IDs to filter by
      responses:
        '200':
          $ref: >-
            #/components/responses/SemanticsearchoverindexeddocumentcontentResponse
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  responses:
    SemanticsearchoverindexeddocumentcontentResponse:
      description: Default Response
      content:
        application/json:
          schema:
            $ref: >-
              #/components/schemas/SemanticsearchoverindexeddocumentcontentResponse_application_json
    BadRequestResponse:
      description: Bad request - validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenResponse:
      description: Forbidden - insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerErrorResponse:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    SemanticsearchoverindexeddocumentcontentResponse_application_json:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/SemanticsearchoverindexeddocumentcontentResponse_application_json_items_items
          description: Array of semantic search results, best match first
        limit:
          type: number
          description: Maximum number of results requested
      required:
        - items
        - limit
    ErrorResponse:
      description: Bad request - validation error
      type: object
      properties:
        status:
          type: number
          description: HTTP status code
        message:
          type: string
          description: Error message
        error_id:
          type: string
          description: Unique error identifier
        error_code:
          type: string
          description: Error code
        developer_message:
          type: string
          description: Additional details for developers
    SemanticsearchoverindexeddocumentcontentResponse_application_json_items_items:
      type: object
      properties:
        type:
          type: string
          enum:
            - system.document
            - system.file
          description: Asset types embedded for semantic search
        id:
          type: string
          format: uuid
          description: Asset identifier
        name:
          type: string
          description: Name of the asset
        preview:
          type: string
          description: Best-matching content excerpt
        similarity_score:
          type: number
          description: Cosine similarity (0-1, higher = more similar)
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
        organization_name:
          type: string
          nullable: true
          description: Name of the owning organization
        source:
          type: string
          enum:
            - body
            - attachment
          description: >-
            Whether the match came from the asset's own content (its body or a
            file in one of its file properties) or an attached file
      required:
        - type
        - id
        - name
        - preview
        - similarity_score
        - updated_at
        - source
      description: Semantic search result ranked by vector similarity
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.