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

# Bulk remove entities from the index

> Remove one or more entities from the global search index. Each item is validated then published to the internal event stream — deletion happens asynchronously. Returns 202 with the count of accepted operations.



## OpenAPI

````yaml /openapi/em-runtime-search-v2.yaml post /search/bulk/delete
openapi: 3.1.0
info:
  title: em_runtime_search
  version: 5.27.0
servers: []
security: []
paths:
  /search/bulk/delete:
    post:
      tags:
        - search
      summary: Bulk remove entities from the index
      description: >-
        Remove one or more entities from the global search index. Each item is
        validated then published to the internal event stream — deletion happens
        asynchronously. Returns 202 with the count of accepted operations.
      operationId: bulk_delete_entities
      requestBody:
        content:
          application/json:
            schema:
              items:
                $ref: '#/components/schemas/SearchDeleteRequest'
              type: array
              title: Body
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkIndexResponse'
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    SearchDeleteRequest:
      properties:
        organization_id:
          type: string
          title: Organization Id
          description: Organisation the entity belongs to
        entity_type:
          type: string
          title: Entity Type
          description: Entity type (e.g. 'table', 'agent')
        entity_id:
          type: string
          title: Entity Id
          description: Stable unique identifier for the entity
      type: object
      required:
        - organization_id
        - entity_type
        - entity_id
      title: SearchDeleteRequest
      description: A single delete operation within a bulk delete request.
    BulkIndexResponse:
      properties:
        accepted:
          type: integer
          title: Accepted
          description: Number of operations accepted and queued for processing
      type: object
      required:
        - accepted
      title: BulkIndexResponse
      description: Response from POST /search/bulk/index and POST /search/bulk/delete.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorResponse
      description: Standard error response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorBody:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          title: Message
        details:
          additionalProperties: true
          type: object
          title: Details
        request_id:
          type: string
          title: Request Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
      type: object
      required:
        - code
        - message
        - request_id
        - timestamp
      title: ErrorBody
      description: Error body with structured details.
    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
    ErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - INVALID_TOKEN
        - INSUFFICIENT_PERMISSIONS
        - RESOURCE_NOT_FOUND
        - RESOURCE_ALREADY_EXISTS
        - VALIDATION_ERROR
        - RATE_LIMIT_EXCEEDED
        - SERVICE_UNAVAILABLE
        - INTERNAL_ERROR
      title: ErrorCode
      description: Standard error codes for API responses.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````