OpenCloud could not find instance

So I’ve been trying to parse one of the modules scripts in a game I work on with a group api key and the Roblox OpenCloud Api and I’ve been stuck on how to actually get the instance

As it’s giving me a error that it couldn’t find the instance even with the group api key with the universe-instance:read scope and the verified universe and place ids


(Truncated information like the universe id, place id and UniqueId for the object)

I’ve tried both the debug id from ModuleScript:GetDebugId()
and getting the UniqueId field from studio and both resulted in a non found instance

Expected behavior

It should have gave me the instance web object to read to content of the ModuleScript in my case

Hi @TheFuroYT

Thanks for reaching out. I want to make sure you are using the cloud API correctly.
Are these the one you are using?

curl --include 
--location --request GET "https://apis.roblox.com/cloud/v2/universes/{universeId}/places/{placeId}/instances/{instanceId}"
--header "x-api-key: <api-key>"
curl --include 
--location --request GET "https://apis.roblox.com/cloud/v2/universes/{universeId}/places/{placeId}/instances/{instanceId}:listChildren" 
--header "x-api-key: <api-key>"

You can use the root in place of {instanceid} to get the root id and list the children under it as well to verify the children nodes you are getting.
If you are using the above APIs, the API-key should have access permissions to universe-place-instances:read and universe-place-instances:write

Let me know if you have more questions!

I am using the Cloud API correctly and using root gives a game id and using that id results to a not found instance,

root:listChildren seem to loop a lot or even indefinitely

Edit to prove this i made a nodejs script that logs the fetches logs

Fetching: universes/45XXXXXXXX/places/13XXXXXXXXX/instances/root
Fetching: universes/45XXXXXXXX/places/13XXXXXXXXX/instances/root/operations/7b001441-XXXX-XXXX-XXXX-29e8b364d6ec
root = "Game" (194119d4-0682-4bfa-0904-0c2700000001)
Fetching: universes/45XXXXXXXX/places/13XXXXXXXXX/instances/194119d4-0682-4bfa-0904-0c2700000001:listChildren
Fetching: universes/45XXXXXXXX/places/13XXXXXXXXX/instances/194119d4-0682-4bfa-0904-0c2700000001/operations/b4f6e9fd-XXXX-XXXX-XXXX-d2c625e17006
{
  path: 'universes/45XXXXXXXX/places/13XXXXXXXXX/instances/194119d4-0682-4bfa-0904-0c2700000001/operations/b4f6e9fd-XXXX-XXXX-XXXX-d2c625e17006',
  done: true,
  error: {
    code: 404,
    message: 'Could not find instance: 194119d4-0682-4bfa-0904-0c2700000001',
    details: []
  }
}

@TheFuroYT If you are using the correct access permissions as mentioned - universe-place-instances:read and universe-place-instances:write, I suspect there might be a timing issue that is going on.

Is there any time gap when you get the root instance id and when you call follow-up APIs to listChildren or GetInstance? If so, the uniqueid might have been expired and you need to get root instance id again.

If the permissions and timing is not issue, can you please share the steps elaborately with the place file in a private message with us?

@TheFuroYT Please feel free to reach out again if you have any questions.