Skip to main content

Linking Backfill

Rebuild the links between all your documents after link key changes, then poll its progress until it finishes. Returns 202 and runs in the background.

After link keys change, for example when new fields are classified as link keys, the links between your documents need to be rebuilt. The backfill endpoint goes through all documents and rebuilds their links and cases from the current link keys. It returns 202 and runs in the background.

One backfill runs at a time per organization. If one is already running, a new request is skipped, not queued. Check the progress endpoint before you start another.
POST/v1/linking/backfill

Request

curl -X POST https://api.talonic.com/v1/linking/backfill \
  -H "Authorization: Bearer $TALONIC_API_KEY"

Response

Response fields (202 Accepted)

statusstringAlways started when the backfill is accepted.
messagestringReadable confirmation message.

Response (202)

{
  "status": "started",
  "message": "Backfill queued."
}

Poll the progress endpoint to follow the backfill. running shows whether it is still going, and processed / total count documents.

GET/v1/linking/backfill/progress

Node: wait for the backfill to finish

const headers = { Authorization: `Bearer ${process.env.TALONIC_API_KEY}` };
await fetch('https://api.talonic.com/v1/linking/backfill', { method: 'POST', headers });

let progress;
do {
  await new Promise((r) => setTimeout(r, 5000));
  progress = await fetch('https://api.talonic.com/v1/linking/backfill/progress', { headers }).then((r) => r.json());
  console.log(`${progress.processed}/${progress.total}`);
} while (progress.running);

Response

Response fields

totalintegerTotal number of documents to process.
processedintegerDocuments processed so far.
runningbooleanWhether a backfill is in progress.
entities_createdintegerShared values recorded during this backfill.
links_createdintegerDocument-to-value links created during this backfill.

Response

{
  "total": 540,
  "processed": 187,
  "running": true,
  "entities_created": 312,
  "links_created": 894
}

Errors

Error responses

401unauthorizedMissing or invalid API key.
429rate_limitedToo many requests. Retry after the period in the Retry-After header.

Frequently asked questions

How long does a backfill take?+
It depends on how many documents your workspace holds. Poll GET /v1/linking/backfill/progress and compare processed with total.
Does a backfill classify new link keys?+
No. It rebuilds links from the current link keys only. Call POST /v1/linking/classify first to classify new fields; it starts its own backfill when it finds new link keys.
What happens if I start a backfill while one is running?+
The second request is skipped, not queued. When the progress endpoint reports running: false, you can start a new one.