Delete Data

This endpoint allows you to delete data from a database. This can either be an entire row, an entire column or a specific cell (combination of row and column as identifiers for the cell). If you want to delete a specific cell, ensure that you are passing all four POST parameters.

POST Parameters

ParameterRequiredValueDescription
api_key{key}An API key that has access to the resource you want to query for
database_id{integer}The ID of the database which you wish to update the data of
row{integer}The Row ID which you wish to delete (or if you include the column_id in your POST, the row where the cell will be deleted from)
column_id{integer}The column which you wish to delete all data from in its entirety (note this does not delete the actual column!). If you wish to delete a single cell, then this parameter can be passed alongside the database_id and row parameters
Information Circle

Delete Options:

  • Delete entire row: Provide database_id and row
  • Delete entire column data: Provide database_id and column_id
  • Delete specific cell: Provide database_id, row, and column_id

Code Examples

The cURL, PHP, Python, Node.js, and C# examples call Xtracta from a trusted server. The React example calls an application-defined backend proxy so the API key is never exposed in browser code.

Warning

Store XTRACTA_API_KEY as a server-side environment variable. Never embed it in browser-delivered code.

curl --request POST 'https://api-app.xtracta.com/v1/databases/data_delete' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'api_key=<API_KEY>' \
  --data-urlencode 'database_id=<DATABASE_ID>' \
  --data-urlencode 'row=9214' \
  --data-urlencode 'column_id=<COLUMN_ID>'

Sample Request

POST https://api-app.xtracta.com/v1/databases/data_delete HTTP/1.1
api_key=123&database_id=456789&row=9214&column_id=8123

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<databases_response>
    <status>200</status>
    <message>The request has been successfully processed</message>
    <affected_records>1</affected_records>
</databases_response>

Schema Definition

Response Elements

ElementDescription
<status>A status code in response to the operation.
<message>Additional information about the operation – human readable.
<affected_records>The number of individual records which were affected in the delete operation.

Example

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xs:simpleType name="ConfidenceType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:integer">
          <xs:minInclusive value="0"/>
          <xs:maxInclusive value="100"/>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value=""/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>

  <xs:element name="databases_response">
    <xs:complexType>
      <xs:sequence>
      <xs:element name="status" type="xs:positiveInteger"/>
      <xs:element name="message" type="xs:string"/>
      <xs:element name="affected_records" type="xs:nonNegativeInteger" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>

Error Responses

For JSON and XML responses generated by this endpoint, the response is wrapped in databases_response and includes the HTTP status code and a message.

StatusMessageDescription
400<parameter> must be natural numberdatabase_id, column_id, and row must use supported positive integer values.
400Neither column_id nor database_id and row is specifiedSupply column_id, or supply both database_id and row.
202No data has been deletedThe selector was valid, but no matching data was removed.
500Internal server error occurred. Please try again later or contact support@xtracta.comRetry and contact support with the request parameters and timestamp if it persists.
Information Circle

Authentication, permission, IP-access-control, and rate-limit failures can be returned before this endpoint processes the request. Confirm the API key and caller access first.