novinzodevelopers
API referenceCore for pluginsSearch

Sync Records

POST/api/search/records/sync

Replaces all the calling plugin's searchable records of the store, a page of at most 500 at a time: send every page with the same generation, and done: true with the last. Records written since the first page of the generation, by it or by SaveRecords, stay; the rest are removed once it is done. A page can be retried, and a resync abandoned midway removes nothing; a new generation starts over, and a page of an earlier one sent after it only writes its records. Use it to fill search with records written before the plugin wrote them as they changed, or to repair it.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

generation*string

Names one resync: every page of it carries the same, and a new resync a new one.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
records*array<>
Itemsitems <= 500
done*boolean

Marks the last page: the plugin's records this resync did not write are removed.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/search/records/sync" \  -H "Content-Type: application/json" \  -d '{    "generation": "string",    "records": [      {        "id": "string",        "title": "string",        "target": {          "type": "page"        }      }    ],    "done": true  }'
Empty