@automica Most RESTful APIs I tend to loosely follow the JSON:API spec. They take the route of having a specific route for manipulating a parent resource’s relations. So if you have a form resource, then you could have a URL like /forms/{form}/relationships/items that attached/detaches/syncs related items for that form:
-
PATCH /forms/{form}/relationships/items would replace items with the items in the request (i.e.
sync) -
POST /forms/{form}/relationships/items would add requested items (i.e.
attach) -
DELETE /forms/{form}/relationships/items would remove requested items (i.e.
detach)
More information: https://jsonapi.org/format/#crud-updating-to-many-relationships