Replacing All References Pointing To A Specific Entry?

We have the concept of a spacing content type that contains a dropdown field with 3 possible values (small, medium, large). Thus we only need 3 corresponding content entries for this content type that can be reused across all pages. However, over the years our editors have accidentally created many redundant entries rather than using one of the 3 existing ones by reference.

So the question is: Is there a way, using the SDK, to mass update/replace a reference in Contentful? e.g.

Page Entry A

  • references the correct “small” spacing content entry (EntryID=111) :white_check_mark:

Page Entry B

  • references wrong “small” spacing content entry (EntryID=123) :cry:

For all content entries that reference to entryID 123, update/change the reference to point to entry ID 111 (and then delete entry ID 123)