How to replace keywords in a prismic json document via migration API?

Hi team,
We are trying to replace certain keywords in a Prismic JSON and re-upload it back to Prismic via the migration API. I noticed it would cause problems in paragraphs with links. For example in a paragraph:

      "text":"Use this TOOL free plan text converter If you need to convert your copied text to plain text, just paste your text here",

If I want to replace the keyword instance of `TOOL``` to NEWTOOL, the hyperlink start and end position will also change, which means we need to re-calculate the position of all the links in a paragraph. Is there a better to achieve the similar result?


Hey @patrickzsy,

Since the Migration API is still quite new and in beta, we don't have a recommended path for this yet. You might find something helpful in this repository of example scripts:

In the coming months, we'll release more tools for interacting with the Migration API.


1 Like