Skip to main content
POST
/
checklist
/
enrichment
/
cleanup
curl --request POST \
  --url https://api.royalti.io/checklist/enrichment/cleanup \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "status": "success",
  "message": "Cleaned up 42 enrichment items",
  "data": {
    "deleted": 123,
    "statuses": [
      "<string>"
    ],
    "olderThanDays": 123
  }
}
{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}
{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}
{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

/checklist/enrichment/cleanup Deletes old enrichment staging records that are no longer needed. Only records with terminal statuses (rejected, failed, imported) and older than the specified threshold are removed. Records with pending status are never deleted. A daily automated cleanup job also runs at 5 AM, removing items older than 30 days. Authorization:
  • Required role: admin or higher
Method: POST

Code Examples

const response = await fetch('https://api.royalti.io/checklist/enrichment/cleanup', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "olderThanDays": 30,
    "statuses": [
      {}
    ]
  })
});

const data = await response.json();
console.log(data);
import requests

response = requests.post(
  'https://api.royalti.io/checklist/enrichment/cleanup',
  headers={
    'Authorization': f'Bearer {token}'
  },
  json={"olderThanDays":30,"statuses":[{}]}
)

data = response.json()
print(data)
curl -X POST https://api.royalti.io/checklist/enrichment/cleanup \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"olderThanDays":30,"statuses":[{}]}'

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json
olderThanDays
integer
default:30

Delete items older than this many days (minimum 1, default 30)

Example:

30

statuses
enum<string>[]

Which statuses to clean up (default all three)

Available options:
rejected,
failed,
imported

Response

Cleanup completed

status
string
Example:

"success"

message
string
Example:

"Cleaned up 42 enrichment items"

data
object