cross posted on mathematica.stackexchange.com
Let's create an API which creates one file each time it is called/accessed:
obj = CloudDeploy[
APIFunction[{}
, Put[$RequesterWolframID
, "testFiles/" <> DateString["ISODateTime"] <> ".txt"
] &
]
, "apiTest"
, Permissions -> "Public"
];
CloudEvaluate@CreateDirectory@"testFiles/";
and let's call it:
URLRead[obj]
CloudObjects["testFiles/"]
URLRead[obj]
CloudObjects["testFiles/"]

But this is not true, if you visit a browser interface they will be there:

In fact, once you visit it, CloudObjects
cache changes, but only once:
URLRead[obj]
CloudObjects["testFiles/"]
URLRead[obj]
CloudObjects["testFiles/"]

So how to make sure CloudObjects
returns up to date result?
I am fine with an additional step to flush the cache, I just want it to be possible programmatically.