When upserting an object using the Catalog API, the version
number is crucial for ensuring that you are updating the most current version of the object. This is part of the optimistic concurrency control mechanism that prevents conflicting updates.
To get the correct version
number for an object, you should retrieve the object using the RetrieveCatalogObject
endpoint before performing an update. This endpoint will return the current version number of the object, which you can then use in your upsert request. If you attempt to use an outdated version number, you will encounter the “Object version does not match latest database version” error, indicating that the object has been modified since you last retrieved it.
Therefore, always ensure you have the latest version number by retrieving the object just before you perform an update.
This answer was reviewed by @Bryan-Square.