Determining the parent group of a document in x-callback-url

So, I suspect the answer is no after searching through the help information on x-callback-url but I wanted to ask anyway before giving up…

Is there a way to determine the group where that a document is located using x-callback-url options?

Say if I wanted a Shortcut to fetch the document indicated from a share sheet, modify the content and save the new document back in the same group (but not as the same document), I would need to know the UUID of the group the original came from…

So far, all I have come up with is to fetch and search the list of documents in all groups looking for the UUID to find what group it is in and in a Shortcut that will take way too long.

Just an outline for a script:

  • get the record id from the callback url
  • get the record using the id
  • get the parent of this record
  • make a copy of the record
  • modify it
  • save it in the parent of the original record

No Applescript support, this is using DEVONthink To Go.