Integration fields via Migration API

Describe your question/issue in detail

I have an issue everytime I try to create a document via the Migration API (both POST and PUT methods) with an “Integration field“.

I have tried to pass an id of an “Integration field“ item but I keep getting the following error :

{ "message": "Integration field items couldn't be retrieved: 2583" }

My request look like this :

curl --location '``https://migration.prismic.io/documents``'
--header 'repository: my-repository'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer xxxxxxxxxxx'
--data '{
"title": "a-good-title",
"type": "supergoodtype",
"lang": "fr-fr",
"uid": "a-good-title",
"data": { “linked_collection“: { “id“: 2583 } }
}'

I am sure that the item with id 2583 exists because it comes from another document “Integration field“ (that points to the same catalog).

I have also tried to create the document first without the “Integration field“ (linked_collection) and then passing it through an update (PUT) request, but I get the same error..

How can I create documents via the Migration API with “Integration fields” ?

Hey @thomas.delcros for Custom API the item id is a string. So you can try sending it like that:

"linked_collection": { "id": "2583" }

If you got 2583 from the Content API response of another document, double-check it’s the actual catalog item ID you expect. Also, I noticed that your payload shows curly quotes (“linked_collection“, “id“). This might lead to unexpected behavior depending on what’s parsing it.

Another thing you need to confirm is if the field is wired to the specific catalog likerepo--catalog_name).

One last thing is that, pull catalogs refresh periodically (around every ~30 minutes).
So if something was recently added/changed, it might not be available yet when the Migration API tries to resolve it