How to set defaultPrim in API?

I’m creating some synthetic prims to use in Replicator. Works fine if I manually go in and set the root prim as defaultPrim. Otherwise the prim doesn’t show if not defaultPrim.

Is there a way using the API to mark the root as ‘defaultPrim’ ?

Thanks! (Sorry if this is a num-num)

i.e., if marked as defaultPrim - my replicator works nicely.

work around
start with a template stage where defaultPrim is set. then modify that to create a new object and save that.