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

# /delete/records

```
URL: http://<db.host>:<db.port>/delete/records
```

Deletes record(s) matching the provided criteria from the given table. The
record selection criteria can either be one or more  input parameter
*expressions* (matching multiple records), a single record identified by
*record\_id* options, or all records when using *delete\_all\_records*.  Note that
the three selection criteria are mutually exclusive.  This operation cannot be
run on a view.  The operation is synchronous meaning that a response will not
be available until the request is completely processed and all the matching
records are deleted.

## Input Parameter Description

<ParamField body="table_name" type="string">
  Name of the table from which to delete records, in \[schema\_name.]table\_name format, using standard [name resolution rules](../../concepts/tables/#table-name-resolution). Must contain the name of an existing table; not applicable to views.
</ParamField>

<ParamField body="expressions" type="array of strings">
  A list of the actual predicates, one for each select; format should follow the guidelines provided [here](../../concepts/expressions/). Specifying one or more input parameter *expressions* is mutually exclusive to specifying *record\_id* in the input parameter *options*.
</ParamField>

<ParamField body="options" type="map of string to strings">
  Optional parameters.

  The default value is an empty map ( \{} ).

  <Expandable title="options">
    <ParamField body="global_expression">
      An optional global expression to reduce the search space of the input parameter *expressions*.

      The default value is ''.
    </ParamField>

    <ParamField body="record_id">
      A record ID identifying a single record, obtained at the time of [insertion of the record](/content/api/rest/insert_records_rest) or by calling [/get/records/fromcollection](/content/api/rest/get_records_fromcollection_rest) with the *return\_record\_ids* option. This option cannot be used to delete records from [replicated](../../concepts/tables/#replication) tables.
    </ParamField>

    <ParamField body="delete_all_records">
      If set to *true*, all records in the table will be deleted. If set to *false*, then the option is effectively ignored.

      The default value is `false`.

      The supported values are:

      * true
      * false
    </ParamField>
  </Expandable>
</ParamField>

## Output Parameter Description

The Kinetica server embeds the endpoint response inside a standard response structure which contains status information and the actual response to the query.  Here is a description of the various fields of the wrapper:

<ResponseField name="status" type="String">
  'OK' or 'ERROR'
</ResponseField>

<ResponseField name="message" type="String">
  Empty if success or an error message
</ResponseField>

<ResponseField name="data_type" type="String">
  'delete\_records\_response' or 'none' in case of an error
</ResponseField>

<ResponseField name="data" type="String">
  Empty string
</ResponseField>

<ResponseField name="data_str" type="JSON or String">
  This embedded JSON represents the result of the /delete/records endpoint:

  <Expandable title="data_str">
    <ResponseField name="count_deleted" type="long">
      Total number of records deleted across all expressions.
    </ResponseField>

    <ResponseField name="counts_deleted" type="array of longs">
      Total number of records deleted per expression.
    </ResponseField>

    <ResponseField name="info" type="map of string to strings">
      Additional information.
    </ResponseField>
  </Expandable>

  Empty string in case of an error.
</ResponseField>
