Add new item with property of realation with another collection

So, What I want to do is sent a POST request to add a new item in a collection that also has a relation with another collection.
Ex, Restaurants and category. Basically how to set up my POST request that the addition of item works as the strapi admin panel(when we add relation both the collection are updated).

Hi, there @SSB2000 It depends on how the relationship is but let’s say it has a one-to-many.
You can then pass in the ID as an array and the ID is the ID of that category if you are creating a new restaurant

I thought of this approach but let say restaurants and categories have many to many relationships the how do we update both respective fields in both the collections.
Ex. I have categories that may belong to many restaurants and I want to add a restaurant with 2 categories. The the restaurants ID in the respective category will also need updation. How can I achieve this? Is there any prebuilt functionalty in strapi.

You can then pass an array of id's about categories when creating a restaurant. which will add those categories to the resturants.