Prune records
Requires an API key with the environment:records:write scope. Learn more about API key scopes.
Prunes synced records for a given connection and model using cursor-based pagination.
What is pruning?
Pruning empties the record payload while preserving the record metadata. This is useful for compliance requirements, ensuring Tenklo doesn't hold onto your records data while maintaining the ability to track record state. The payload can be restored by re-syncing the data.
Pruning is not the same as marking a record as deleted from the external API. This endpoint prunes data from Tenklo’s cache only. It does not delete anything on the external API, and it is not the same as detecting a deletion from the source.
If you need to tell your customers that a record was deleted on the external API while keeping its last-known payload in cache, use batchDelete or trackDeletesStart/trackDeletesEnd in your sync functions instead.
Cursor behavior
Records are pruned up to and including the specified until_cursor value. Use the _nango_metadata.cursor value from the record you want to prune up to.
Response
The has_more field indicates whether there are potentially more records to prune. When true, make another request with the same until_cursor to continue pruning. When false, all records up to the cursor have been pruned.
{
"count": 150,
"has_more": true
}Prunes synced records for a given connection and model using cursor-based pagination.
What is pruning: Pruning empties the record payload while preserving the record metadata.
Cursor behavior: Records are pruned up to and including the specified cursor.
bearerAuthAuthorizationBearer <token>An Environment API key from your Tenklo environment, or an Account API key for account-level endpoints.
Connection-Id*stringThe connection ID used to create the connection.
Provider-Config-Key*stringThe integration ID used to create the connection (aka Unique Key).
application/json- body
model*stringThe data model to prune records from
variant?stringThe variant of the model
until_cursor*stringPrune all records up to and including this cursor. Use the cursor value from _nango_metadata.cursor of the record you want to prune up to.
limit?integerThe maximum number of records to prune in this request. Defaults to 1000.
1 <= value <= 10000Successfully pruned records
application/json- response
count*integerThe number of records pruned in this request
has_more*booleanIndicates if there are potentially more records to prune.
true: There may be more records that need pruningfalse: All records up to the cursor have been pruned
curl -X PATCH 'https://api.tenklo.dev/records/prune' \ -H 'Connection-Id: string' \ -H 'Provider-Config-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "model": "string", "until_cursor": "string"}'{ "count": 0, "has_more": true}