Working …
This value you provided is not a number. Please try again.
This value you provided is not an integer. Please try again.
The value entered is not a valid Vanderbilt Medical Record Number (i.e. 4- to 9-digit number, excluding leading zeros). Please try again.
The value you provided must be within the suggested range
The value you provided is outside the suggested range
This value is admissible, but you may wish to double check it.
The value entered must be a time value in the following format HH:MM within the range 00:00-23:59 (e.g., 04:32 or 23:19).
This field must be a 5 or 9 digit U.S. ZIP Code (like 94043). Please re-enter it now.
This field must be a 10 digit U.S. phone number (like 415 555 1212). Please re-enter it now.
This field must be a valid email address (like joe@user.com). Please re-enter it now.
The value you provided could not be validated because it does not follow the expected format. Please try again.
Required format:

General API Info

Supported Methods

Arms
Data Access Groups
Events
Field Names
Files
File Repository
Instruments
Logging
Metadata
Projects
Records
Repeating Instruments and Events
Reports
REDCap
Surveys
Users & User Privileges
User Roles
REDCap API Documentation
Method Name

Delete Records

Description

This method allows you to delete one or more records from a project in a single API request, and also optionally allows you to delete parts of a record, such as a single instrument's data for one or more records or a single event's data for one or more records.

URL
https://chi-redcap.dshs.texas.gov/redcap/api/
Supported Request Method
POST
Permissions Required
To use this method, you must have 'Delete Record' user privileges in the project.
Parameters (case sensitive)
Required
token
The API token specific to your REDCap project and username (each token is unique to each user for each project). See the section on the left-hand menu for obtaining a token for a given project.
content
record
action
delete
records
an array of record names specifying specific records you wish to delete
Optional
arm
the arm number of the arm in which the record(s) should be deleted. (This can only be used if the project is longitudinal with more than one arm.) NOTE: If the arm parameter is not provided, the specified records will be deleted from all arms in which they exist. Whereas, if arm is provided, they will only be deleted from the specified arm.
instrument
the unique instrument name (column B in the Data Dictionary) of an instrument (as a string) if you wish to delete the data for all fields on the specified instrument for the records specified.
event
the unique event name - only for longitudinal projects. NOTE: If instrument is provided for a longitudinal project, the event parameter is mandatory.
repeat_instance
the repeating instance number for a repeating instrument or repeating event. NOTE: If project has repeating instruments/events, it will remove only the data for that repeating instance.
delete_logging
provide a value of '0' ("keep logging") or '1' ("delete logging"). This option can only be utilized for projects with the "Delete a record's logging activity when deleting the record?" setting enabled by an administrator on the Edit Project Settings page. If that setting is enabled in the project, then the default value will be '1', and if the project-level setting is not enabled, the default value will be '0'. If the project-level setting has been enabled, this option must be provided with a value of '0' in order to prevent the record's logging activity from being deleted when the record is deleted.
Returns

the number of records deleted or (if instrument, event, and/or instance are provided) the number of items deleted over the total records specified.

REDCap Software - Version 14.9.1 - © 2024 Vanderbilt University