By referring to link DX NetOps
I'm able to create hierarchical container using API successfully.
As per my requirement hierarchy that i have is universe - > Region - > State -> City -> Site. Now all device are under universe container , i have to move device from universe to it's Site container using API. Let me know how i can achieve this using API ?
The topological location of a device is determined by a "Collects" association to a container. In your case, it's the "Universe" Container. There are REST calls available to create and destroy associations. Have a look at the Swagger UI to find them (e.g. $OC_Server/spectrum/restful/api-docs?url=/spectrum/restful/swagger.json#/associations)
In this case, you could loop through your "Universe"-devices, delete the "Collects"-association with that Container and create one to the desired new Container.
If you don't create a new association, the device will end up in "LostFound" after some minutes.