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

# Bulk delete records

> Delete multiple records by their IDs from a data source (formerly known as "inference pipeline").



## OpenAPI

````yaml post /inference-pipelines/{inferencePipelineId}/rows/delete
openapi: 3.0.3
info:
  contact:
    email: support@openlayer.com
    name: Openlayer
    url: https://openlayer.com/
  description: API for interacting with the Openlayer server.
  title: Openlayer API
  version: '1.0'
  x-logo:
    url: https://logo.clearbit.com/openlayer.com
servers:
  - url: https://api.openlayer.com/v1
    description: Our prod backend
security:
  - bearerAuth: []
paths:
  /inference-pipelines/{inferencePipelineId}/rows/delete:
    post:
      tags:
        - Monitoring
      description: >
        Bulk-delete monitoring records by inference ID. Only project admins can
        perform this action.


        The records' spans are tombstoned synchronously, so reads stop returning
        the records immediately, and a background task hard-deletes the records,
        their scores, embeddings, and OTel spans. Deletion is permanent. The
        response carries a `taskResultUrl` / `taskResultId` pair you can poll
        for purge progress. Both are `null` on data sources where the delete
        completes synchronously before the response returns.


        Prefer this endpoint over calling `DELETE /rows/{inferenceId}` in a
        loop. One batched request purges all requested records in a single
        background task instead of one task per record.


        Retries are idempotent. Re-submitting records already tombstoned by a
        prior request whose purge has not completed returns 202 again with the
        handle of the in-flight purge task. Records that do not exist are
        skipped. A 404 means none of the requested IDs exist at all, neither
        live nor pending purge.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - inferenceIds
              properties:
                inferenceIds:
                  type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 500
                  description: Inference IDs to delete. Maximum of 500 per request.
      responses:
        '202':
          description: >
            Accepted. The records are tombstoned and the purge is enqueued. Also
            returned when re-submitting records that are already tombstoned but
            not yet purged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsDeletionAccepted'
        '400':
          description: >-
            The data source's backend does not support record deletion, or more
            than 500 IDs were provided.
        '403':
          description: Forbidden. Only project admins can delete records.
        '404':
          description: None of the requested records exist, neither live nor pending purge.
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/rows/delete \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "inferenceIds": ["832y98d3", "832y98d4", "832y98d5"]
              }'
components:
  parameters:
    inferencePipelineId:
      name: inferencePipelineId
      in: path
      description: The inference pipeline id (a UUID).
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    RecordsDeletionAccepted:
      type: object
      required:
        - inferenceIds
        - recordCount
      properties:
        inferenceIds:
          type: array
          items:
            type: string
          description: The inference IDs accepted for deletion.
        recordCount:
          type: integer
          description: Number of records that resolved and will be removed.
        spanCount:
          type: integer
          nullable: true
          description: >
            Number of spans that will be removed. Null on data sources that
            delete synchronously, which have no span table.
        taskResultUrl:
          type: string
          nullable: true
          description: >
            URL to poll for purge status. Null on data sources that delete
            synchronously, where the deletion is already complete.
        taskResultId:
          type: string
          nullable: true
          description: >
            ID of the background purge task. Null on data sources that delete
            synchronously, where the deletion is already complete.
  responses:
    UnexpectedError:
      description: Unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - error
            properties:
              code:
                type: integer
                format: int32
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your workspace API key. See [Find your API
        key](https://www.openlayer.com/docs/workspace-and-projects/find-your-api-key)
        for more information.

````