This API allows you to clear the audit records from the user namespace that is older than a specific date or duration. You can input either a date in “YYYY-MM-DD” format or a duration in days. The API will start a background deletion job to delete audit data older than the specified date or duration and provide you with a tracking ID. You can use this tracking ID to track the status of your request.
Only Namespace admins with “metadata_change” permission can access this route.
METHOD: PUT
ROUTE: /namespace/delete/audit-records
Headers:
{
“Authorization”: “Bearer <NAMESPACE_ADMIN_API_KEY>”
}
Request format:
{
"data": {
"date": "2023-01-01" }
}
(OR) {
"data": {
"duration": 90 }}
Response structure:
{
"data": {
"tracking_id": "9f799cb6-5315-4199-8d47-3a7ced21dd1d29042024113301",
"status": "PENDING",
"job_type ": "data-deletion"
},
"success": true,
"error": {"message": ""}}