BackendHTTP APISyncs

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
}
PATCH
/records/prune

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.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An Environment API key from your Tenklo environment, or an Account API key for account-level endpoints.

Header Parameters

Connection-Id*string

The connection ID used to create the connection.

Provider-Config-Key*string

The integration ID used to create the connection (aka Unique Key).

Request Body

application/json
  1. body
model*string

The data model to prune records from

variant?string

The variant of the model

until_cursor*string

Prune 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?integer

The maximum number of records to prune in this request. Defaults to 1000.

Range1 <= value <= 10000

Response Body

Successfully pruned records

application/json
  1. response
count*integer

The number of records pruned in this request

has_more*boolean

Indicates if there are potentially more records to prune.

  • true: There may be more records that need pruning
  • false: All records up to the cursor have been pruned
Example Request
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"}'
Example Response
{  "count": 0,  "has_more": true}

On this page