# 404 to PATCH contradict RFC 7231

**URL:** <https://discuss.jsonapi.org/t/404-to-patch-contradict-rfc-7231/331>\
**Category:** Uncategorized\
**Created:** [February 4, 2016, 2:12am UTC](https://discuss.jsonapi.org/t/404-to-patch-contradict-rfc-7231/331 "2016-02-04T02:12:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vfaronov](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vfaronov](https://discuss.jsonapi.org/u/vfaronov)\
**Post date:** [February 4, 2016, 2:12am UTC](https://discuss.jsonapi.org/t/404-to-patch-contradict-rfc-7231/331/1 "2016-02-04T02:12:01Z")

</div>

The _Updating Resources_ section of the spec [says](http://jsonapi.org/format/upcoming/#crud-updating-responses-404):

> A server **MUST** return `404 Not Found` when processing a request that references a related resource that does not exist.

This contradicts [RFC 7231 § 6.5.4](http://tools.ietf.org/html/rfc7231#section-6.5.4), which clearly refers to the _target resource_ (i.e. the request URI).

If that’s OK by your compatibility policy, I suggest removing or relaxing this requirement of JSON API. If not, then at least a note is in order.

A better status code may be 422 (Unprocessable Entity), defined by WebDAV (RFC 4918 § 11.2) but widely used elsewhere.

---

<div class="post-metadata">

**Author:** ![dgeb](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/dgeb/32/17_2.png) [@dgeb](https://discuss.jsonapi.org/u/dgeb)\
**Post date:** [February 28, 2016, 9:22pm UTC](https://discuss.jsonapi.org/t/404-to-patch-contradict-rfc-7231/331/2 "2016-02-28T21:22:46Z")

</div>

Thanks for pointing this out @vfaronov. Could you please open an issue so that we track this? [https://github.com/json-api/json-api](https://github.com/json-api/json-api)

---

<div class="post-metadata">

**Author:** ![vfaronov](https://avatars.discourse-cdn.com/v4/letter/v/b9bd4f/32.png) [@vfaronov](https://discuss.jsonapi.org/u/vfaronov)\
**Post date:** [February 29, 2016, 10:07am UTC](https://discuss.jsonapi.org/t/404-to-patch-contradict-rfc-7231/331/3 "2016-02-29T10:07:25Z")

</div>

Opened [#998](https://github.com/json-api/json-api/issues/998).

---

<div class="post-metadata">

**Author:** ![ethanresnick](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@ethanresnick](https://discuss.jsonapi.org/u/ethanresnick)\
**Post date:** [March 4, 2016, 10:58pm UTC](https://discuss.jsonapi.org/t/404-to-patch-contradict-rfc-7231/331/4 "2016-03-04T22:58:52Z")

</div>


