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

# Delete records

> Deletes a specific set of records (by record_id) from a dataset and enqueues a managed data-deletion job that purges their indexed and semantic data. The delete is durable: the records are tombstoned so a later reindex cannot bring them back. Up to 1024 record_ids per request. Returns the deletion job so you can track it to completion. Requires an admin role.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/records/delete
openapi: 3.1.0
info:
  description: >-
    Splendor is a search and retrieval API for your operational data. Ingest

    datasets — logs, documents, and structured records — and query them through
    one

    consistent interface that spans full-text, SQL, and semantic (vector)
    search.


    Every request authenticates with a bearer token and selects a workspace with
    the

    `X-Splendor-Tenant-Id` header. Read and query operations are available to
    any

    member; operations that create, change, or delete data require an admin
    role.


    All search modes return one shared envelope, and every result carries
    provenance

    back to the exact source object it came from.
  title: Splendor API
  version: 1.0.0
servers:
  - description: Production
    url: https://api.withsplendor.com
security:
  - bearerAuth: []
tags:
  - description: Resolve the authenticated user and the tenants they can access.
    name: Identity
  - description: >-
      Build on Splendor as a platform: authenticate with a platform API key to
      provision an isolated tenant per end-customer and manage your platform
      keys.
    name: Platform
  - description: >-
      List datasets, inspect inferred schemas and readiness, and manage dataset
      lifecycle including deletion and schema rebuilds.
    name: Datasets & schema
  - description: >-
      Run full-text, SQL, and semantic search over your datasets, stream
      results, and resolve object media.
    name: Search & query
  - description: Save queries and materialize result sets for repeatable analysis.
    name: Views
  - description: >-
      Define named, versioned, parameterized SQL queries and manage their
      versions.
    name: Query Endpoints
  - description: Create and manage asynchronous exports of search results.
    name: Exports
  - description: >-
      Configure data sources, upload data through hosted multipart uploads,
      stream logs, and track ingest runs.
    name: Sources & ingest
  - description: >-
      Connect third-party systems by managing connector instances in the
      selected tenant.
    name: Connectors
  - description: Define and test detection rules that run against incoming data.
    name: Detections
  - description: Inspect discovered fields and promote them to fast, aggregatable fields.
    name: Fields
  - description: >-
      Operational visibility and recovery: audit logs, usage, dead-letter queue,
      reindex jobs, and data-deletion jobs.
    name: Operations
paths:
  /v1/records/delete:
    post:
      tags:
        - Datasets & schema
      summary: Delete records
      description: >-
        Deletes a specific set of records (by record_id) from a dataset and
        enqueues a managed data-deletion job that purges their indexed and
        semantic data. The delete is durable: the records are tombstoned so a
        later reindex cannot bring them back. Up to 1024 record_ids per request.
        Returns the deletion job so you can track it to completion. Requires an
        admin role.
      operationId: deleteRecords
      parameters:
        - $ref: '#/components/parameters/SplendorTenantId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordDeleteRequest'
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDeletionJobResponse'
          description: Successful Response
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  parameters:
    SplendorTenantId:
      description: Selects the tenant (workspace) the request acts within.
      in: header
      name: x-splendor-tenant-id
      required: true
      schema:
        type: string
  schemas:
    RecordDeleteRequest:
      description: >-
        Delete a specific set of records (by ``record_id``) from a dataset.


        Capped at 1024 record_ids per request: the deletion worker issues one
        delete-by-query

        for the whole set (it does not chunk), so an unbounded set would produce
        an oversized

        query. Send larger deletes in batches.
      properties:
        dataset_id:
          maxLength: 128
          minLength: 1
          title: Dataset Id
          type: string
        reason:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          title: Reason
        record_ids:
          items:
            maxLength: 512
            minLength: 1
            type: string
          maxItems: 1024
          minItems: 1
          title: Record Ids
          type: array
      required:
        - dataset_id
        - record_ids
      title: RecordDeleteRequest
      type: object
    DataDeletionJobResponse:
      example:
        completed_at: '2026-01-15T09:30:00Z'
        created_at: '2026-01-15T09:30:00Z'
        error_message: null
        item_failed_count: 0
        item_pending_count: 0
        item_running_count: 0
        item_succeeded_count: 1
        item_total_count: 1
        items:
          - attempt_count: 1
            completed_at: '2026-01-15T09:30:00Z'
            created_at: '2026-01-15T09:30:00Z'
            error_message: null
            item_id: 1
            item_type: object_document
            next_attempt_at: null
            result:
              deleted_documents: 1240000
            started_at: '2026-01-15T09:30:00Z'
            status: succeeded
            target:
              dataset_id: app-logs
            updated_at: '2026-01-15T09:30:00Z'
        job_id: ddl_01H8Z3
        requested_by: user_01H8Z3
        scope: dataset
        started_at: '2026-01-15T09:30:00Z'
        status: succeeded
        target_dataset_id: app-logs
        target_source_id: null
        target_upload_session_id: null
        tenant_id: acme
        updated_at: '2026-01-15T09:30:00Z'
      properties:
        completed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Completed At
        created_at:
          format: date-time
          title: Created At
          type: string
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        item_failed_count:
          title: Item Failed Count
          type: integer
        item_pending_count:
          title: Item Pending Count
          type: integer
        item_running_count:
          title: Item Running Count
          type: integer
        item_succeeded_count:
          title: Item Succeeded Count
          type: integer
        item_total_count:
          title: Item Total Count
          type: integer
        items:
          items:
            $ref: '#/components/schemas/DataDeletionJobItemResponse'
          title: Items
          type: array
        job_id:
          title: Job Id
          type: string
        requested_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Requested By
        scope:
          enum:
            - hosted_upload
            - source
            - dataset
            - object
            - record
            - tenant
          title: Scope
          type: string
        started_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Started At
        status:
          enum:
            - pending
            - running
            - succeeded
            - failed
          title: Status
          type: string
        target_dataset_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Dataset Id
        target_source_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Target Source Id
        target_upload_session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Upload Session Id
        tenant_id:
          title: Tenant Id
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - job_id
        - tenant_id
        - scope
        - status
        - requested_by
        - target_upload_session_id
        - target_source_id
        - target_dataset_id
        - item_total_count
        - item_pending_count
        - item_running_count
        - item_succeeded_count
        - item_failed_count
        - error_message
        - created_at
        - updated_at
        - started_at
        - completed_at
        - items
      title: DataDeletionJobResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    DataDeletionJobItemResponse:
      properties:
        attempt_count:
          title: Attempt Count
          type: integer
        completed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Completed At
        created_at:
          format: date-time
          title: Created At
          type: string
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        item_id:
          title: Item Id
          type: integer
        item_type:
          title: Item Type
          type: string
        next_attempt_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Next Attempt At
        result:
          additionalProperties: true
          title: Result
          type: object
        started_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Started At
        status:
          enum:
            - pending
            - running
            - succeeded
            - failed
          title: Status
          type: string
        target:
          additionalProperties: true
          title: Target
          type: object
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - item_id
        - item_type
        - status
        - target
        - result
        - error_message
        - attempt_count
        - next_attempt_at
        - created_at
        - updated_at
        - started_at
        - completed_at
      title: DataDeletionJobItemResponse
      type: object
    ApiError:
      description: >-
        Error envelope returned by every Splendor API endpoint.


        ``detail`` is either a plain message string (most errors) or a
        structured

        ``{code, message}`` object (validation and capacity errors that carry a
        stable

        machine-readable code).
      examples:
        - detail: Dataset not found
        - detail:
            code: semantic_search_capacity_exhausted
            message: Semantic search capacity is temporarily exhausted; retry shortly.
      properties:
        detail:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ErrorBody'
          title: Detail
      required:
        - detail
      title: ApiError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    ErrorBody:
      description: Structured error detail returned by validation and capacity errors.
      examples:
        - code: semantic_query_text_required
          message: Semantic vector search requires non-empty text.
      properties:
        code:
          title: Code
          type: string
        message:
          title: Message
          type: string
      required:
        - code
        - message
      title: ErrorBody
      type: object
  responses:
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      description: The bearer token is missing, malformed, or expired.
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
      description: The token lacks access to the tenant or the role required.
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: API token issued from the Splendor console.
      scheme: bearer
      type: http

````