In my experience, the key is to understand that the Automation API is "just" a wrapper around the CLI (see
the Python implementation).
For the resource import, you can look at
the implementation of Stack.import_resources() to see how the method's arguments map to the Pulumi CLI's parameters. Assuming you already know the CLI call you want to make, it should be relatively straightforward to map this to an Automation API call.