> ## 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.

# Search Entities and Organizations

> Search entities across all types with filtering and sorting



## OpenAPI

````yaml /api/openapi.yaml get /v1/search
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: []
    accountId: []
paths:
  /v1/search:
    get:
      tags:
        - Search
      summary: Search Entities and Organizations
      description: Search entities across all types with filtering and sorting
      parameters:
        - schema:
            type: string
            minLength: 1
          in: query
          name: term
          required: true
          description: Search term (required)
        - schema:
            type: number
            default: 20
            minimum: 1
            maximum: 100
          in: query
          name: limit
          required: false
          description: Number of results to return
        - schema:
            type: number
            default: 0
            minimum: 0
          in: query
          name: offset
          required: false
          description: Number of results to skip
        - schema:
            type: string
          in: query
          name: entity_types
          required: false
          description: Comma-separated list of entity type names to filter by
        - schema:
            type: string
          in: query
          name: asset_types
          required: false
          description: >-
            Comma-separated list of asset type names to filter by (alias for
            entity_types)
        - schema:
            type: string
          in: query
          name: organization_ids
          required: false
          description: Comma-separated list of organization IDs to filter by
        - schema:
            type: string
          in: query
          name: tags
          required: false
          description: Comma-separated list of tag IDs to filter by
        - schema:
            type: string
            enum:
              - score
              - updated_at
            default: score
          in: query
          name: sort_by
          required: false
          description: Sort results by score or updated_at
        - schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          in: query
          name: sort_direction
          required: false
          description: Sort direction
        - schema:
            type: boolean
          in: query
          name: include_deleted
          required: false
          description: Include soft-deleted entities (does not apply to organizations)
      responses:
        '200':
          $ref: '#/components/responses/SearchEntitiesandOrganizationsResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  responses:
    SearchEntitiesandOrganizationsResponse:
      description: Default Response
      content:
        application/json:
          schema:
            $ref: >-
              #/components/schemas/SearchEntitiesandOrganizationsResponse_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:
    SearchEntitiesandOrganizationsResponse_application_json:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/SearchEntitiesandOrganizationsResponse_application_json_items_items
          description: Array of search results
        total:
          type: number
          description: Total number of results found
        limit:
          type: number
          description: Number of results returned
        offset:
          type: number
          description: Number of results skipped
      required:
        - items
        - total
        - limit
        - offset
    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
    SearchEntitiesandOrganizationsResponse_application_json_items_items:
      type: object
      properties:
        type:
          type: string
          description: Entity type name or "organization"
        id:
          type: string
          format: uuid
          description: Unique identifier
        name:
          type: string
          description: Name of the entity or organization
        preview:
          type: string
          description: >-
            Search preview with highlighted matches using <mark> tags, or
            truncated text fallback
        score:
          type: number
          description: Combined relevance score
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
        deleted_at:
          type: string
          format: date-time
          nullable: true
          description: Soft-delete timestamp, null if active
        organization_name:
          type: string
          nullable: true
          description: Name of the owning organization, null for organization-type results
      required:
        - type
        - id
        - name
        - preview
        - score
        - updated_at
      description: Search result with relevance scoring and preview
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token
    accountId:
      type: apiKey
      in: header
      name: X-Account-ID
      description: Account ID

````