# Request for clarification on proper response to relationship update

**URL:** <https://discuss.jsonapi.org/t/request-for-clarification-on-proper-response-to-relationship-update/850>\
**Category:** Uncategorized\
**Created:** [November 28, 2016, 9:16pm UTC](https://discuss.jsonapi.org/t/request-for-clarification-on-proper-response-to-relationship-update/850 "2016-11-28T21:16:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![klm](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/klm/32/358_2.png) [@klm](https://discuss.jsonapi.org/u/klm)\
**Post date:** [November 28, 2016, 9:16pm UTC](https://discuss.jsonapi.org/t/request-for-clarification-on-proper-response-to-relationship-update/850/1 "2016-11-28T21:16:17Z")

</div>

I could use some help interpreting the intention of the spec with regards to the proper response when updating a To-Many relationship. I am concerned with two cases:

1. The update is successful and the resulting relationship members exactly match the relationship members given in the request. _e.g._ a `PATCH` or a `POST` where no new members were added to the relationship.
2. The update is successful, but the resulting relationship members are a superset of those provided in the request. _e.g._ a `POST` where a new member is added to a set of one or more existing relationship members.

There is one sentence in particular that I am uncertain about and is hindering my understanding of what the proper response for these cases should be:

> A server MUST return a 200 OK status code if an update is successful, the client’s current data remain up to date, and the server responds only with top-level meta data.

I can read this one of two ways. On my first reading I interpreted it as meaning the server returning `200` is dependent on the update being successful _and_ the client’s data remaining up to date _and_ the server responding with only top-level meta data. This reading of it seems to conflict with the description for the `204` response: “…and the representation of the resource in the request matches the result” and the final clause of the sentence would imply the response is dependent on the response itself which would be very confusing.

I’m hoping this is just a case of ambiguity due to choice of punctuation. I rewrote the previous sentence this way to eliminate the ambiguity:

> A server MUST return a 200 OK status code if an update is successful. The client’s current data remain up to date and the server responds only with top-level meta data.

Assuming that my second interpretation is the correct one, then my understanding is the response for `1.` should be `204` and the response for `2.` should be `200`, but the response body should not include the representation of the updated relationship members.

Can anyone confirm which interpretation is correct and if I’ve understood the correct response for the two cases outlined? Thanks.
