{"url": "http://jsonapi.org/", "titulek": "JSON:API — A specification for building APIs in JSON", "h1": "JSON:API", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 2, "text": "MIME Types"}, {"uroven": 2, "text": "Format documentation"}, {"uroven": 2, "text": "Extensions"}, {"uroven": 2, "text": "Milestones"}], "markdown": "If you’ve ever argued with your team about the way your JSON responses\nshould be formatted, JSON:API can help you stop the\n[bikeshedding](http://bikeshed.org) and focus on what matters:\n**your application**.\n\nBy following shared conventions, you can increase productivity, take advantage\nof generalized tooling and best practices. Clients built around JSON:API are\nable to take advantage of its features around efficiently caching responses,\nsometimes eliminating network requests entirely.\n\nHere’s an example response from a blog that implements JSON:API:\n\n```\n{ \"links\": { \"self\": \"http://example.com/articles\", \"next\": \"http://example.com/articles?page[offset]=2\", \"last\": \"http://example.com/articles?page[offset]=10\" }, \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }, \"comments\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": \"http://example.com/articles/1/comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"5\" }, { \"type\": \"comments\", \"id\": \"12\" } ] } }, \"links\": { \"self\": \"http://example.com/articles/1\" } }], \"included\": [{ \"type\": \"people\", \"id\": \"9\", \"attributes\": { \"firstName\": \"Dan\", \"lastName\": \"Gebhardt\", \"twitter\": \"dgeb\" }, \"links\": { \"self\": \"http://example.com/people/9\" } }, { \"type\": \"comments\", \"id\": \"5\", \"attributes\": { \"body\": \"First!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"2\" } } }, \"links\": { \"self\": \"http://example.com/comments/5\" } }, { \"type\": \"comments\", \"id\": \"12\", \"attributes\": { \"body\": \"I like XML better\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/comments/12\" } }] } \n```\n\nThe response above contains the first in a collection of “articles”, as well as\nlinks to subsequent members in that collection. It also contains resources\nlinked to the article, including its author and comments. Last but not least,\nlinks are provided that can be used to fetch or update any of these\nresources.\n\nJSON:API covers creating and updating resources as well, not just responses.\n\n## MIME Types\n\nJSON:API has been properly registered with the IANA. Its media\ntype designation is [`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).\n\n## Format documentation\n\nTo get started with JSON:API, check out [documentation for the base\nspecification](/format).\n\n## Extensions\n\nThe JSON:API community has created a collection of extensions that APIs can use\nto provide clients with information or functionality beyond that described in the\nbase JSON:API specification. These extensions are called profiles.\n\nYou can [browse existing profiles](/extensions/#existing-profiles) or\n[create a new one](/extensions/#profile-creation).\n\n## Milestones\n\nMajor milestones for this specification include:\n\n- 2022-09-30: 1.1 final released.\n- 2015-05-29: 1.0 final released.\n- 2013-07-21: Media type registration completed with the IANA.\n- 2013-05-03: Initial release of the draft.\n\nA more thorough history is available [here](/about/#update-history).\n\nYou can subscribe to an RSS feed of individual changes [here](https://github.com/json-api/json-api/commits.atom).", "znaku_textu": 3381, "slov": 440, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:01", "sha256": "03050536b85fcf6ca35c6992223dbb2873ac18c7f380c079f044b00b073b9cac", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://github.com/json-api/json-api", "http://bikeshed.org/", "http://www.iana.org/assignments/media-types/application/vnd.api+json", "https://github.com/json-api/json-api/commits.atom", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/about/", "titulek": "JSON:API — About", "h1": "About", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "About"}, {"uroven": 2, "text": "Channels"}, {"uroven": 2, "text": "Editors"}, {"uroven": 2, "text": "History"}, {"uroven": 3, "text": "Update history"}], "markdown": "# About\n\n## Channels\n\nJSON:API is:\n\n- [@jsonapi](https://twitter.com/jsonapi) on [Twitter](https://twitter.com)\n- *#jsonapi* channel on [Freenode IRC](http://freenode.net)\n- [jsonapi discussion forum](https://discuss.jsonapi.org)\n\n## Editors\n\nThere are four active editors of this specification:\n\n- [Yehuda Katz](https://twitter.com/wycats)\n- [Dan Gebhardt](https://twitter.com/dgeb)\n- [Gabe Sullice](https://twitter.com/gabesullice)\n- [Jeldrik Hanschke](https://twitter.com/jelhan1)\n\nThe following emeritus editors are no longer active:\n\n- [Tyler Kellen](https://twitter.com/tkellen)\n- [Steve Klabnik](https://twitter.com/steveklabnik)\n- [Ethan Resnick](https://twitter.com/ethanresnick)\n\n## History\n\nJSON:API was originally drafted by [Yehuda Katz](https://twitter.com/wycats)\nin May 2013. This first draft was extracted from the JSON transport\nimplicitly defined by [Ember](https://emberjs.com/) Data’s REST adapter.\n\nIn general, Ember Data’s goal is to eliminate the need for ad-hoc code\nper application to communicate with servers that communicate in a\nwell-defined way.\n\nSome servers, like Firebase, Parse and CouchDB already define strict\ncommunication protocols for clients, and were good fits for Ember Data.\nIn contrast, servers written in Rails, Node, and Django tend to be\nwritten in a “REST-style” but lack the precision necessary for drop-in\nclient code.\n\nThe REST Adapter in Ember Data implicitly defined a protocol that\ncustom servers could implement to get a drop-in client for all of their\nresources. [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) is a proof-of-concept library\nfor Rails that implemented the serialization format expected by Ember\nData.\n\nRecord creation, update, and deletion was defined implicitly by the\nEmber Data library and was close to conventions already in wide use by\nRails, Django and Node developers.\n\nThe goals of the media type are to balance:\n\n- A generic media type that can work across a broad set of use cases,\nincluding the generally used relationship types\n- Similarity to existing server-side framework practices (and human\nreadability for debugging)\n- Ease of implementation on the server side\n- Ease of implementation on the client side\n\nThis specification reached a stable version 1.0 on May 29, 2015.\n\n### Update history\n\n- 2022-09-30: 1.1 final released.\n- 2022-08-22: 1.1 Release candidate 4 released.\n - Formalized the definition of specification and implementation [semantics](https://jsonapi.org/format/1.1/#semantics) .\n - Refined the definitions of [extensions](https://jsonapi.org/format/1.1/#extensions) and [profiles](https://jsonapi.org/format/1.1/#profiles) .\n - Clarified details regarding expected and allowed responses, query\n parameters, and more.\n- 2020-10-01: 1.1 Release candidate 3 released.\n - Refined links objects. The link object `params` member was removed to\n better align with other JSON link serializations. The `anchor` target\n attribute was also removed. It may be restored in a future minor release.\n- 2020-08-20: 1.1 Release candidate 2 released.\n - [Extensions](https://jsonapi.org/format/1.1/#extensions) were added and the\n scope of [profiles](https://jsonapi.org/format/1.1/#profiles) were reduced\n since their introduction in RC1.\n - [Links](https://github.com/json-api/json-api/pull/1348) can be represented\n as [RFC 8288](https://tools.ietf.org/html/rfc8288) -style web links.\n - A new [`describedby`](https://github.com/json-api/json-api/pull/1447) [links member](https://jsonapi.org/format/1.1/#document-top-level) was added so that implementors can incorporate description documents (e.g. [OpenAPI](https://www.openapis.org/) or [JSON Schema](https://json-schema.org/specification.html) )\n directly into their APIs.\n - [Local IDs](https://jsonapi.org/format/1.1/#document-resource-object-identification) were [introduced](https://github.com/json-api/json-api/pull/1244) so that a\n client can create a relationship to a resource yet-to-be created by the\n same request.\n- 2018-12-01: 1.1 Release candidate 1 released.\n - New features include: [profiles](https://jsonapi.org/format/1.1/#profiles) , [”@-Members”](https://jsonapi.org/format/1.1/#document-member-names-at-members) , and [error object `type` links](https://jsonapi.org/format/1.1/#error-objects) .\n - There are editorial clarifications around: [query parameters](https://jsonapi.org/format/1.1/#query-parameters) (their parsing/serialization, and reserved parameter names), the appropriate status code for [specific](https://github.com/json-api/json-api/pull/1036) [responses](https://github.com/json-api/json-api/pull/1029) , and the [presence of the `included` key](https://github.com/json-api/json-api/pull/1236) even when its value is an empty array.\n - JSON:API switched to [recommending camelCased names](https://jsonapi.org/recommendations/#naming) .\n- 2015-05-29: 1.0 final released.\n- 2015-05-21: 1.0 Release candidate 4 released.\n- 2015-03-16: 1.0 Release candidate 3 released.\n- 2015-02-18: 1.0 Release candidate 2 released.\n- 2014-07-05: 1.0 Release candidate 1 released.\n- 2013-07-21: Media type registration completed with the IANA.\n- 2013-05-03: Initial release of the draft.", "znaku_textu": 5097, "slov": 612, "odkazu": 48, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:22", "sha256": "6dc71fbf3521ab19af2e8885d8ee3d1f3c64c0c24fae5208d2e460c36e24e382", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://twitter.com/jsonapi", "https://twitter.com/", "http://freenode.net/", "https://discuss.jsonapi.org/", "https://twitter.com/wycats", "https://twitter.com/dgeb", "https://twitter.com/gabesullice", "https://twitter.com/jelhan1", "https://twitter.com/tkellen", "https://twitter.com/steveklabnik", "https://twitter.com/ethanresnick", "https://emberjs.com/", "https://github.com/rails-api/active_model_serializers", "https://github.com/json-api/json-api/pull/1348", "https://tools.ietf.org/html/rfc8288", "https://github.com/json-api/json-api/pull/1447", "https://www.openapis.org/", "https://json-schema.org/specification.html", "https://github.com/json-api/json-api/pull/1244", "https://github.com/json-api/json-api/pull/1036", "https://github.com/json-api/json-api/pull/1029", "https://github.com/json-api/json-api/pull/1236", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://github.com/json-api"]} {"url": "http://jsonapi.org/examples/", "titulek": "JSON:API — Examples", "h1": "Examples", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Examples"}, {"uroven": 2, "text": "Sparse Fieldsets"}, {"uroven": 2, "text": "Error Objects"}, {"uroven": 3, "text": "A Basic Error Object"}, {"uroven": 3, "text": "Multiple Errors"}, {"uroven": 3, "text": "Error Codes"}, {"uroven": 3, "text": "Advanced source Usage"}, {"uroven": 4, "text": "Invalid Query Parameters"}], "markdown": "# Examples\n\nThis page contains additional examples of how to apply various parts of the specification.\n\n## Sparse Fieldsets\n\nExamples of how [sparse fieldsets](http://jsonapi.org/format/#fetching-sparse-fieldsets) work.\n\nBasic request:\n\n```\nGET /articles?include=author HTTP/1.1 \n```\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\", \"body\": \"The shortest article. Ever.\", \"created\": \"2015-05-22T14:56:29.000Z\", \"updated\": \"2015-05-22T14:56:28.000Z\" }, \"relationships\": { \"author\": { \"data\": {\"id\": \"42\", \"type\": \"people\"} } } }], \"included\": [ { \"type\": \"people\", \"id\": \"42\", \"attributes\": { \"name\": \"John\", \"age\": 80, \"gender\": \"male\" } } ] } \n```\n\nRequest with `fields[articles]` and `fields[people]` parameters:\n\n```\nGET /articles?include=author&fields[articles]=title,body,author&fields[people]=name HTTP/1.1 \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply\n> for readability. In practice, these characters should be percent-encoded, as\n> noted in the base specification. See “[Square Brackets in Parameter Names](/format/1.1/#appendix-query-details-square-brackets)”.\n\nHere we want `articles` objects to have fields `title`, `body` and `author` only and `people` objects to have `name` field only.\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\", \"body\": \"The shortest article. Ever.\" }, \"relationships\": { \"author\": { \"data\": {\"id\": \"42\", \"type\": \"people\"} } } }], \"included\": [ { \"type\": \"people\", \"id\": \"42\", \"attributes\": { \"name\": \"John\" } } ] } \n```\n\nPay attention to the fact that you have to add a relationship name both in `include` and `fields` (since relationships are fields too), otherwise you’ll get:\n\n```\nGET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 \n```\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\", \"body\": \"The shortest article. Ever.\" } }], \"included\": [ { \"type\": \"people\", \"id\": \"42\", \"attributes\": { \"name\": \"John\" } } ] } \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply\n> for readability. In practice, these characters should be percent-encoded, as\n> noted in the base specification. See “[Square Brackets in Parameter Names](/format/1.1/#appendix-query-details-square-brackets)”.\n\nExample of a page-based strategy on how to add [pagination links](http://jsonapi.org/format/#fetching-pagination).\n\nBasic request:\n\n```\nGET /articles?page[number]=3&page[size]=1 HTTP/1.1 \n```\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"meta\": { \"totalPages\": 13 }, \"data\": [ { \"type\": \"articles\", \"id\": \"3\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\", \"body\": \"The shortest article. Ever.\", \"created\": \"2015-05-22T14:56:29.000Z\", \"updated\": \"2015-05-22T14:56:28.000Z\" } } ], \"links\": { \"self\": \"http://example.com/articles?page[number]=3&page[size]=1\", \"first\": \"http://example.com/articles?page[number]=1&page[size]=1\", \"prev\": \"http://example.com/articles?page[number]=2&page[size]=1\", \"next\": \"http://example.com/articles?page[number]=4&page[size]=1\", \"last\": \"http://example.com/articles?page[number]=13&page[size]=1\" } } \n```\n\n> Note: The above example URIs show unencoded `[` and `]` characters simply\n> for readability. In practice, these characters should be percent-encoded, as\n> noted in the base specification. See “[Square Brackets in Parameter Names](/format/1.1/#appendix-query-details-square-brackets)”.\n\n> Note: Putting a property like `\"totalPages\"` in `\"meta\"` can be a convenient way\n> to indicate to clients the total number of pages in a collection (as opposed to\n> the `\"last\"` link, which simply gives the URI of the last page). However, all\n> `\"meta\"` values are implementation-specific, so you can call this member whatever\n> you like (`\"total\"`, `\"count\"`, etc.) or not use it at all.\n\n## Error Objects\n\nExamples of how [error objects](http://jsonapi.org/format/#error-objects) work.\n\n### A Basic Error Object\n\nIn the response below, the server is indicating that it encountered an error\nwhile creating/updating the resource, and that this error was caused\nby an invalid `\"firstName\"` attribute:\n\n```\nHTTP/1.1 422 Unprocessable Entity Content-Type: application/vnd.api+json { \"errors\": [ { \"status\": \"422\", \"source\": { \"pointer\": \"/data/attributes/firstName\" }, \"title\": \"Invalid Attribute\", \"detail\": \"First name must contain at least two characters.\" } ] } \n```\n\nEvery member in an error object is optional, but all help the client\nby providing extra details.\n\nThe `source` member is used to [indicate](https://tools.ietf.org/html/rfc6901)\nwhich part of the request document caused the error.\n\nThe `title` and `detail` members are similar, but `detail` is specific\nto this occurrence of the problem, whereas `title` is more generic.\n\nThe `status` member represents the HTTP status code associated with the problem.\nIt’s very helpful when multiple errors are returned at once (see below), as the\nHTTP response itself can only have one status code. However, it can also be\nuseful for single errors, to save clients the trouble of consulting the HTTP\nheaders, or for using JSON:API over non-HTTP protocols, which may be officially\nsupported in the near future.\n\n### Multiple Errors\n\nWhen multiple errors occur in response to a single request, the server\ncan simply add each error to the `errors` array:\n\n```\nHTTP/1.1 400 Bad Request Content-Type: application/vnd.api+json { \"errors\": [ { \"status\": \"403\", \"source\": { \"pointer\": \"/data/attributes/secretPowers\" }, \"detail\": \"Editing secret powers is not authorized on Sundays.\" }, { \"status\": \"422\", \"source\": { \"pointer\": \"/data/attributes/volume\" }, \"detail\": \"Volume does not, in fact, go to 11.\" }, { \"status\": \"500\", \"source\": { \"pointer\": \"/data/attributes/reputation\" }, \"title\": \"The backend responded with an error\", \"detail\": \"Reputation service not responding after three requests.\" } ] } \n```\n\nThe only uniqueness constraint on error objects is the `id` field. Thus,\nmultiple errors on the same attribute can each be given their own error\nobject. The example below shows multiple errors on the `\"firstName\"` attribute:\n\n```\nHTTP/1.1 422 Unprocessable Entity Content-Type: application/vnd.api+json { \"errors\": [ { \"source\": { \"pointer\": \"/data/attributes/firstName\" }, \"title\": \"Invalid Attribute\", \"detail\": \"First name must contain at least two characters.\" }, { \"source\": { \"pointer\": \"/data/attributes/firstName\" }, \"title\": \"Invalid Attribute\", \"detail\": \"First name must contain an emoji.\" } ] } \n```\n\n> Note: in the responses above with a 422 status code, `400 Bad Request` would\n> also be acceptable. ([More details.](http://stackoverflow.com/a/20215807/1261879))\n> JSON:API doesn’t take a position on 400 vs. 422.\n\n### Error Codes\n\nThe `code` member of an error object contains an application-specific code\nrepresenting the type of problem encountered. `code` is similar to `title`\nin that both identify a general type of problem (unlike `detail`, which is\nspecific to the particular instance of the problem), but dealing with `code`\nis easier programmatically, because the “same” `title` may appear in different\nforms due to localization.\n\nFor the example below, imagine the API docs specified the following mapping:\n\n| Code | Problem |\n| --- | --- |\n| 123 | Value too short |\n| 225 | Password lacks a letter, number, or punctuation character |\n| 226 | Passwords do not match |\n| 227 | Password cannot be one of last five passwords |\n\nMultiple errors on `\"password\"` attribute, with error `code`:\n\n```\nHTTP/1.1 422 Unprocessable Entity Content-Type: application/vnd.api+json { \"jsonapi\": { \"version\": \"1.1\" }, \"errors\": [ { \"code\": \"123\", \"source\": { \"pointer\": \"/data/attributes/firstName\" }, \"title\": \"Value is too short\", \"detail\": \"First name must contain at least two characters.\" }, { \"code\": \"225\", \"source\": { \"pointer\": \"/data/attributes/password\" }, \"title\": \"Passwords must contain a letter, number, and punctuation character.\", \"detail\": \"The password provided is missing a punctuation character.\" }, { \"code\": \"226\", \"source\": { \"pointer\": \"/data/attributes/password\" }, \"title\": \"Password and password confirmation do not match.\" } ] } \n```\n\nNotice that this response includes not only the `errors` top-level member,\nbut the `jsonapi` top-level member. Error responses cannot contain the\ntop-level `data` member, but can include all the other top-level members\nJSON:API defines.\n\nAlso, notice that the third error object lacks a `detail` member (perhaps\nfor security). Again, all error object members are optional.\n\n### Advanced `source` Usage\n\nIn the example below, the user is sending an invalid JSON:API\nrequest, because it’s missing the `data` member:\n\n```\nPATCH /posts/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"datum\": [ ] } \n```\n\nTherefore, the server responds:\n\n```\nHTTP/1.1 422 Unprocesssable Entity Content-Type: application/vnd.api+json { \"errors\": [ { \"source\": { \"pointer\": \"\" }, \"detail\": \"Missing `data` Member at document's top level.\" } ] } \n```\n\nIt uses `source` to point to the top-level of the document (`\"\"`).\n(Pointing to “/” would be an appropriate reference to the string\n`\"some value\"` in the request document `{\"\": \"some value\"}`.\nPointing to `\"/data\"` would be invalid because the request document did\nnot have a value at `\"/data\"`, and `source` is always given with reference\nto the request document.)\n\nIf the server cannot parse the request as valid JSON, including\n`source` doesn’t make sense (because there’s no JSON document for `source` to\nrefer to). Here’s how the server might respond to an invalid JSON document:\n\n```\n{ \"errors\": [{ \"status\": \"400\", \"detail\": \"JSON parse error - Expecting property name at line 1 column 2 (char 1).\" }] } \n```\n\n#### Invalid Query Parameters\n\nThe `source` member can also be used to indicate that the error originated\nfrom a problem with a URI query parameter, like so:\n\n```\nGET /api/posts/1?include=author HTTP/1.1 \n```\n\n```\nHTTP/1.1 400 Bad Request Content-Type: application/vnd.api+json { \"errors\": [ { \"source\": { \"parameter\": \"include\" }, \"title\": \"Invalid Query Parameter\", \"detail\": \"The resource does not have an `author` relationship path.\" } ] } \n```\n\nIn most cases, JSON:API requires the server to return an error when it encounters\nan invalid value for a JSON:API–defined query parameter. However, for API-specific\nquery parameters (i.e. those not defined by JSON:API), a server may choose to\nignore an invalid parameter and have the request succeed, rather than respond with\nan error. [API-specific query parameters must contain one non a-z\ncharacter.](http://jsonapi.org/format/#query-parameters)\n\nOther examples of invalid parameters include: `?fields[people]=` (invalid parameter name;\nshould be `fields[people]`) and `?redirect_to=http%3A%2F%2Fwww.owasp.org` (invalid parameter,\nin this case, a phishing attack), etc.", "znaku_textu": 10836, "slov": 1520, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:13", "sha256": "3d78cf8a8a76ae04bdf82eac6c08e8163f8f89f8ec8aee44690789a8bc37d46e", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://tools.ietf.org/html/rfc6901", "http://stackoverflow.com/a/20215807/1261879", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/ext/atomic", "titulek": "JSON:API — Atomic Operations", "h1": "Atomic Operations", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Atomic Operations"}, {"uroven": 2, "text": "URI"}, {"uroven": 2, "text": "Namespace"}, {"uroven": 2, "text": "Document Structure"}, {"uroven": 3, "text": "Operation Objects"}, {"uroven": 3, "text": "Result Objects"}, {"uroven": 2, "text": "Processing"}, {"uroven": 3, "text": "Processing Errors"}, {"uroven": 3, "text": "Processing Specific Operations"}, {"uroven": 4, "text": "Creating Resources"}, {"uroven": 5, "text": "Responses"}, {"uroven": 4, "text": "Updating Resources"}, {"uroven": 5, "text": "Responses"}, {"uroven": 4, "text": "Deleting Resources"}, {"uroven": 5, "text": "Responses"}, {"uroven": 4, "text": "Updating To-One Relationships"}, {"uroven": 5, "text": "Responses"}, {"uroven": 4, "text": "Updating To-Many Relationships"}, {"uroven": 5, "text": "Responses"}, {"uroven": 3, "text": "Processing Multiple Operations"}], "markdown": "# Atomic Operations\n\nThis extension provides a means to perform multiple “operations” in a linear and\natomic manner. Operations are a serialized form of the mutations allowed in the\nbase JSON:API specification.\n\nClients can send an array of operations in a single request. This extension\nguarantees that those operations will be processed in order and will either\ncompletely succeed or fail together.\n\n## URI\n\nThis extension has the URI `https://jsonapi.org/ext/atomic`.\n\n## Namespace\n\nThis extension uses the namespace `atomic`.\n\n> Note: JSON:API extensions can only introduce new document members using a\n> reserved namespace as a prefix.\n\n## Document Structure\n\nA document that supports this extension **MAY** include any of the top-level\nmembers allowed by the base specification with the exception of `data` and\n`included`, which **MUST NOT** be included.\n\nIn addition, such a document **MAY** include either of the following members,\nbut not both:\n\n- `atomic:operations` - an array of one or more operation\nobjects.\n- `atomic:results` - an array of one or more result objects.\n\nIf either `atomic:operations` or `atomic:results` is present, the `errors`\nmember **MUST NOT** be included in the same document.\n\n### Operation Objects\n\nAn operation object **MUST** contain the following member:\n\n- `op`: an operation code, expressed as a string, that indicates the type of\noperation to perform. The value **MUST** be one of the following:\n - `\"add\"` : creates a new resource or relationship\n - `\"update\"` : updates a resource or relationship\n - `\"remove\"` : removes a resource or relationship\n\nAn operation object **MAY** contain either of the following members, but not\nboth, to specify the target of the operation:\n\n- `ref`: an object that **MUST** contain one of the following combinations of\nmembers:\n - `type` and `id` : to target an individual resource.\n - `type` and `lid` : to target an individual resource that has been assigned a\n local identity ( `lid` ) in a prior operation object.\n - `type` , `id` , and `relationship` : to target the relationship of an\n individual resource.\n - `type` , `lid` , and `relationship` : to target the relationship of an\n individual resource that has been assigned a local identity ( `lid` ) in a\n prior operation object.\n- `href`: a string that contains a URI-reference [[RFC3986 Section\n4.1](https://tools.ietf.org/html/rfc3986#section-4.1)] that identifies the\ntarget of the operation.\n\nSome specific types of operations require inclusion of `ref` or `href`, as\ndescribed below.\n\nAn operation object **MAY** also contain any of the following members:\n\n- `data`: the operation’s “primary data”.\n- `meta`: a meta object that contains non-standard\nmeta-information about the operation.\n\nDifferent members are required for processing different types of operations, as\ndescribed below.\n\n### Result Objects\n\nAn operation result object **MAY** contain any of the following members:\n\n- `data`: the “primary data” resulting from the operation.\n- `meta`: a meta object that contains non-standard\nmeta-information about the result.\n\nAn empty result object (`{}`) is acceptable for operations that are not required\nto return `data`.\n\n## Processing\n\nAll HTTP requests sent with this extension **MUST** be issued with `POST`.\n\nA server **MUST** perform operations in the order they appear in the\n`atomic:operations` array.\n\nA server **MUST** perform all operations atomically, so that a failure\nto perform any operation **MUST** invalidate any effects of preceding\noperations.\n\nA server **MUST** respond to a successful operations request with `200 OK` if a\nresponse document is returned. An array of result objects **MUST** be returned in a top-level `atomic:results` member. The results array\n**MUST** be the same length as the requested operations array and each result\n**MUST** correspond positionally to its associated operation.\n\nA server **MAY** respond to successful requests that include operations with\n`204 No Content` and no response document if no operations are required to\nreturn `data`.\n\n### Processing Errors\n\nIf any operation in a request fails, the server **MUST** respond as described\n[in the base specification](/format/#errors-processing). An array of one or\nmore [error objects](/format/#error-objects) **SHOULD** be returned, each with\na `source` member that contains a `pointer` to the source of the problem in the\nrequest document.\n\nIf a requested operation is malformed or incomplete, then a server **MUST**\nrespond with a `400 Bad Request` and **SHOULD** include a document with a\ntop-level `errors` member that contains an error object. The error object\n**SHOULD** include a `source` member with a `pointer` to the invalid operation.\n\nIf an operation is properly formed, but cannot be processed by a server, the\nserver **MUST** respond with a `400 Bad Request` or a more appropriate error\nresponse (e.g. `409 Conflict` or `422 Unprocessable Entity`) and **SHOULD**\ninclude a document with a top-level `errors` member that contains one or more\nerror objects that provide further details.\n\n### Processing Specific Operations\n\nThe following sections describe how to process specific operations.\n\n#### Creating Resources\n\nAn operation that creates a resource **MAY** target a resource collection\nthrough the operation’s `href` member.\n\nThe operation **MUST** include an `op` code of `\"add\"` as well as a resource\nobject as `data`. The resource object **MUST** contain at least a `type` member.\n\nFor example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"add\", \"href\": \"/blogPosts\", \"data\": { \"type\": \"articles\", \"attributes\": { \"title\": \"JSON API paints my bikeshed!\" } } }] } \n```\n\nNote that `href` is used in this example to target a resource collection,\n`blogPosts` in this case, that is distinct from the `type` of the resource.\nThe usage of `href` is entirely optional for this extension, but could be\nrequired by an individual implementation.\n\n##### Responses\n\nIf the server is able to create a resource with a client-generated ID and its\nrepresentation would be identical to the resource in the operation, then the\nserver **MAY** return a result with no `data` member or it **MAY** return a\nresult that contains the created resource as `data`.\n\nIn all other cases in which the server is able to successfully create the\nresource, the server **MUST** return a result that contains the created resource\nas `data`.\n\nFor example:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:results\": [{ \"data\": { \"links\": { \"self\": \"http://example.com/blogPosts/13\" }, \"type\": \"articles\", \"id\": \"13\", \"attributes\": { \"title\": \"JSON API paints my bikeshed!\" } } }] } \n```\n\nIf the server is unable to create the resource, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n#### Updating Resources\n\nAn operation that updates a resource **MAY** target that resource through the\noperation’s `ref` or `href` members, but not both.\n\nThe operation **MUST** include an `op` code of `\"update\"`.\n\nFor example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"update\", \"data\": { \"type\": \"articles\", \"id\": \"13\", \"attributes\": { \"title\": \"To TDD or Not\" } } }] } \n```\n\n##### Responses\n\nIf a server accepts an update but also changes the resource in ways other than\nthose specified by the request (for example, updating the `updatedAt` attribute\nor a computed `sha`), then the server **MUST** return a result that includes a\nrepresentation of the updated resource as `data`.\n\nIf a server accepts an update and doesn’t update any fields besides those\nprovided, the server **MUST** return a result that includes either no `data` or\na representation of the resource as `data` or, if all results are empty, the\nserver **MAY** respond with `204 No Content` and no document.\n\nIf a server is unable to update the resource, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n#### Deleting Resources\n\nAn operation that deletes a resource **MUST** target that resource through the\noperation’s `ref` or `href` members, but not both.\n\nThe operation **MUST** include an `op` code of `\"remove\"`.\n\nFor example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"remove\", \"ref\": { \"type\": \"articles\", \"id\": \"13\" } }] } \n```\n\n##### Responses\n\nIf a server is able to delete the resource, the server **MUST** return a result\nwith no `data` or, if all results are empty, the server **MAY** respond with\n`204 No Content` and no document.\n\nIf a server is unable to delete the resource, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n#### Updating To-One Relationships\n\nAn operation that updates a resource’s to-one relationship **MUST** target that\nrelationship through the operation’s `ref` or `href` members, but not both.\n\nThe operation **MUST** include an `op` code of `\"update\"`.\n\nFor example, the following request assigns a to-one relationship:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"update\", \"ref\": { \"type\": \"articles\", \"id\": \"13\", \"relationship\": \"author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }] } \n```\n\nAnd the following request clears a to-one relationship:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"update\", \"ref\": { \"type\": \"articles\", \"id\": \"13\", \"relationship\": \"author\" }, \"data\": null }] } \n```\n\n##### Responses\n\nIf a server is able to update the relationship, the server **MUST** return a\nresult with no `data` or, if all results are empty, the server **MAY** respond\nwith `204 No Content` and no document.\n\nIf a server is unable to update the relationship, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n#### Updating To-Many Relationships\n\nAn operation that updates a resource’s to-many relationship **MUST** target that\nrelationship through the operation’s `ref` or `href` members, but not both.\n\nTo add members to a to-many relationship, the operation **MUST** include an\n`op` code of `\"add\"`. For example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"add\", \"ref\": { \"type\": \"articles\", \"id\": \"1\", \"relationship\": \"comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"123\" } ] }] } \n```\n\nTo replace all the members of a to-many relationship, the operation **MUST**\ninclude an `op` code of `\"update\"`. For example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"update\", \"ref\": { \"type\": \"articles\", \"id\": \"1\", \"relationship\": \"tags\" }, \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] }] } \n```\n\nTo remove members from a to-many relationship, the operation **MUST** include an\n`op` code of `\"remove\"`. For example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"remove\", \"ref\": { \"type\": \"articles\", \"id\": \"1\", \"relationship\": \"comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"12\" }, { \"type\": \"comments\", \"id\": \"13\" } ] }] } \n```\n\n##### Responses\n\nIf a server is able to update the relationship, the server **MUST** return a\nresult with no `data` or, if all results are empty, the server **MAY** respond\nwith `204 No Content` and no document.\n\nIf a server is unable to update the relationship, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n### Processing Multiple Operations\n\nThe above examples all perform a single operation that aligns with an equivalent\nsingular request from the base spec. Yet, the primary value of this extension is\nthat unlocks the ability to perform more than one action linearly and\natomically.\n\nThe following example adds two resources and creates a relationship between them\nin a single request:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"add\", \"data\": { \"type\": \"authors\", \"id\": \"acb2ebd6-ed30-4877-80ce-52a14d77d470\", \"attributes\": { \"name\": \"dgeb\" } } }, { \"op\": \"add\", \"data\": { \"type\": \"articles\", \"id\": \"bb3ad581-806f-4237-b748-f2ea0261845c\", \"attributes\": { \"title\": \"JSON API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"authors\", \"id\": \"acb2ebd6-ed30-4877-80ce-52a14d77d470\" } } } } }] } \n```\n\nA server might respond to this request as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:results\": [{ \"data\": { \"links\": { \"self\": \"http://example.com/authors/acb2ebd6-ed30-4877-80ce-52a14d77d470\" }, \"type\": \"authors\", \"id\": \"acb2ebd6-ed30-4877-80ce-52a14d77d470\", \"attributes\": { \"name\": \"dgeb\" } } }, { \"data\": { \"links\": { \"self\": \"http://example.com/articles/bb3ad581-806f-4237-b748-f2ea0261845c\" }, \"type\": \"articles\", \"id\": \"bb3ad581-806f-4237-b748-f2ea0261845c\", \"attributes\": { \"title\": \"JSON API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/bb3ad581-806f-4237-b748-f2ea0261845c/relationships/author\", \"related\": \"http://example.com/articles/bb3ad581-806f-4237-b748-f2ea0261845c/author\" } } } } }] } \n```\n\n> Note that this operations request could also have been structured to add the\n> author, then add the article, then add the relationship between them.\n\n> Also note that local identities, i.e. `lid` members, are particularly useful\n> for requests that involve multiple operations. Local identities can be used to\n> associate resources that have not yet been assigned an `id`.", "znaku_textu": 14528, "slov": 2129, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:27", "sha256": "c096bba0bb23799f31e65a7a9dca3379b643c0ae73ee49757a743fd883c52a5a", "hloubka": 4, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://tools.ietf.org/html/rfc3986", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/extensions/", "titulek": "JSON:API — Extensions and Profiles", "h1": "Extensions and Profiles", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Extensions and Profiles"}, {"uroven": 2, "text": "Extensions"}, {"uroven": 2, "text": "Profiles"}], "markdown": "# Extensions and Profiles\n\nThe JSON:API specification provides a way to define new functionality not\nprovided by the base specification using [extensions](/format/#extensions). Additionally, it\nprovides a means to share a particular usage of the specification among\nimplementations using [profiles](/format/#profiles).\n\nGenerally speaking, extensions provide a means to standardize a functionality\nthat is not so widely needed that it should be part of the base specification\nbut is general enough that it would benefit the community to have a standard.\nTypically, that functionality is also too difficult and/or unconventional to\nimplement using only the parts of the specification that are reserved for\nimplementations (e.g. implementations can add their own members to\n[`attributes`](/format/#document-resource-object-attributes) objects, but can’t add new members to a resource\nidentifier).\n\nProfiles, on the other hand, are a way to standardize common usages of the base\nspecification that *are* simple to implement using only the parts of the\nspecification that are reserved for implementations (e.g. a common way to\nhandle [pagination](/format/#fetching-pagination)).\n\nOne major difference between extensions and profiles is that an extension must\nbe agreed upon and understood by both the client and the server, while a\nprofile can be safely ignored if either the client or the server does not\nrecognize it.\n\nSome useful extensions and profiles are listed below. However, an extension or\nprofile does not need to appear below to be valid. Anyone can author and host\nan extension or profile document using their own domain for its URI.\n\nIn order to keep the promise of JSON:API as an anti-bikeshedding tool,\nimplementors are **strongly** encouraged to reuse, improve, and collaborate on\ncommon extensions and profiles instead of creating new extensions and profiles\nbecause of trivial or aesthetic differences.\n\nThe extensions and profiles listed on this page have been reviewed by the\nJSON:API specification [editors](/about/#editors) and are considered:\n\n- Compatible with the base specification\n- Able to evolve without backward incompatibilities\n- Broadly useful\n\nNot every extension or profile can or should appear on this page. This listing\nis maintained on a best-effort basis.\n\n## Extensions\n\n- [Atomic Operations](/ext/atomic)\n - URI: `https://jsonapi.org/ext/atomic`\n - Namespace: `atomic`\n - Description: This extension provides a means to perform multiple\n “operations” in a linear and atomic manner.\n\n## Profiles\n\n- [Cursor Pagination](/profiles/ethanresnick/cursor-pagination)\n - URI: `https://jsonapi.org/profiles/ethanresnick/cursor-pagination`\n - Description: Cursor-based pagination (aka keyset pagination) is a\n common pagination strategy that avoids many of the pitfalls of\n “offset–limit” pagination.", "znaku_textu": 2785, "slov": 395, "odkazu": 24, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:05", "sha256": "8216b8f4ed9573e3e2797e1bf4131950329793dffeb0865c11c805cf3c3e9d36", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/faq/", "titulek": "JSON:API — Frequently Asked Questions", "h1": "Frequently Asked Questions", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Frequently Asked Questions"}, {"uroven": 2, "text": "What is the meaning of JSON:API’s version?"}, {"uroven": 2, "text": "Why not use the HAL specification?"}, {"uroven": 2, "text": "How can I discover a resource’s supported actions?"}, {"uroven": 2, "text": "Where’s PUT?"}, {"uroven": 2, "text": "Is there a JSON Schema describing JSON:API?"}, {"uroven": 2, "text": "Why are resource collections returned as arrays instead of sets keyed by ID?"}, {"uroven": 2, "text": "Does JSON:API take any position on URI structure, on rules for custom endpoints, which do not fit the paradigm of GET/POST/PATCH/DELETE on the resource URI, etc.?"}], "markdown": "# Frequently Asked Questions\n\n## What is the meaning of JSON:API’s version?\n\nNow that JSON:API has reached a stable version 1.0, it will always be\nbackwards compatible using a *never remove, only add* strategy.\n\nA version is maintained in order to:\n\n- allow tracking of additive changes to the specification.\n- know what features a particular implementation *may potentially* support.\n\n## Why not use the HAL specification?\n\nThere are several reasons:\n\n- HAL embeds child documents recursively, while JSON:API flattens the entire\ngraph of objects at the top level. This means that if the same “people” are\nreferenced from different kinds of objects (say, the author of both posts and\ncomments), this format ensures that there is only a single representation of\neach person document in the payload.\n- Similarly, JSON:API uses IDs for linkage, which makes it possible to cache\ndocuments from compound responses and then limit subsequent requests to only\nthe documents that aren’t already present locally. If you’re lucky, this can\neven completely eliminate HTTP requests.\n- HAL is a serialization format, but says nothing about how to update\ndocuments. JSON:API thinks through how to update existing records (leaning on\nPATCH and JSON Patch), and how those updates interact with compound documents\nreturned from GET requests. It also describes how to create and delete\ndocuments, and what 200 and 204 responses from those updates mean.\n\nIn short, JSON:API is an attempt to formalize similar ad hoc client-server\ninterfaces that use JSON as an interchange format. It is specifically focused\naround using those APIs with a smart client that knows how to cache documents it\nhas already seen and avoid asking for them again.\n\nIt is extracted from a real-world library already used by a number of projects,\nwhich has informed both the request/response aspects (absent from HAL) and the\ninterchange format itself.\n\n## How can I discover a resource’s supported actions?\n\nWhenever a client requests a URI, the server can include an [`Allow` header](https://tools.ietf.org/html/rfc7231#section-7.4.1)\nin its response to indicate the methods the requested resource supports. Servers\nwishing to support method discovery should include this header. The client can\nthen send a [`HEAD`](https://tools.ietf.org/html/rfc7231#section-4.3.2) request\n(or any other type of request) to the URI in order to discover its supported methods.\n\nFor instance, a client might request `HEAD /articles`, and the response could\ncontain the header `Allow: GET,POST`, indicating that the client can GET the\ncollection and also POST to it to create new resources.\n\nJSON:API is still working on a way for resources to advertise and detail\nnon-standard actions they support. Feel free to\n[join that discussion](https://github.com/json-api/json-api/issues/745)!\n\n## Where’s PUT?\n\nUsing PUT to partially update a resource (i.e. to change only some of its state)\nis not allowed by the\n[HTTP specification](https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.4).\nInstead, PUT is supposed to completely replace the state of a resource:\n\n> “The PUT method requests that the state of the target resource be **created\n> or replaced** with the state…in the request message payload. A successful PUT\n> of a given representation would suggest that a subsequent GET on that same\n> target resource will result in an equivalent representation being sent…”\n\nThe correct method for partial updates, therefore, is [PATCH](https://datatracker.ietf.org/doc/html/rfc5789),\nwhich is what JSON:API uses. And because PATCH can also be used compliantly for\nfull resource replacement, JSON:API hasn’t needed to define any behavior for\nPUT so far. However, it may define PUT semantics in the future.\n\nIn the past, many APIs used PUT for partial updates because PATCH wasn’t yet\nwell-supported. However, almost all clients now support PATCH, and those that\ndon’t can be easily [worked around](/recommendations/#patchless-clients).\n\n## Is there a JSON Schema describing JSON:API?\n\nYes, you can find the JSON Schema definition at\n[http://jsonapi.org/schema](http://jsonapi.org/schema). This schema is as\nrestrictive as possible, but has flexibility to be extended within your\ndocumentation. Validation will not yield false negatives, but could yield false\npositives for the sake of flexibility.\n\nYou can find more information about the JSON Schema format at\n[http://json-schema.org](http://json-schema.org).\n\n## Why are resource collections returned as arrays instead of sets keyed by ID?\n\nA JSON array is naturally ordered while sets require metadata to specify order\namong members. Therefore, arrays allow for more natural sorting by default or\nspecified criteria.\n\nPrimary resources should be isolated because their order and number is often\nsignificant. It’s necessary to separate primary and related resources by more\nthan type because it’s possible that a primary resource may have related\nresources of the same type (e.g. the “parents” of a “person”). Nesting related\nresources in `included` prevents this possible conflict.\n\n## Does JSON:API take any position on URI structure, on rules for custom endpoints, which do not fit the paradigm of GET/POST/PATCH/DELETE on the resource URI, etc.?\n\nJSON:API has no requirements about URI structure, implementations are free to use whatever form they wish.", "znaku_textu": 5281, "slov": 800, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:19", "sha256": "35cdbe7867d6a7d4563b907b89849c5c9636118a4549cf618310cf72db5c0545", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://tools.ietf.org/html/rfc7231", "https://github.com/json-api/json-api/issues/745", "https://datatracker.ietf.org/doc/html/rfc7231", "https://datatracker.ietf.org/doc/html/rfc5789", "http://json-schema.org/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/format", "titulek": "JSON:API — Latest Specification (v1.1)", "h1": "Latest Specification (v1.1)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Latest Specification (v1.1)"}, {"uroven": 2, "text": "Status"}, {"uroven": 2, "text": "Introduction"}, {"uroven": 2, "text": "Semantics"}, {"uroven": 2, "text": "Conventions"}, {"uroven": 2, "text": "The JSON:API Media Type"}, {"uroven": 3, "text": "Media Type Parameters"}, {"uroven": 3, "text": "Extensions"}, {"uroven": 3, "text": "Profiles"}, {"uroven": 3, "text": "Rules for Media Type Parameters"}, {"uroven": 4, "text": "Rules for Extensions"}, {"uroven": 4, "text": "Rules for Profiles"}, {"uroven": 2, "text": "Content Negotiation"}, {"uroven": 3, "text": "Universal Responsibilities"}, {"uroven": 3, "text": "Client Responsibilities"}, {"uroven": 3, "text": "Server Responsibilities"}, {"uroven": 2, "text": "Document Structure"}, {"uroven": 3, "text": "Top Level"}, {"uroven": 3, "text": "Resource Objects"}, {"uroven": 4, "text": "Identification"}, {"uroven": 4, "text": "Fields"}, {"uroven": 5, "text": "Attributes"}, {"uroven": 5, "text": "Relationships"}, {"uroven": 5, "text": "Resource Linkage"}, {"uroven": 4, "text": "Resource Links"}, {"uroven": 3, "text": "Resource Identifier Objects"}, {"uroven": 3, "text": "Compound Documents"}, {"uroven": 3, "text": "Meta Information"}, {"uroven": 3, "text": "Links"}, {"uroven": 4, "text": "Link objects"}, {"uroven": 3, "text": "JSON:API Object"}, {"uroven": 3, "text": "Member Names"}, {"uroven": 4, "text": "Allowed Characters"}, {"uroven": 4, "text": "Reserved Characters"}, {"uroven": 4, "text": "@-Members"}, {"uroven": 4, "text": "Extension Members"}, {"uroven": 2, "text": "Fetching Data"}, {"uroven": 3, "text": "Fetching Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Fetching Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Sparse Fieldsets"}, {"uroven": 3, "text": "Sorting"}, {"uroven": 3, "text": "Filtering"}, {"uroven": 2, "text": "Creating, Updating and Deleting Resources"}, {"uroven": 3, "text": "Creating Resources"}, {"uroven": 4, "text": "Client-Generated IDs"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "201 Created"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Resources"}, {"uroven": 4, "text": "Updating a Resource’s Attributes"}, {"uroven": 4, "text": "Updating a Resource’s Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Relationships"}, {"uroven": 4, "text": "Updating To-One Relationships"}, {"uroven": 4, "text": "Updating To-Many Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Deleting Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "404 NOT FOUND"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 2, "text": "Query Parameters"}, {"uroven": 3, "text": "Query Parameter Families"}, {"uroven": 3, "text": "Extension-Specific Query Parameters"}, {"uroven": 3, "text": "Implementation-Specific Query Parameters"}, {"uroven": 2, "text": "Errors"}, {"uroven": 3, "text": "Processing Errors"}, {"uroven": 3, "text": "Error Objects"}, {"uroven": 2, "text": "Appendix"}, {"uroven": 3, "text": "Query Parameters Details"}, {"uroven": 4, "text": "Parsing/Serialization"}, {"uroven": 4, "text": "Square Brackets in Parameter Names"}], "markdown": "# Latest Specification (v1.1)\n\n## Status\n\nThis page presents the latest published version of JSON:API, which is\n currently version 1.1. New versions of JSON:API **will\n always be backwards compatible** using a *never remove, only add* strategy.\n Additions can be proposed in our [discussion forum](http://discuss.jsonapi.org/).\n\nIf you catch an error in the specification’s text, or if you write an\n implementation, please let us know by opening an issue or pull request at our\n [GitHub repository](https://github.com/json-api/json-api).\n\n## Introduction\n\nJSON:API is a specification for how a client should request that resources be\nfetched or modified, and how a server should respond to those requests. JSON:API\ncan be easily extended with extensions and profiles.\n\nJSON:API is designed to minimize both the number of requests and the amount of\ndata transmitted between clients and servers. This efficiency is achieved\nwithout compromising readability, flexibility, or discoverability.\n\nJSON:API requires use of the JSON:API media type\n([`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json))\nfor exchanging data.\n\n## Semantics\n\nAll document members, query parameters, and processing rules defined by\nthis specification are collectively called “specification semantics”.\n\nCertain document members, query parameters, and processing rules are reserved\nfor implementors to define at their discretion. These are called “implementation\nsemantics”.\n\nAll other semantics are reserved for potential future use by this specification.\n\n## Conventions\n\nThe key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,\n“SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this\ndocument are to be interpreted as described in\n[BCP 14](https://tools.ietf.org/html/bcp14)\n[[RFC2119](https://tools.ietf.org/html/rfc2119)]\n[[RFC8174](https://tools.ietf.org/html/rfc8174)]\nwhen, and only when, they appear in all capitals, as shown here.\n\n## The JSON:API Media Type\n\nThe JSON:API media type is\n[`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).\n\n### Media Type Parameters\n\nThe JSON:API specification supports two media type parameters: `ext` and\n`profile`, which are used to specify extensions and profiles, respectively.\n\n> Note: A media type parameter is an extra piece of information that can\n> accompany a media type. For example, in the header\n> `Content-Type: text/html;charset=\"utf-8\"`, the media type is `text/html` and\n> `charset` is a parameter.\n\n### Extensions\n\nExtensions provide a means to “extend” the base specification by defining\nadditional specification semantics.\n\nExtensions cannot alter or remove specification semantics, nor can they specify\nimplementation semantics.\n\n### Profiles\n\nProfiles provide a means to share a particular usage of the specification among\nimplementations.\n\nProfiles can specify implementation semantics, but cannot alter,\nadd to, or remove specification semantics.\n\n### Rules for Media Type Parameters\n\nThe JSON:API media type **MUST NOT** be specified with any media type parameters\nother than `ext` and `profile`. The `ext` parameter is used to support\nextensions and the `profile` parameter is used to support profiles.\n\nExtensions and profiles are each uniquely identified by a\n[URI](https://tools.ietf.org/html/rfc3986). Visiting an extension’s or a\nprofile’s URI **SHOULD** return documentation that describes its usage. The\nvalues of the `ext` and `profile` parameters **MUST** equal a space-separated\n(U+0020 SPACE, “ “) list of extension or profile URIs, respectively.\n\n> Note: When serializing the `ext` or `profile` media type parameters, the HTTP\n> specification requires that parameter values be surrounded by quotation marks\n> (U+0022 QUOTATION MARK, “\"”).\n\n#### Rules for Extensions\n\nAn extension **MAY** impose additional processing rules or further restrictions\nand it **MAY** define new object members as described below.\n\nAn extension **MUST NOT** lessen or remove any processing rules, restrictions or\nobject member requirements defined in this specification or other extensions.\n\nAn extension **MAY** define new members within the document structure defined by\nthis specification. The rules for extension member names are covered\nbelow.\n\nAn extension **MAY** define new query parameters. The rules for extension-defined\nquery parameters are covered below.\n\nWhen an extension defines new query parameters or document members, the\nextension **MUST** define a namespace to guarantee that extensions will never\nconflict with current or future versions of this specification. A namespace\n**MUST** meet all of the following conditions:\n\n- A namespace **MUST** contain at least one character.\n- A namespace **MUST** contain only these characters:\n - U+0061 to U+007A, “a-z”\n - U+0041 to U+005A, “A-Z”\n - U+0030 to U+0039, “0-9”\n\nAn extension **MUST NOT** define more than one namespace. The namespace used for\nall query parameters and document members **MUST** be the same for any given\nextension.\n\nIn the following example, an extension with the namespace `version` has\nspecified a resource object member `version:id` to support per-resource\nversioning. This member might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/version\" // ... { \"type\": \"articles\", \"id\": \"1\", \"version:id\": \"42\", \"attributes\": { \"title\": \"Rails is Omakase\" } } // ... \n```\n\n#### Rules for Profiles\n\nThe rules for profile usage are dictated by [RFC\n6906](https://tools.ietf.org/html/rfc6906).\n\nA profile **MAY** define document members and processing rules that are reserved\nfor implementors.\n\nA profile **MUST NOT** define any query parameters except implementation-specific query parameters.\n\nA profile **MUST NOT** alter or remove processing rules that have been defined\nby this specification or by an extension. However, a profile\n**MAY** define processing rules for query parameters whose processing rules\nhave been reserved for implementors to define at their discretion.\n\nFor example, a profile could define rules for interpreting the `filter` query\nparameter, but it could not specify that relationship\nnames in the `include` query parameter are\nspace-separated instead of dot-separated.\n\nUnlike extensions, profiles do not need to define a namespace for document\nmembers because profiles cannot define specification semantics and thus cannot\nconflict with current or future versions of this specification. However, it is\npossible for profiles to conflict with other profiles. Therefore, it is the\nresponsibility of implementors to ensure that they do not support conflicting\nprofiles.\n\nIn the following example, a profile has defined a `timestamps` attribute. According to the profile, the attribute must be an\nobject containing a `created` member and a `modified` member and these members’\nvalues must use the [RFC 3339](https://tools.ietf.org/html/rfc3339) format.\nWith such a profile applied, a response might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;profile=\"https://example.com/resource-timestamps\" // ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\", \"timestamps\": { \"created\": \"2020-07-21T12:09:00Z\", \"modified\": \"2020-07-30T10:19:01Z\" } } } // ... \n```\n\n## Content Negotiation\n\n### Universal Responsibilities\n\nClients and servers **MUST** send all JSON:API payloads using the JSON:API media\ntype in the `Content-Type` header.\n\nClients and servers **MUST** specify the `ext` media type parameter in the\n`Content-Type` header when they have applied one or more extensions to a\nJSON:API document.\n\nClients and servers **MUST** specify the `profile` media type parameters in the\n`Content-Type` header when they have applied one or more profiles to a JSON:API\ndocument.\n\n### Client Responsibilities\n\nWhen processing a JSON:API response document, clients **MUST** ignore any\nparameters other than `ext` and `profile` parameters in the server’s\n`Content-Type` header.\n\nA client **MAY** use the `ext` media type parameter in an `Accept` header to\nrequire that a server apply all the specified extensions to the response\ndocument.\n\nA client **MAY** use the `profile` media type parameter in an `Accept` header\nto request that the server apply one or more profiles to the response document.\n\n> Note: A client is allowed to send more than one acceptable media type in the\n> `Accept` header, including multiple instances of the JSON:API media type. This\n> allows clients to request different combinations of the `ext` and `profile`\n> media type parameters. A client can use [quality values](https://tools.ietf.org/html/rfc7231#section-5.3.2)\n> to indicate that some combinations are less preferable than others. Media types\n> specified without a qvalue are equally preferable to each other, regardless of\n> their order, and are always considered more preferable than a media type with a\n> qvalue less than 1.\n\n### Server Responsibilities\n\nIf a request specifies the `Content-Type` header with the JSON:API media type,\nservers **MUST** respond with a `415 Unsupported Media Type` status code if\nthat media type contains any media type parameters other than `ext` or\n`profile`.\n\nIf a request specifies the `Content-Type` header with an instance of\nthe JSON:API media type modified by the `ext` media type parameter and that\nparameter contains an unsupported extension URI, the server **MUST** respond\nwith a `415 Unsupported Media Type` status code.\n\n> Note: JSON:API servers that do not support version 1.1 of this specification\n> will respond with a `415 Unsupported Media Type` client error if the `ext` or\n> `profile` media type parameter is present.\n\nIf a request’s `Accept` header contains an instance of the JSON:API media type,\nservers **MUST** ignore instances of that media type which are modified by a\nmedia type parameter other than `ext` or `profile`. If all instances of that\nmedia type are modified with a media type parameter other than `ext` or `profile`,\nservers **MUST** respond with a `406 Not Acceptable` status code. If every\ninstance of that media type is modified by the `ext` parameter and each contains\nat least one unsupported extension URI, the server **MUST** also respond with a\n`406 Not Acceptable`.\n\nIf the `profile` parameter is received, a server **SHOULD** attempt to apply any\nrequested profile(s) to its response. A server **MUST** ignore any profiles\nthat it does not recognize.\n\n> Note: The above rules guarantee strict agreement on extensions between the\n> client and server, while the application of profiles is left to the discretion\n> of the server.\n\nServers that support the `ext` or `profile` media type parameters **SHOULD**\nspecify the `Vary` header with `Accept` as one of its values. This applies to\nresponses with and without any profiles or extensions applied.\n\n> Note: Some HTTP intermediaries (e.g. CDNs) may ignore the `Vary` header\n> unless specifically configured to respect it.\n\n## Document Structure\n\nThis section describes the structure of a JSON:API document, which is identified\nby the JSON:API media type. JSON:API documents are\ndefined in JavaScript Object Notation (JSON) [[RFC8259](http://tools.ietf.org/html/rfc8259)].\n\nAlthough the same media type is used for both request and response documents,\ncertain aspects are only applicable to one or the other. These differences are\ncalled out below.\n\nExtensions **MAY** define new members within the document structure. These\nmembers **MUST** comply with the naming requirements specified\nbelow.\n\nUnless otherwise noted, objects defined by this specification or any applied\nextensions **MUST NOT** contain any additional members. Client and server\nimplementations **MUST** ignore non-compliant members.\n\n> Note: These conditions allow this specification to evolve through additive\n> changes.\n\n### Top Level\n\nA JSON object **MUST** be at the root of every JSON:API request and response\ndocument containing data. This object defines a document’s “top level”.\n\nA document **MUST** contain at least one of the following top-level members:\n\n- `data` : the document’s “primary data”.\n- `errors` : an array of error objects .\n- `meta` : a meta object that contains non-standard\nmeta-information.\n- a member defined by an applied extension .\n\nThe members `data` and `errors` **MUST NOT** coexist in the same document.\n\nA document **MAY** contain any of these top-level members:\n\n- `jsonapi` : an object describing the server’s implementation.\n- `links` : a links object related to the document as a whole.\n- `included` : an array of resource objects that are related to the primary\ndata and/or each other (“included resources”).\n\nIf a document does not contain a top-level `data` key, the `included` member\n**MUST NOT** be present either.\n\nThe top-level links object **MAY** contain the following members:\n\n- `self` : the link that generated the current response document. If a\ndocument has extensions or profiles applied to it, this link **SHOULD** be\nrepresented by a link object with the `type` target attribute specifying the\nJSON:API media type with all applicable parameters.\n- `related` : a related resource link when the primary data represents a\nresource relationship.\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the current document.\n- pagination links for the primary data.\n\n> Note: The `self` link in the top-level `links` object allows a client to\n> refresh the data represented by the current response document. The client\n> should be able to use the provided link without applying any additional\n> information. Therefore the link must contain the query parameters provided\n> by the client to generate the response document. This includes but is not\n> limited to query parameters used for inclusion of related resources,\n> sparse fieldsets, sorting,\n> pagination and filtering.\n\nThe document’s “primary data” is a representation of the resource or collection\nof resources targeted by a request.\n\nPrimary data **MUST** be either:\n\n- a single resource object , a single resource identifier object , or `null` ,\nfor requests that target single resources\n- an array of resource objects , an array of resource identifier objects , or\nan empty array ( `[]` ), for requests that target resource collections\n\nFor example, the following primary data is a single resource object:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { // ... this article's attributes }, \"relationships\": { // ... this article's relationships } } } \n```\n\nThe following primary data is a single resource identifier object that\nreferences the same resource:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\" } } \n```\n\nA logical collection of resources **MUST** be represented as an array, even if\nit only contains one item or is empty.\n\n### Resource Objects\n\n“Resource objects” appear in a JSON:API document to represent resources.\n\nA resource object **MUST** contain at least the following top-level members:\n\n- `id`\n- `type`\n\nException: The `id` member is not required when the resource object originates\nat the client and represents a new resource to be created on the server. In that\ncase, a client **MAY** include a `lid` member to uniquely identify the resource\nby `type` *locally* within the document.\n\nIn addition, a resource object **MAY** contain any of these top-level members:\n\n- `attributes` : an attributes object representing some of the resource’s data.\n- `relationships` : a relationships object describing relationships between\n the resource and other JSON:API resources.\n- `links` : a links object containing links related to the resource.\n- `meta` : a meta object containing non-standard meta-information about a\nresource that can not be represented as an attribute or relationship.\n\nHere’s how an article (i.e. a resource of type “articles”) might appear in a document:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } // ... \n```\n\n#### Identification\n\nAs noted above, every resource object **MUST** contain a\n`type` member. Every resource object **MUST** also contain an `id` member,\nexcept when the resource object originates at the client and represents a new\nresource to be created on the server. If `id` is omitted due to this exception,\na `lid` member **MAY** be included to uniquely identify the resource by `type` *locally* within the document. The value of the `lid` member **MUST** be\nidentical for every representation of the resource in the document, including\nresource identifier objects.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nWithin a given API, each resource object’s `type` and `id` pair **MUST**\nidentify a single, unique resource. (The set of URIs controlled by a server,\nor multiple servers acting as one, constitute an API.)\n\nThe `type` member is used to describe resource objects that share common\nattributes and relationships.\n\nThe values of `type` members **MUST** adhere to the same constraints as\nmember names.\n\n> Note: This spec is agnostic about inflection rules, so the value of `type`\n> can be either plural or singular. However, the same value should be used\n> consistently throughout an implementation.\n\n#### Fields\n\nA resource object’s attributes and its relationships are collectively called\nits “fields”.\n\nFields for a resource object **MUST** share a common namespace with each\nother and with `type` and `id`. In other words, a resource can not have an\nattribute and relationship with the same name, nor can it have an attribute\nor relationship named `type` or `id`.\n\n##### Attributes\n\nThe value of the `attributes` key **MUST** be an object (an “attributes\nobject”). Members of the attributes object (“attributes”) represent information\nabout the resource object in which it’s defined.\n\nAttributes may contain any valid JSON value, including complex data structures\ninvolving JSON objects and arrays.\n\nKeys that reference related resources (e.g. `author_id`) **SHOULD NOT** appear\nas attributes. Instead, relationships **SHOULD** be used.\n\n> Note: See fields and member names for more restrictions on this container.\n\n##### Relationships\n\nThe value of the `relationships` key **MUST** be an object (a “relationships\nobject”). Each member of a relationships object represents\na “relationship” from the resource object\nin which it has been defined to other resource objects.\n\nRelationships may be to-one or to-many.\n\nA relationship’s name is given by its key. The value at that key **MUST** be an\nobject (“relationship object”).\n\nA “relationship object” **MUST** contain at least one of the following:\n\n- `links` : a links object containing at least one of the following:\n - `self` : a link for the relationship itself (a “relationship link”). This\n link allows the client to directly manipulate the relationship. For example,\n removing an `author` through an `article` ’s relationship URL would disconnect\n the person from the `article` without deleting the `people` resource itself.\n When fetched successfully, this link returns the linkage for the related resources as its primary data.\n (See Fetching Relationships .)\n - `related` : a related resource link\n - a member defined by an applied extension .\n- `data` : resource linkage\n- `meta` : a meta object that contains non-standard meta-information about the\nrelationship.\n- a member defined by an applied extension .\n\nA relationship object that represents a to-many relationship **MAY** also contain\npagination links under the `links` member, as described below. Any\npagination links in a relationship object **MUST** paginate the relationship\ndata, not the related resources.\n\n> Note: See fields and member names for more restrictions on this container.\n\nA “related resource link” provides access to resource objects linked\nin a relationship. When fetched, the related resource object(s)\nare returned as the response’s primary data.\n\nFor example, an `article`’s `comments` relationship could\nspecify a link that returns a collection of comment resource objects\nwhen retrieved through a `GET` request.\n\nIf present, a related resource link **MUST** reference a valid URL, even if the\nrelationship isn’t currently associated with any target resources. Additionally,\na related resource link **MUST NOT** change because its relationship’s content\nchanges.\n\n##### Resource Linkage\n\nResource linkage in a compound document allows a client to link together all\nof the included resource objects without having to `GET` any URLs via links.\n\nResource linkage **MUST** be represented as one of the following:\n\n- `null` for empty to-one relationships.\n- an empty array ( `[]` ) for empty to-many relationships.\n- a single resource identifier object for non-empty to-one relationships.\n- an array of resource identifier objects for non-empty to-many relationships.\n\n> Note: The spec does not impart meaning to order of resource identifier\n> objects in linkage arrays of to-many relationships, although implementations\n> may do that. Arrays of resource identifier objects may represent ordered\n> or unordered relationships, and both types can be mixed in one response\n> object.\n\nFor example, the following article is associated with an `author`:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nThe `author` relationship includes a link for the relationship itself (which\nallows the client to change the related author directly), a related resource\nlink to fetch the resource objects, and linkage information.\n\n#### Resource Links\n\nThe optional `links` member within each resource object contains links\nrelated to the resource.\n\nIf present, this links object **MAY** contain a `self` link that\nidentifies the resource represented by the resource object.\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nA server **MUST** respond to a `GET` request to the specified URL with a\nresponse that includes the resource as the primary data.\n\n### Resource Identifier Objects\n\nA “resource identifier object” is an object that identifies an individual\nresource.\n\nA “resource identifier object” **MUST** contain a `type` member. It **MUST**\nalso contain an `id` member, except when it represents a new resource to be\ncreated on the server. In this case, a `lid` member **MUST** be included that\nidentifies the new resource.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nA “resource identifier object” **MAY** also include a `meta` member, whose value is a meta object that\ncontains non-standard meta-information.\n\n### Compound Documents\n\nServers **MAY** allow responses that include related resources along with the\nrequested primary resources. Such responses are called “compound documents”.\n\nIn a compound document, all included resources **MUST** be represented as an\narray of resource objects in a top-level `included` member.\n\nEvery included resource object **MUST** be identified via a chain of\nrelationships originating in a document’s primary data. This means that\ncompound documents require “full linkage” and that no resource object can be\nincluded without a direct or indirect relationship to the document’s primary\ndata.\n\nThe only exception to the full linkage requirement is when relationship fields\nthat would otherwise contain linkage data are excluded due to\nsparse fieldsets requested by the client.\n\nA complete example document with multiple included relationships:\n\n```\n{ \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"links\": { \"self\": \"http://example.com/articles/1\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }, \"comments\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": \"http://example.com/articles/1/comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"5\" }, { \"type\": \"comments\", \"id\": \"12\" } ] } } }], \"included\": [{ \"type\": \"people\", \"id\": \"9\", \"attributes\": { \"firstName\": \"Dan\", \"lastName\": \"Gebhardt\", \"twitter\": \"dgeb\" }, \"links\": { \"self\": \"http://example.com/people/9\" } }, { \"type\": \"comments\", \"id\": \"5\", \"attributes\": { \"body\": \"First!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"2\" } } }, \"links\": { \"self\": \"http://example.com/comments/5\" } }, { \"type\": \"comments\", \"id\": \"12\", \"attributes\": { \"body\": \"I like XML better\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/comments/12\" } }] } \n```\n\nA compound document **MUST NOT** include more than one resource object for\neach `type` and `id` pair.\n\n> Note: In a single document, you can think of the `type` and `id` as a\n> composite key that uniquely references resource objects in another part of\n> the document.\n\n> Note: For resources that do not contain an `id` member but do contain a `lid`,\n> the `lid` is sufficient to establish resource identity and thus linkage between\n> resource objects and resource identifier objects throughout the document.\n\n> Note: This approach ensures that a single canonical resource object is\n> returned with each response, even when the same resource is referenced\n> multiple times.\n\n### Meta Information\n\nWhere specified, a `meta` member can be used to include non-standard\nmeta-information. The value of each `meta` member **MUST** be an object (a\n“meta object”).\n\nAny members **MAY** be specified within `meta` objects.\n\nFor example:\n\n```\n{ \"meta\": { \"copyright\": \"Copyright 2015 Example Corp.\", \"authors\": [ \"Yehuda Katz\", \"Steve Klabnik\", \"Dan Gebhardt\", \"Tyler Kellen\" ] }, \"data\": { // ... } } \n```\n\n### Links\n\nWhere specified, a `links` member can be used to represent links. The value\nof this member **MUST** be an object (a “links object”).\n\nWithin this object, a link **MUST** be represented as either:\n\n- a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target,\n- a link object or\n- `null` if the link does not exist.\n\nA link’s relation type **SHOULD** be inferred from the name of the link unless the\nlink is a link object and the link object has a `rel` member.\n\nA link’s context is the top-level object, resource\nobject, or relationship object in which it\nappears.\n\nIn the example below, the `self` link is a string whereas the `related` link is\na link object. The `related` link object provides additional information\nabout the targeted related resource collection as well as a schema that serves\nas a description document for that collection:\n\n```\n\"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": { \"href\": \"http://example.com/articles/1/comments\", \"title\": \"Comments\", \"describedby\": \"http://example.com/schemas/article-comments\", \"meta\": { \"count\": 10 } } } \n```\n\n#### Link objects\n\nA “link object” is an object that represents a [web link](https://tools.ietf.org/html/rfc8288).\n\nA link object **MUST** contain the following member:\n\n- `href` : a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target.\n\nA link object **MAY** also contain any of the following members:\n\n- `rel` : a string indicating the link’s relation type. The string **MUST** be a [valid link relation type](https://tools.ietf.org/html/rfc8288#section-2.1) .\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the link target.\n- `title` : a string which serves as a label for the destination of a link\nsuch that it can be used as a human-readable identifier (e.g., a menu\nentry).\n- `type` : a string indicating the media type of the link’s target.\n- `hreflang` : a string or an array of strings indicating the language(s) of the\nlink’s target. An array of strings indicates that the link’s target is\navailable in multiple languages. Each string **MUST** be a valid language tag\n[ [RFC5646](https://tools.ietf.org/html/rfc5646) ].\n- `meta` : a meta object containing non-standard meta-information about the\nlink.\n\n> Note: the `type` and `hreflang` members are only hints; the target resource\n> is not guaranteed to be available in the indicated media type or language\n> when the link is actually followed.\n\n### JSON:API Object\n\nA JSON:API document **MAY** include information about its implementation\nunder a top level `jsonapi` member. If present, the value of the `jsonapi`\nmember **MUST** be an object (a “jsonapi object”).\n\nThe jsonapi object **MAY** contain any of the following members:\n\n- `version` - whose value is a string indicating the highest JSON:API version\nsupported.\n- `ext` - an array of URIs for all applied extensions .\n- `profile` - an array of URIs for all applied profiles .\n- `meta` - a meta object that contains non-standard meta-information.\n\nClients and servers **MUST NOT** use an `ext` or `profile` member for content\nnegotiation. Content negotiation **MUST** only happen based on media type\nparameters in `Content-Type` header.\n\nA simple example appears below:\n\n```\n{ \"jsonapi\": { \"version\": \"1.1\", \"ext\": [ \"https://jsonapi.org/ext/atomic\" ], \"profile\": [ \"http://example.com/profiles/flexible-pagination\", \"http://example.com/profiles/resource-versioning\" ] } } \n```\n\nIf the `version` member is not present, clients should assume the server\nimplements at least version 1.0 of the specification.\n\n> Note: Because JSON:API is committed to making additive changes only, the\n> version string primarily indicates which new features a server may support.\n\n### Member Names\n\nImplementation and profile defined member names used in a JSON:API document\n**MUST** be treated as case sensitive by clients and servers, and they **MUST**\nmeet all of the following conditions:\n\n- Member names **MUST** contain at least one character.\n- Member names **MUST** contain only the allowed characters listed below.\n- Member names **MUST** start and end with a “globally allowed character”,\nas defined below.\n\nTo enable an easy mapping of member names to URLs, it is **RECOMMENDED** that\nmember names use only non-reserved, URL safe characters specified in [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).\n\n#### Allowed Characters\n\nThe following “globally allowed characters” **MAY** be used anywhere in a member name:\n\n- U+0061 to U+007A, “a-z”\n- U+0041 to U+005A, “A-Z”\n- U+0030 to U+0039, “0-9”\n- U+0080 and above (non-ASCII Unicode characters; *not recommended, not URL safe* )\n\nAdditionally, the following characters are allowed in member names, except as the\nfirst or last character:\n\n- U+002D HYPHEN-MINUS, “-“\n- U+005F LOW LINE, “_”\n- U+0020 SPACE, “ “ *(not recommended, not URL safe)*\n\n#### Reserved Characters\n\nThe following characters **MUST NOT** be used in implementation and\nprofile defined member names:\n\n- U+002B PLUS SIGN, “+” *(has overloaded meaning in URL query strings)*\n- U+002C COMMA, “,” *(used as a separator between relationship paths)*\n- U+002E PERIOD, “.” *(used as a separator within relationship paths)*\n- U+005B LEFT SQUARE BRACKET, “[” *(used in query parameter families)*\n- U+005D RIGHT SQUARE BRACKET, “]” *(used in query parameter families)*\n- U+0021 EXCLAMATION MARK, “!”\n- U+0022 QUOTATION MARK, â€�”’\n- U+0023 NUMBER SIGN, “#”\n- U+0024 DOLLAR SIGN, “$”\n- U+0025 PERCENT SIGN, “%”\n- U+0026 AMPERSAND, “&”\n- U+0027 APOSTROPHE, “’”\n- U+0028 LEFT PARENTHESIS, “(“\n- U+0029 RIGHT PARENTHESIS, “)”\n- U+002A ASTERISK, “*”\n- U+002F SOLIDUS, “/”\n- U+003A COLON, “:”\n- U+003B SEMICOLON, “;”\n- U+003C LESS-THAN SIGN, “<”\n- U+003D EQUALS SIGN, “=”\n- U+003E GREATER-THAN SIGN, “>”\n- U+003F QUESTION MARK, “?”\n- U+0040 COMMERCIAL AT, “@” (except as first character in @-Members )\n- U+005C REVERSE SOLIDUS, “\\”\n- U+005E CIRCUMFLEX ACCENT, “^”\n- U+0060 GRAVE ACCENT, “`”\n- U+007B LEFT CURLY BRACKET, “{“\n- U+007C VERTICAL LINE, “|”\n- U+007D RIGHT CURLY BRACKET, “}”\n- U+007E TILDE, “~”\n- U+007F DELETE\n- U+0000 to U+001F (C0 Controls)\n\n#### @-Members\n\nMember names **MAY** also begin with an at sign (U+0040 COMMERCIAL AT, “@”).\nMembers named this way are called “@-Members”. @-Members **MAY** appear\nanywhere in a document.\n\nThis specification provides no guidance on the meaning or usage of @-Members,\nwhich are considered to be implementation semantics. @-Members\n**MUST** be ignored when interpreting this specification’s definitions and\nprocessing instructions given outside of this subsection. For example, an\nattribute is defined above as any member of the attributes object.\nHowever, because @-Members must be ignored when interpreting that definition, an\n@-Member that occurs in an attributes object is not an attribute.\n\n> Note: Among other things, “@” members can be used to add JSON-LD data to a\n> JSON:API document. Such documents should be served with [an extra header](http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld)\n> to convey to JSON-LD clients that they contain JSON-LD data.\n\n#### Extension Members\n\nThe name of every new member introduced by an extension **MUST** be prefixed\nwith the extension’s namespace followed by a colon (`:`).\nThe remainder of the name **MUST** adhere to the rules for implementation\ndefined member names.\n\n## Fetching Data\n\nData, including resources and relationships, can be fetched by sending a\n`GET` request to an endpoint.\n\nResponses can be further refined with the optional features described below.\n\n### Fetching Resources\n\nA server **MUST** support fetching resource data for every URL provided as:\n\n- a `self` link as part of the top-level links object\n- a `self` link as part of a resource-level links object\n- a `related` link as part of a relationship-level links object\n\nFor example, the following request fetches a collection of articles:\n\n```\nGET /articles HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe following request fetches an article:\n\n```\nGET /articles/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches an article’s author:\n\n```\nGET /articles/1/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch an individual\nresource or resource collection with a `200 OK` response.\n\nA server **MUST** respond to a successful request to fetch a resource\ncollection with an array of resource objects or an empty array (`[]`) as\nthe response document’s primary data.\n\nFor example, a `GET` request to a collection of articles could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" } }, { \"type\": \"articles\", \"id\": \"2\", \"attributes\": { \"title\": \"Rails is Omakase\" } }] } \n```\n\nA similar response representing an empty collection would be:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [] } \n```\n\nA server **MUST** respond to a successful request to fetch an individual\nresource with a resource object or `null` provided as\nthe response document’s primary data.\n\n`null` is only an appropriate response when the requested URL is one that\nmight correspond to a single resource, but doesn’t currently.\n\n> Note: Consider, for example, a request to fetch a to-one related resource link.\n> This request would respond with `null` when the relationship is empty (such that\n> the link is corresponding to no resources) but with the single related resource’s\n> resource object otherwise.\n\nFor example, a `GET` request to an individual article could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1\" }, \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"related\": \"http://example.com/articles/1/author\" } } } } } \n```\n\nIf the above article’s author is missing, then a `GET` request to that related\nresource would return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1/author\" }, \"data\": null } \n```\n\n##### 404 Not Found\n\nA server **MUST** respond with `404 Not Found` when processing a request to\nfetch a single resource that does not exist, except when the request warrants a\n`200 OK` response with `null` as the primary data (as described above).\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Fetching Relationships\n\nA server **MUST** support fetching relationship data for every relationship URL\nprovided as a `self` link as part of a relationship’s `links` object.\n\nFor example, the following request fetches data about an article’s comments:\n\n```\nGET /articles/1/relationships/comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches data about an article’s author:\n\n```\nGET /articles/1/relationships/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch a relationship\nwith a `200 OK` response.\n\nThe primary data in the response document **MUST** match the appropriate\nvalue for resource linkage, as described above for\nrelationship objects.\n\nThe top-level links object **MAY** contain `self` and `related` links,\nas described above for relationship objects.\n\nFor example, a `GET` request to a URL from a to-one relationship link could\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": null } \n```\n\nA `GET` request to a URL from a to-many relationship link could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [] } \n```\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to fetch\na relationship link URL that does not exist.\n\n> Note: This can happen when the parent resource of the relationship\n> does not exist. For example, when `/articles/1` does not exist, request to\n> `/articles/1/relationships/tags` returns `404 Not Found`.\n\nIf a relationship link URL exists but the relationship is empty, then\n`200 OK` **MUST** be returned, as described above.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\nAn endpoint **MAY** return resources related to the primary data by default.\n\nAn endpoint **MAY** also support an `include` query parameter to allow the\nclient to customize which related resources should be returned.\n\nIf an endpoint does not support the `include` parameter, it **MUST** respond\nwith `400 Bad Request` to any requests that include it.\n\nIf an endpoint supports the `include` parameter and a client supplies it:\n\n- The server’s response **MUST** be a compound document with an `included` key — even if that `included` key holds an empty array (because the requested relationships are empty).\n- The server **MUST NOT** include unrequested resource objects in the `included` section of the compound document .\n\nThe value of the `include` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list of relationship paths. A relationship path is a dot-separated\n(U+002E FULL-STOP, “.”) list of relationship names. An empty\nvalue indicates that no related resources should be returned.\n\nIf a server is unable to identify a relationship path or does not support\ninclusion of resources from a path, it **MUST** respond with 400 Bad Request.\n\n> Note: For example, a relationship path could be `comments.author`, where\n> `comments` is a relationship listed under a `articles` resource object, and\n> `author` is a relationship listed under a `comments` resource object.\n\nFor instance, comments could be requested with an article:\n\n```\nGET /articles/1?include=comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn order to request resources related to other resources, a dot-separated path\nfor each relationship name can be specified:\n\n```\nGET /articles/1?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: Because compound documents require full linkage\n> (except when relationship linkage is excluded by sparse fieldsets), intermediate\n> resources in a multi-part path must be returned along with the leaf nodes. For\n> example, a response to a request for `comments.author` should include `comments`\n> as well as the `author` of each of those `comments`.\n\n> Note: A server may choose to expose a deeply nested relationship such as\n> `comments.author` as a direct relationship with an alternative name such as\n> `commentAuthors`. This would allow a client to request\n> `/articles/1?include=commentAuthors` instead of\n> `/articles/1?include=comments.author`. By exposing the nested relationship with\n> an alternative name, the server can still provide full linkage in compound\n> documents without including potentially unwanted intermediate resources.\n\nMultiple related resources can be requested in a comma-separated list:\n\n```\nGET /articles/1?include=comments.author,ratings HTTP/1.1 Accept: application/vnd.api+json \n```\n\nFurthermore, related resources can be requested from a relationship endpoint:\n\n```\nGET /articles/1/relationships/comments?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn this case, the primary data would be a collection of\nresource identifier objects that represent linkage to comments for an article,\nwhile the full comments and comment authors would be returned as included data.\n\n> Note: This section applies to any endpoint that responds with primary\n> data, regardless of the request type. For instance, a server could support\n> the inclusion of related resources along with a `POST` request to create a\n> resource or relationship.\n\n### Sparse Fieldsets\n\nA client **MAY** request that an endpoint return only specific fields in the\nresponse on a per-type basis by including a `fields[TYPE]` query parameter.\n\nThe value of any `fields[TYPE]` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list that refers to the name(s) of the fields to be returned.\nAn empty value indicates that no fields should be returned.\n\nIf a client requests a restricted set of fields for a given resource type,\nan endpoint **MUST NOT** include additional fields in resource objects of\nthat type in its response.\n\nIf a client does not specify the set of fields for a given resource type, the\nserver **MAY** send all fields, a subset of fields, or no fields for that\nresource type.\n\n```\nGET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply for\n> readability. In practice, these characters should be percent-encoded. See\n> “Square Brackets in Parameter Names”.\n\n> Note: This section applies to any endpoint that responds with resources as\n> primary or included data, regardless of the request type. For instance, a\n> server could support sparse fieldsets along with a `POST` request to create\n> a resource.\n\n### Sorting\n\nA server **MAY** choose to support requests to sort resource collections\naccording to one or more criteria (“sort fields”).\n\n> Note: Although recommended, sort fields do not necessarily need to\n> correspond to resource attribute and relationship names.\n\n> Note: It is recommended that dot-separated (U+002E FULL-STOP, “.”) sort\n> fields be used to request sorting based upon relationship attributes. For\n> example, a sort field of `author.name` could be used to request that the\n> primary data be sorted based upon the `name` attribute of the `author`\n> relationship.\n\nAn endpoint **MAY** support requests to sort the primary data with a `sort`\nquery parameter. The value for `sort` **MUST** represent sort fields.\n\n```\nGET /people?sort=age HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAn endpoint **MAY** support multiple sort fields by allowing comma-separated\n(U+002C COMMA, “,”) sort fields. Sort fields **SHOULD** be applied in the\norder specified.\n\n```\nGET /people?sort=age,name HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe sort order for each sort field **MUST** be ascending unless it is prefixed\nwith a minus (U+002D HYPHEN-MINUS, “-“), in which case it **MUST** be descending.\n\n```\nGET /articles?sort=-created,title HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe above example should return the newest articles first. Any articles\ncreated on the same date will then be sorted by their title in ascending\nalphabetical order.\n\nIf the server does not support sorting as specified in the query parameter\n`sort`, it **MUST** return `400 Bad Request`.\n\nIf sorting is supported by the server and requested by the client via query\nparameter `sort`, the server **MUST** return elements of the top-level\n`data` array of the response ordered according to the criteria specified.\nThe server **MAY** apply default sorting rules to top-level `data` if\nrequest parameter `sort` is not specified.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\nA server **MAY** choose to limit the number of resources returned in a response\nto a subset (“page”) of the whole set available.\n\nA server **MAY** provide links to traverse a paginated data set (“pagination\nlinks”).\n\nPagination links **MUST** appear in the links object that corresponds to a\ncollection. To paginate the primary data, supply pagination links in the\ntop-level `links` object. To paginate an included collection returned in\na compound document, supply pagination links in the corresponding links\nobject.\n\nThe following keys **MUST** be used for pagination links:\n\n- `first` : the first page of data\n- `last` : the last page of data\n- `prev` : the previous page of data\n- `next` : the next page of data\n\nKeys **MUST** either be omitted or have a `null` value to indicate that a\nparticular link is unavailable.\n\nConcepts of order, as expressed in the naming of pagination links, **MUST**\nremain consistent with JSON:API’s sorting rules.\n\nThe `page` query parameter family is reserved for pagination. Servers and\nclients **SHOULD** use these parameters for pagination operations.\n\n> Note: JSON API is agnostic about the pagination strategy used by a server, but\n> the `page` query parameter family can be used regardless of the strategy\n> employed. For example, a page-based strategy might use query parameters such\n> as `page[number]` and `page[size]`, while a cursor-based strategy might use\n> `page[cursor]`.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\n### Filtering\n\nThe `filter` query parameter family is reserved for filtering data. Servers\nand clients **SHOULD** use these parameters for filtering operations.\n\n> Note: JSON API is agnostic about the strategies supported by a server.\n\n## Creating, Updating and Deleting Resources\n\nA server **MAY** allow resources of a given type to be created. It **MAY**\nalso allow existing resources to be modified or deleted.\n\nA request **MUST** completely succeed or fail (in a single “transaction”). No\npartial updates are allowed.\n\n> Note: The `type` member is required in every resource object throughout requests and\n> responses in JSON:API. There are some cases, such as when `POST`ing to an\n> endpoint representing heterogeneous data, when the `type` could not be inferred\n> from the endpoint. However, picking and choosing when it is required would be\n> confusing; it would be hard to remember when it was required and when it was\n> not. Therefore, to improve consistency and minimize confusion, `type` is\n> always required.\n\n### Creating Resources\n\nA resource can be created by sending a `POST` request to a URL that represents\na collection of resources. The request **MUST** include a single resource object\nas primary data. The resource object **MUST** contain at least a `type` member.\n\nFor instance, a new photo might be created with the following request:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"relationships\": { \"photographer\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } } \n```\n\nIf a relationship is provided in the `relationships` member of the\nresource object, its value **MUST** be a relationship object with a `data`\nmember. The value of this key represents the linkage the new resource is to\nhave.\n\n#### Client-Generated IDs\n\nA server **MAY** accept a client-generated ID along with a request to create\na resource. An ID **MUST** be specified with an `id` key, the value of\nwhich **MUST** be a universally unique identifier. The client **SHOULD** use\na properly generated and formatted *UUID* as described in RFC 4122\n[[RFC4122](http://tools.ietf.org/html/rfc4122.html)].\n\n> NOTE: In some use-cases, such as importing data from another source, it\n> may be possible to use something other than a UUID that is still guaranteed\n> to be globally unique. Do not use anything other than a UUID unless you are\n> 100% confident that the strategy you are using indeed generates globally\n> unique identifiers.\n\nFor example:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" } } } \n```\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto create a resource with a client-generated ID.\n\n#### Responses\n\n##### 201 Created\n\nIf the requested resource has been created successfully and the server changes\nthe resource in any way (for example, by assigning an `id`), the server **MUST**\nreturn a `201 Created` response and a document that contains the resource as\nprimary data.\n\nThe response **SHOULD** include a `Location` header identifying the location\nof the newly created resource, in order to comply with [RFC\n7231](http://tools.ietf.org/html/rfc7231#section-6.3.2).\n\nIf the resource object returned by the response contains a `self` key in its\n`links` member and a `Location` header is provided, the value of the `self`\nmember **MUST** match the value of the `Location` header.\n\n```\nHTTP/1.1 201 Created Location: http://example.com/photos/550e8400-e29b-41d4-a716-446655440000 Content-Type: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"links\": { \"self\": \"http://example.com/photos/550e8400-e29b-41d4-a716-446655440000\" } } } \n```\n\nA server **MAY** return a `201 Created` response with a document that contains\nno primary data if the requested resource has been created successfully and the\nserver does not change the resource in any way (for example, by assigning an\n`id` or `createdAt` attribute). Other top-level members, such as meta, could\nbe included in the response document.\n\n> Note: Only servers that accept Client-Generated\n> IDs can avoid assigning an `id` to a new resource.\n\n##### 202 Accepted\n\nIf a request to create a resource has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf the requested resource has been created successfully and the server does not\nchange the resource in any way (for example, by assigning an `id` or `createdAt`\nattribute), the server **MUST** return either a `201 Created` status code and\nresponse document (as described above) or a `204 No Content` status code with no\nresponse document.\n\n##### 403 Forbidden\n\nA server **MAY** return `403 Forbidden` in response to an unsupported request\nto create a resource.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MUST** return `409 Conflict` when processing a `POST` request to\ncreate a resource with a client-generated ID that already exists.\n\nA server **MUST** return `409 Conflict` when processing a `POST` request in\nwhich the resource object’s `type` is not among the type(s) that constitute the\ncollection represented by the endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Resources\n\nA resource can be updated by sending a `PATCH` request to the URL that\nrepresents the resource.\n\nThe URL for a resource can be obtained in the `self` link of the resource\nobject. Alternatively, when a `GET` request returns a single resource object as\nprimary data, the same request URL can be used for updates.\n\nThe `PATCH` request **MUST** include a single resource object as primary data.\nThe resource object **MUST** contain `type` and `id` members.\n\nFor example:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\" } } } \n```\n\n#### Updating a Resource’s Attributes\n\nAny or all of a resource’s attributes **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the attributes for a resource, the server\n**MUST** interpret the missing attributes as if they were included with their\ncurrent values. The server **MUST NOT** interpret missing attributes as `null`\nvalues.\n\nFor example, the following `PATCH` request is interpreted as a request to\nupdate only the `title` and `text` attributes of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\", \"text\": \"TLDR; It's complicated... but check your test coverage regardless.\" } } } \n```\n\n#### Updating a Resource’s Relationships\n\nAny or all of a resource’s relationships **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the relationships for a resource, the server\n**MUST** interpret the missing relationships as if they were included with their\ncurrent values. It **MUST NOT** interpret them as `null` or empty values.\n\nIf a relationship is provided in the `relationships` member of a resource\nobject in a `PATCH` request, its value **MUST** be a relationship object\nwith a `data` member. The relationship’s value will be replaced with the\nvalue specified in this member.\n\nFor instance, the following `PATCH` request will update the `author` relationship of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"1\" } } } } } \n```\n\nLikewise, the following `PATCH` request performs a complete replacement of\nthe `tags` for an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"tags\": { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } } } } \n```\n\nA server **MAY** reject an attempt to do a full replacement of a to-many\nrelationship. In such a case, the server **MUST** reject the entire update,\nand return a `403 Forbidden` response.\n\n> Note: Since full replacement may be a very dangerous operation, a server\n> may choose to disallow it. For example, a server may reject full replacement if\n> it has not provided the client with the full list of associated objects, and\n> does not want to allow deletion of records the client has not seen.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted resource in ways\nother than those specified by the request (for example, updating the\n`updatedAt` attribute or a computed `sha`), it **MUST** return a `200 OK`\nresponse and a document that contains the updated resource as primary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted resource in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf an update request has been accepted for processing, but the processing\nhas not been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nresource in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a resource or relationship.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to modify\na resource that does not exist.\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MAY** return `409 Conflict` when processing a `PATCH` request to\nupdate a resource if that update would violate other server-enforced\nconstraints (such as a uniqueness constraint on a property other than `id`).\n\nA server **MUST** return `409 Conflict` when processing a `PATCH` request in\nwhich the resource object’s `type` or `id` do not match the server’s endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Relationships\n\nAlthough relationships can be modified along with resources (as described\nabove), JSON:API also supports updating of relationships independently at\nURLs from relationship links.\n\n> Note: Relationships are updated without exposing the underlying server\n> semantics, such as foreign keys. Furthermore, relationships can be updated\n> without necessarily affecting the related resources. For example, if an article\n> has many authors, it is possible to remove one of the authors from the article\n> without deleting the person itself. Similarly, if an article has many tags, it\n> is possible to add or remove tags. Under the hood on the server, the first\n> of these examples might be implemented with a foreign key, while the second\n> could be implemented with a join table, but the JSON:API protocol would be\n> the same in both cases.\n\n> Note: A server may choose to delete the underlying resource if a\n> relationship is deleted (as a garbage collection measure).\n\n#### Updating To-One Relationships\n\nA to-one relationship can be updated by sending a `PATCH` request to a URL\nfrom a to-one relationship link.\n\nThe `PATCH` request **MUST** include a top-level member named `data` containing\none of:\n\n- a resource identifier object corresponding to the new related resource.\n- `null` , to remove the relationship.\n\nFor example, the following request updates the author of an article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nAnd the following request clears the author of the same article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": null } \n```\n\nIf the relationship is updated successfully then the server **MUST** return\na successful response.\n\n#### Updating To-Many Relationships\n\nA to-many relationship can be updated by sending a `PATCH`, `POST`, or\n`DELETE` request to a URL from a to-many relationship link.\n\nFor all request types, the body **MUST** contain a `data` member whose value\nis an empty array or an array of resource identifier objects.\n\nIf a client makes a `PATCH` request to a URL from a to-many\nrelationship link, the server **MUST** either completely\nreplace every member of the relationship, return an appropriate error response\nif some resources cannot be found or accessed, or return a `403 Forbidden`\nresponse if complete replacement is not allowed by the server.\n\nFor example, the following request replaces every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nAnd the following request clears every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [] } \n```\n\nIf a client makes a `POST` request to a URL from a\nrelationship link, the server **MUST** add the specified\nmembers to the relationship unless they are already present. If a given `type`\nand `id` is already in the relationship, the server **MUST NOT** add it again.\n\n> Note: This matches the semantics of databases that use foreign keys for\n> has-many relationships. Document-based storage should check the has-many\n> relationship before appending to avoid duplicates.\n\nIf all of the specified resources can be added to, or are already present\nin, the relationship then the server **MUST** return a successful response.\n\n> Note: This approach ensures that a request is successful if the server’s\n> state matches the requested state, and helps avoid pointless race conditions\n> caused by multiple clients making the same changes to a relationship.\n\nIn the following example, the comment with ID `123` is added to the list of\ncomments for the article with ID `1`:\n\n```\nPOST /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"123\" } ] } \n```\n\nIf the client makes a `DELETE` request to a URL from a\nrelationship link the server **MUST** delete the specified\nmembers from the relationship or return a `403 Forbidden` response. If all of\nthe specified resources are able to be removed from, or are already missing\nfrom, the relationship then the server **MUST** return a successful response.\n\n> Note: As described above for `POST` requests, this approach helps avoid\n> pointless race conditions between multiple clients making the same changes.\n\nRelationship members are specified in the same way as in the `POST` request.\n\nIn the following example, comments with IDs of `12` and `13` are removed\nfrom the list of comments for the article with ID `1`:\n\n```\nDELETE /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"12\" }, { \"type\": \"comments\", \"id\": \"13\" } ] } \n```\n\n> Note: RFC 7231 specifies that a DELETE request may include a body, but\n> that a server may reject the request. This spec defines the semantics of a\n> server, and we are defining its semantics for JSON:API.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted relationship in\nother ways than those specified by the request, it **MUST** return a `200 OK`\nresponse and a document that includes the updated relationship data as its\nprimary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted relationship in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a relationship update request has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nrelationship in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n> Note: This is the appropriate response to a `POST` request sent to a URL\n> from a to-many relationship link when that relationship already\n> exists. It is also the appropriate response to a `DELETE` request sent to a URL\n> from a to-many relationship link when that relationship does\n> not exist.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a relationship.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Deleting Resources\n\nA resource can be deleted by sending a `DELETE` request to the URL\nthat represents the resource:\n\n```\nDELETE /photos/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if a deletion request is successful. Other top-level members, such\nas meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a deletion request has been accepted for processing, but the processing has\nnot been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf a deletion request is successful, the server **MUST** return either a `200\nOK` status code and response document (as described above) or a `204 No Content`\nstatus code with no response document.\n\n##### 404 NOT FOUND\n\nA server **SHOULD** return a `404 Not Found` status code if a deletion request fails\ndue to the resource not existing.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n## Query Parameters\n\n### Query Parameter Families\n\nAlthough “query parameter” is a common term in everyday web development, it is\nnot a well-standardized concept. Therefore, JSON:API provides its own\ndefinition of a query parameter.\n\nFor the most part, JSON:API’s definition coincides with colloquial usage, and its\ndetails can be safely ignored. However, one important consequence of this\ndefinition is that a URL like the following is considered to have two distinct\nquery parameters:\n\n```\n/?page[offset]=0&page[limit]=10\n```\n\nThe two parameters are named `page[offset]` and `page[limit]`; there is no\nsingle `page` parameter.\n\nIn practice, however, parameters like `page[offset]` and `page[limit]` are\nusually defined and processed together, and it’s convenient to refer to them\ncollectively. Therefore, JSON:API introduces the concept of a query parameter\nfamily.\n\nA “query parameter family” is the set of all query parameters whose name starts\nwith a “base name”, followed by zero or more instances of empty square brackets\n(i.e. `[]`), square-bracketed legal member names, or square-bracketed\ndot-separated lists of legal member names. The family is referred to\nby its base name.\n\nFor example, the `filter` query parameter family includes parameters named:\n`filter`, `filter[x]`, `filter[]`, `filter[x][]`, `filter[][]`, `filter[x][y]`,\n`filter[x.y]`, etc. However, `filter[_]` is not a valid parameter name in the\nfamily, because `_` is not a valid member name.\n\n> Note: Dot separated lists of legal member names are intended to be used for\n> relationship paths. For example, this allows filtering strategies using\n> relationship paths as defined for sorting in query parameters\n> such as `GET /posts?sort=author.name&filter[author.status]=active`.\n\n### Extension-Specific Query Parameters\n\nThe base name of every query parameter introduced by an extension **MUST** be\nprefixed with the extension’s namespace followed by a colon (`:`). The\nremainder of the base name **MUST** contain only the characters [a-z] (U+0061\nto U+007A, “a-z”).\n\n### Implementation-Specific Query Parameters\n\nImplementations **MAY** support custom query parameters. However, the names of\nthese query parameters **MUST** come from a family\nwhose base name is a legal member name and also contains at least\none non a-z character (i.e., outside U+0061 to U+007A).\n\nIt is **RECOMMENDED** that a capital letter (e.g. camelCasing) be used to\nsatisfy the above requirement.\n\nIf a server encounters a query parameter that does not follow the naming\nconventions above, or the server does not know how to process it as a query\nparameter from this specification, it **MUST** return `400 Bad Request`.\n\n> Note: By forbidding the use of query parameters that contain only the characters\n> [a-z], JSON:API is reserving the ability to standardize additional query\n> parameters later without conflicting with existing implementations.\n\n## Errors\n\n### Processing Errors\n\nA server **MAY** choose to stop processing as soon as a problem is encountered,\nor it **MAY** continue processing and encounter multiple problems. For instance,\na server might process multiple attributes and then return multiple validation\nproblems in a single response.\n\nWhen a server encounters multiple problems for a single request, the most\ngenerally applicable HTTP error code **SHOULD** be used in the response. For\ninstance, `400 Bad Request` might be appropriate for multiple 4xx errors\nor `500 Internal Server Error` might be appropriate for multiple 5xx errors.\n\n### Error Objects\n\nError objects provide additional information about problems encountered while\nperforming an operation. Error objects **MUST** be returned as an array\nkeyed by `errors` in the top level of a JSON:API document.\n\nAn error object **MAY** have the following members, and **MUST** contain at\nleast one of:\n\n- `id` : a unique identifier for this particular occurrence of the problem.\n- `links` : a links object that **MAY** contain the following members:\n - `about` : a link that leads to further details about this\n particular occurrence of the problem. When dereferenced, this URI **SHOULD** return a human-readable description of the error.\n - `type` : a link that identifies the type of error that this\n particular error is an instance of. This URI **SHOULD** be dereferenceable to\n a human-readable explanation of the general error.\n- `status` : the HTTP status code applicable to this problem, expressed as a\nstring value. This **SHOULD** be provided.\n- `code` : an application-specific error code, expressed as a string value.\n- `title` : a short, human-readable summary of the problem that **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of\nlocalization.\n- `detail` : a human-readable explanation specific to this occurrence of the\nproblem. Like `title` , this field’s value can be localized.\n- `source` : an object containing references to the primary source of the error.\nIt **SHOULD** include one of the following members or be omitted:\n - `pointer` : a JSON Pointer [ [RFC6901](https://tools.ietf.org/html/rfc6901) ]\n to the value in the request document that caused the error [e.g. `\"/data\"` for a primary data object, or `\"/data/attributes/title\"` for a specific\n attribute]. This **MUST** point to a value in the request document that\n exists; if it doesn’t, the client **SHOULD** simply ignore the pointer.\n - `parameter` : a string indicating which URI query parameter caused\n the error.\n - `header` : a string indicating the name of a single request header which\n caused the error.\n- `meta` : a meta object containing non-standard meta-information about the\nerror.\n\n## Appendix\n\n### Query Parameters Details\n\n#### Parsing/Serialization\n\nA query parameter is a name–value pair extracted from, or serialized into, a\nURI’s query string.\n\nTo extract the query parameters from a URI, an implementation **MUST** run the\nURI’s query string, excluding the leading question mark, through the\n[`application/x-www-form-urlencoded` parsing algorithm](https://url.spec.whatwg.org/#urlencoded-parsing),\nwith one exception: JSON:API allows the specification that defines a query\nparameter’s usage to provide its own rules for parsing the parameter’s value\nfrom the `value` bytes identified in steps 3.2 and and 3.3 of the `application/x-www-form-urlencoded`\nparsing algorithm. The resulting value might not be a string.\n\n> Note: In general, the query string parsing built in to servers and browsers\n> will match the process specified above, so most implementations do not need\n> to worry about this.\n> \n> The `application/x-www-form-urlencoded` format is referenced because it is\n> the basis for the `a=b&c=d` style that almost all query strings use today.\n> \n> However, `application/x-www-form-urlencoded` parsing contains the bizarre\n> historical artifact that `+` characters must be treated as spaces, and it\n> requires that all values be percent-decoded during parsing, which makes it\n> impossible to use [RFC 3986 delimiter characters](https://tools.ietf.org/html/rfc3986#section-2.2)\n> as delimiters. These issues motivate the exception that JSON:API defines above.\n\nSimilarly, to serialize a query parameter into a URI, an implementation **MUST**\nuse [the `application/x-www-form-urlencoded` serializer](https://url.spec.whatwg.org/#concept-urlencoded-serializer),\nwith the corresponding exception that a parameter’s value — but not its name —\nmay be serialized differently than that algorithm requires, provided the\nserialization does not interfere with the ability to parse back the resulting URI.\n\n#### Square Brackets in Parameter Names\n\nWith query parameter families, JSON:API allows for\nquery parameters whose names contain square brackets (i.e., U+005B “[” and\nU+005D “]”).\n\nAccording to the query parameter serialization rules above, a compliant\nimplementation will percent-encode these square brackets. However, some URI\nproducers — namely browsers — do not always encode them. Servers **SHOULD**\naccept requests in which these square brackets are left unencoded in a query\nparameter’s name. If a server does accept these requests, it **MUST** treat the\nrequest as equivalent to one in which the square brackets were percent-encoded.", "znaku_textu": 74500, "slov": 11324, "odkazu": 140, "kodovani": "windows-1250", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:24", "sha256": "0561c0d7471422779fc231901aba8e90338b40abb20851689dafaa471df6cb4c", "hloubka": 4, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["http://discuss.jsonapi.org/", "https://github.com/json-api/json-api", "http://www.iana.org/assignments/media-types/application/vnd.api+json", "https://tools.ietf.org/html/bcp14", "https://tools.ietf.org/html/rfc2119", "https://tools.ietf.org/html/rfc8174", "https://tools.ietf.org/html/rfc3986", "https://tools.ietf.org/html/rfc6906", "https://tools.ietf.org/html/rfc3339", "https://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc8259", "https://tools.ietf.org/html/rfc8288", "https://tools.ietf.org/html/rfc5646", "https://datatracker.ietf.org/doc/html/rfc3986", "http://www.w3.org/TR/json-ld/", "http://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc4122.html", "https://tools.ietf.org/html/rfc6901", "https://url.spec.whatwg.org/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/format/", "titulek": "JSON:API — Latest Specification (v1.1)", "h1": "Latest Specification (v1.1)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Latest Specification (v1.1)"}, {"uroven": 2, "text": "Status"}, {"uroven": 2, "text": "Introduction"}, {"uroven": 2, "text": "Semantics"}, {"uroven": 2, "text": "Conventions"}, {"uroven": 2, "text": "The JSON:API Media Type"}, {"uroven": 3, "text": "Media Type Parameters"}, {"uroven": 3, "text": "Extensions"}, {"uroven": 3, "text": "Profiles"}, {"uroven": 3, "text": "Rules for Media Type Parameters"}, {"uroven": 4, "text": "Rules for Extensions"}, {"uroven": 4, "text": "Rules for Profiles"}, {"uroven": 2, "text": "Content Negotiation"}, {"uroven": 3, "text": "Universal Responsibilities"}, {"uroven": 3, "text": "Client Responsibilities"}, {"uroven": 3, "text": "Server Responsibilities"}, {"uroven": 2, "text": "Document Structure"}, {"uroven": 3, "text": "Top Level"}, {"uroven": 3, "text": "Resource Objects"}, {"uroven": 4, "text": "Identification"}, {"uroven": 4, "text": "Fields"}, {"uroven": 5, "text": "Attributes"}, {"uroven": 5, "text": "Relationships"}, {"uroven": 5, "text": "Resource Linkage"}, {"uroven": 4, "text": "Resource Links"}, {"uroven": 3, "text": "Resource Identifier Objects"}, {"uroven": 3, "text": "Compound Documents"}, {"uroven": 3, "text": "Meta Information"}, {"uroven": 3, "text": "Links"}, {"uroven": 4, "text": "Link objects"}, {"uroven": 3, "text": "JSON:API Object"}, {"uroven": 3, "text": "Member Names"}, {"uroven": 4, "text": "Allowed Characters"}, {"uroven": 4, "text": "Reserved Characters"}, {"uroven": 4, "text": "@-Members"}, {"uroven": 4, "text": "Extension Members"}, {"uroven": 2, "text": "Fetching Data"}, {"uroven": 3, "text": "Fetching Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Fetching Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Sparse Fieldsets"}, {"uroven": 3, "text": "Sorting"}, {"uroven": 3, "text": "Filtering"}, {"uroven": 2, "text": "Creating, Updating and Deleting Resources"}, {"uroven": 3, "text": "Creating Resources"}, {"uroven": 4, "text": "Client-Generated IDs"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "201 Created"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Resources"}, {"uroven": 4, "text": "Updating a Resource’s Attributes"}, {"uroven": 4, "text": "Updating a Resource’s Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Relationships"}, {"uroven": 4, "text": "Updating To-One Relationships"}, {"uroven": 4, "text": "Updating To-Many Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Deleting Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "404 NOT FOUND"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 2, "text": "Query Parameters"}, {"uroven": 3, "text": "Query Parameter Families"}, {"uroven": 3, "text": "Extension-Specific Query Parameters"}, {"uroven": 3, "text": "Implementation-Specific Query Parameters"}, {"uroven": 2, "text": "Errors"}, {"uroven": 3, "text": "Processing Errors"}, {"uroven": 3, "text": "Error Objects"}, {"uroven": 2, "text": "Appendix"}, {"uroven": 3, "text": "Query Parameters Details"}, {"uroven": 4, "text": "Parsing/Serialization"}, {"uroven": 4, "text": "Square Brackets in Parameter Names"}], "markdown": "# Latest Specification (v1.1)\n\n## Status\n\nThis page presents the latest published version of JSON:API, which is\n currently version 1.1. New versions of JSON:API **will\n always be backwards compatible** using a *never remove, only add* strategy.\n Additions can be proposed in our [discussion forum](http://discuss.jsonapi.org/).\n\nIf you catch an error in the specification’s text, or if you write an\n implementation, please let us know by opening an issue or pull request at our\n [GitHub repository](https://github.com/json-api/json-api).\n\n## Introduction\n\nJSON:API is a specification for how a client should request that resources be\nfetched or modified, and how a server should respond to those requests. JSON:API\ncan be easily extended with extensions and profiles.\n\nJSON:API is designed to minimize both the number of requests and the amount of\ndata transmitted between clients and servers. This efficiency is achieved\nwithout compromising readability, flexibility, or discoverability.\n\nJSON:API requires use of the JSON:API media type\n([`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json))\nfor exchanging data.\n\n## Semantics\n\nAll document members, query parameters, and processing rules defined by\nthis specification are collectively called “specification semantics”.\n\nCertain document members, query parameters, and processing rules are reserved\nfor implementors to define at their discretion. These are called “implementation\nsemantics”.\n\nAll other semantics are reserved for potential future use by this specification.\n\n## Conventions\n\nThe key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,\n“SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this\ndocument are to be interpreted as described in\n[BCP 14](https://tools.ietf.org/html/bcp14)\n[[RFC2119](https://tools.ietf.org/html/rfc2119)]\n[[RFC8174](https://tools.ietf.org/html/rfc8174)]\nwhen, and only when, they appear in all capitals, as shown here.\n\n## The JSON:API Media Type\n\nThe JSON:API media type is\n[`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).\n\n### Media Type Parameters\n\nThe JSON:API specification supports two media type parameters: `ext` and\n`profile`, which are used to specify extensions and profiles, respectively.\n\n> Note: A media type parameter is an extra piece of information that can\n> accompany a media type. For example, in the header\n> `Content-Type: text/html;charset=\"utf-8\"`, the media type is `text/html` and\n> `charset` is a parameter.\n\n### Extensions\n\nExtensions provide a means to “extend” the base specification by defining\nadditional specification semantics.\n\nExtensions cannot alter or remove specification semantics, nor can they specify\nimplementation semantics.\n\n### Profiles\n\nProfiles provide a means to share a particular usage of the specification among\nimplementations.\n\nProfiles can specify implementation semantics, but cannot alter,\nadd to, or remove specification semantics.\n\n### Rules for Media Type Parameters\n\nThe JSON:API media type **MUST NOT** be specified with any media type parameters\nother than `ext` and `profile`. The `ext` parameter is used to support\nextensions and the `profile` parameter is used to support profiles.\n\nExtensions and profiles are each uniquely identified by a\n[URI](https://tools.ietf.org/html/rfc3986). Visiting an extension’s or a\nprofile’s URI **SHOULD** return documentation that describes its usage. The\nvalues of the `ext` and `profile` parameters **MUST** equal a space-separated\n(U+0020 SPACE, “ “) list of extension or profile URIs, respectively.\n\n> Note: When serializing the `ext` or `profile` media type parameters, the HTTP\n> specification requires that parameter values be surrounded by quotation marks\n> (U+0022 QUOTATION MARK, “\"”).\n\n#### Rules for Extensions\n\nAn extension **MAY** impose additional processing rules or further restrictions\nand it **MAY** define new object members as described below.\n\nAn extension **MUST NOT** lessen or remove any processing rules, restrictions or\nobject member requirements defined in this specification or other extensions.\n\nAn extension **MAY** define new members within the document structure defined by\nthis specification. The rules for extension member names are covered\nbelow.\n\nAn extension **MAY** define new query parameters. The rules for extension-defined\nquery parameters are covered below.\n\nWhen an extension defines new query parameters or document members, the\nextension **MUST** define a namespace to guarantee that extensions will never\nconflict with current or future versions of this specification. A namespace\n**MUST** meet all of the following conditions:\n\n- A namespace **MUST** contain at least one character.\n- A namespace **MUST** contain only these characters:\n - U+0061 to U+007A, “a-z”\n - U+0041 to U+005A, “A-Z”\n - U+0030 to U+0039, “0-9”\n\nAn extension **MUST NOT** define more than one namespace. The namespace used for\nall query parameters and document members **MUST** be the same for any given\nextension.\n\nIn the following example, an extension with the namespace `version` has\nspecified a resource object member `version:id` to support per-resource\nversioning. This member might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/version\" // ... { \"type\": \"articles\", \"id\": \"1\", \"version:id\": \"42\", \"attributes\": { \"title\": \"Rails is Omakase\" } } // ... \n```\n\n#### Rules for Profiles\n\nThe rules for profile usage are dictated by [RFC\n6906](https://tools.ietf.org/html/rfc6906).\n\nA profile **MAY** define document members and processing rules that are reserved\nfor implementors.\n\nA profile **MUST NOT** define any query parameters except implementation-specific query parameters.\n\nA profile **MUST NOT** alter or remove processing rules that have been defined\nby this specification or by an extension. However, a profile\n**MAY** define processing rules for query parameters whose processing rules\nhave been reserved for implementors to define at their discretion.\n\nFor example, a profile could define rules for interpreting the `filter` query\nparameter, but it could not specify that relationship\nnames in the `include` query parameter are\nspace-separated instead of dot-separated.\n\nUnlike extensions, profiles do not need to define a namespace for document\nmembers because profiles cannot define specification semantics and thus cannot\nconflict with current or future versions of this specification. However, it is\npossible for profiles to conflict with other profiles. Therefore, it is the\nresponsibility of implementors to ensure that they do not support conflicting\nprofiles.\n\nIn the following example, a profile has defined a `timestamps` attribute. According to the profile, the attribute must be an\nobject containing a `created` member and a `modified` member and these members’\nvalues must use the [RFC 3339](https://tools.ietf.org/html/rfc3339) format.\nWith such a profile applied, a response might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;profile=\"https://example.com/resource-timestamps\" // ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\", \"timestamps\": { \"created\": \"2020-07-21T12:09:00Z\", \"modified\": \"2020-07-30T10:19:01Z\" } } } // ... \n```\n\n## Content Negotiation\n\n### Universal Responsibilities\n\nClients and servers **MUST** send all JSON:API payloads using the JSON:API media\ntype in the `Content-Type` header.\n\nClients and servers **MUST** specify the `ext` media type parameter in the\n`Content-Type` header when they have applied one or more extensions to a\nJSON:API document.\n\nClients and servers **MUST** specify the `profile` media type parameters in the\n`Content-Type` header when they have applied one or more profiles to a JSON:API\ndocument.\n\n### Client Responsibilities\n\nWhen processing a JSON:API response document, clients **MUST** ignore any\nparameters other than `ext` and `profile` parameters in the server’s\n`Content-Type` header.\n\nA client **MAY** use the `ext` media type parameter in an `Accept` header to\nrequire that a server apply all the specified extensions to the response\ndocument.\n\nA client **MAY** use the `profile` media type parameter in an `Accept` header\nto request that the server apply one or more profiles to the response document.\n\n> Note: A client is allowed to send more than one acceptable media type in the\n> `Accept` header, including multiple instances of the JSON:API media type. This\n> allows clients to request different combinations of the `ext` and `profile`\n> media type parameters. A client can use [quality values](https://tools.ietf.org/html/rfc7231#section-5.3.2)\n> to indicate that some combinations are less preferable than others. Media types\n> specified without a qvalue are equally preferable to each other, regardless of\n> their order, and are always considered more preferable than a media type with a\n> qvalue less than 1.\n\n### Server Responsibilities\n\nIf a request specifies the `Content-Type` header with the JSON:API media type,\nservers **MUST** respond with a `415 Unsupported Media Type` status code if\nthat media type contains any media type parameters other than `ext` or\n`profile`.\n\nIf a request specifies the `Content-Type` header with an instance of\nthe JSON:API media type modified by the `ext` media type parameter and that\nparameter contains an unsupported extension URI, the server **MUST** respond\nwith a `415 Unsupported Media Type` status code.\n\n> Note: JSON:API servers that do not support version 1.1 of this specification\n> will respond with a `415 Unsupported Media Type` client error if the `ext` or\n> `profile` media type parameter is present.\n\nIf a request’s `Accept` header contains an instance of the JSON:API media type,\nservers **MUST** ignore instances of that media type which are modified by a\nmedia type parameter other than `ext` or `profile`. If all instances of that\nmedia type are modified with a media type parameter other than `ext` or `profile`,\nservers **MUST** respond with a `406 Not Acceptable` status code. If every\ninstance of that media type is modified by the `ext` parameter and each contains\nat least one unsupported extension URI, the server **MUST** also respond with a\n`406 Not Acceptable`.\n\nIf the `profile` parameter is received, a server **SHOULD** attempt to apply any\nrequested profile(s) to its response. A server **MUST** ignore any profiles\nthat it does not recognize.\n\n> Note: The above rules guarantee strict agreement on extensions between the\n> client and server, while the application of profiles is left to the discretion\n> of the server.\n\nServers that support the `ext` or `profile` media type parameters **SHOULD**\nspecify the `Vary` header with `Accept` as one of its values. This applies to\nresponses with and without any profiles or extensions applied.\n\n> Note: Some HTTP intermediaries (e.g. CDNs) may ignore the `Vary` header\n> unless specifically configured to respect it.\n\n## Document Structure\n\nThis section describes the structure of a JSON:API document, which is identified\nby the JSON:API media type. JSON:API documents are\ndefined in JavaScript Object Notation (JSON) [[RFC8259](http://tools.ietf.org/html/rfc8259)].\n\nAlthough the same media type is used for both request and response documents,\ncertain aspects are only applicable to one or the other. These differences are\ncalled out below.\n\nExtensions **MAY** define new members within the document structure. These\nmembers **MUST** comply with the naming requirements specified\nbelow.\n\nUnless otherwise noted, objects defined by this specification or any applied\nextensions **MUST NOT** contain any additional members. Client and server\nimplementations **MUST** ignore non-compliant members.\n\n> Note: These conditions allow this specification to evolve through additive\n> changes.\n\n### Top Level\n\nA JSON object **MUST** be at the root of every JSON:API request and response\ndocument containing data. This object defines a document’s “top level”.\n\nA document **MUST** contain at least one of the following top-level members:\n\n- `data` : the document’s “primary data”.\n- `errors` : an array of error objects .\n- `meta` : a meta object that contains non-standard\nmeta-information.\n- a member defined by an applied extension .\n\nThe members `data` and `errors` **MUST NOT** coexist in the same document.\n\nA document **MAY** contain any of these top-level members:\n\n- `jsonapi` : an object describing the server’s implementation.\n- `links` : a links object related to the document as a whole.\n- `included` : an array of resource objects that are related to the primary\ndata and/or each other (“included resources”).\n\nIf a document does not contain a top-level `data` key, the `included` member\n**MUST NOT** be present either.\n\nThe top-level links object **MAY** contain the following members:\n\n- `self` : the link that generated the current response document. If a\ndocument has extensions or profiles applied to it, this link **SHOULD** be\nrepresented by a link object with the `type` target attribute specifying the\nJSON:API media type with all applicable parameters.\n- `related` : a related resource link when the primary data represents a\nresource relationship.\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the current document.\n- pagination links for the primary data.\n\n> Note: The `self` link in the top-level `links` object allows a client to\n> refresh the data represented by the current response document. The client\n> should be able to use the provided link without applying any additional\n> information. Therefore the link must contain the query parameters provided\n> by the client to generate the response document. This includes but is not\n> limited to query parameters used for inclusion of related resources,\n> sparse fieldsets, sorting,\n> pagination and filtering.\n\nThe document’s “primary data” is a representation of the resource or collection\nof resources targeted by a request.\n\nPrimary data **MUST** be either:\n\n- a single resource object , a single resource identifier object , or `null` ,\nfor requests that target single resources\n- an array of resource objects , an array of resource identifier objects , or\nan empty array ( `[]` ), for requests that target resource collections\n\nFor example, the following primary data is a single resource object:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { // ... this article's attributes }, \"relationships\": { // ... this article's relationships } } } \n```\n\nThe following primary data is a single resource identifier object that\nreferences the same resource:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\" } } \n```\n\nA logical collection of resources **MUST** be represented as an array, even if\nit only contains one item or is empty.\n\n### Resource Objects\n\n“Resource objects” appear in a JSON:API document to represent resources.\n\nA resource object **MUST** contain at least the following top-level members:\n\n- `id`\n- `type`\n\nException: The `id` member is not required when the resource object originates\nat the client and represents a new resource to be created on the server. In that\ncase, a client **MAY** include a `lid` member to uniquely identify the resource\nby `type` *locally* within the document.\n\nIn addition, a resource object **MAY** contain any of these top-level members:\n\n- `attributes` : an attributes object representing some of the resource’s data.\n- `relationships` : a relationships object describing relationships between\n the resource and other JSON:API resources.\n- `links` : a links object containing links related to the resource.\n- `meta` : a meta object containing non-standard meta-information about a\nresource that can not be represented as an attribute or relationship.\n\nHere’s how an article (i.e. a resource of type “articles”) might appear in a document:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } // ... \n```\n\n#### Identification\n\nAs noted above, every resource object **MUST** contain a\n`type` member. Every resource object **MUST** also contain an `id` member,\nexcept when the resource object originates at the client and represents a new\nresource to be created on the server. If `id` is omitted due to this exception,\na `lid` member **MAY** be included to uniquely identify the resource by `type` *locally* within the document. The value of the `lid` member **MUST** be\nidentical for every representation of the resource in the document, including\nresource identifier objects.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nWithin a given API, each resource object’s `type` and `id` pair **MUST**\nidentify a single, unique resource. (The set of URIs controlled by a server,\nor multiple servers acting as one, constitute an API.)\n\nThe `type` member is used to describe resource objects that share common\nattributes and relationships.\n\nThe values of `type` members **MUST** adhere to the same constraints as\nmember names.\n\n> Note: This spec is agnostic about inflection rules, so the value of `type`\n> can be either plural or singular. However, the same value should be used\n> consistently throughout an implementation.\n\n#### Fields\n\nA resource object’s attributes and its relationships are collectively called\nits “fields”.\n\nFields for a resource object **MUST** share a common namespace with each\nother and with `type` and `id`. In other words, a resource can not have an\nattribute and relationship with the same name, nor can it have an attribute\nor relationship named `type` or `id`.\n\n##### Attributes\n\nThe value of the `attributes` key **MUST** be an object (an “attributes\nobject”). Members of the attributes object (“attributes”) represent information\nabout the resource object in which it’s defined.\n\nAttributes may contain any valid JSON value, including complex data structures\ninvolving JSON objects and arrays.\n\nKeys that reference related resources (e.g. `author_id`) **SHOULD NOT** appear\nas attributes. Instead, relationships **SHOULD** be used.\n\n> Note: See fields and member names for more restrictions on this container.\n\n##### Relationships\n\nThe value of the `relationships` key **MUST** be an object (a “relationships\nobject”). Each member of a relationships object represents\na “relationship” from the resource object\nin which it has been defined to other resource objects.\n\nRelationships may be to-one or to-many.\n\nA relationship’s name is given by its key. The value at that key **MUST** be an\nobject (“relationship object”).\n\nA “relationship object” **MUST** contain at least one of the following:\n\n- `links` : a links object containing at least one of the following:\n - `self` : a link for the relationship itself (a “relationship link”). This\n link allows the client to directly manipulate the relationship. For example,\n removing an `author` through an `article` ’s relationship URL would disconnect\n the person from the `article` without deleting the `people` resource itself.\n When fetched successfully, this link returns the linkage for the related resources as its primary data.\n (See Fetching Relationships .)\n - `related` : a related resource link\n - a member defined by an applied extension .\n- `data` : resource linkage\n- `meta` : a meta object that contains non-standard meta-information about the\nrelationship.\n- a member defined by an applied extension .\n\nA relationship object that represents a to-many relationship **MAY** also contain\npagination links under the `links` member, as described below. Any\npagination links in a relationship object **MUST** paginate the relationship\ndata, not the related resources.\n\n> Note: See fields and member names for more restrictions on this container.\n\nA “related resource link” provides access to resource objects linked\nin a relationship. When fetched, the related resource object(s)\nare returned as the response’s primary data.\n\nFor example, an `article`’s `comments` relationship could\nspecify a link that returns a collection of comment resource objects\nwhen retrieved through a `GET` request.\n\nIf present, a related resource link **MUST** reference a valid URL, even if the\nrelationship isn’t currently associated with any target resources. Additionally,\na related resource link **MUST NOT** change because its relationship’s content\nchanges.\n\n##### Resource Linkage\n\nResource linkage in a compound document allows a client to link together all\nof the included resource objects without having to `GET` any URLs via links.\n\nResource linkage **MUST** be represented as one of the following:\n\n- `null` for empty to-one relationships.\n- an empty array ( `[]` ) for empty to-many relationships.\n- a single resource identifier object for non-empty to-one relationships.\n- an array of resource identifier objects for non-empty to-many relationships.\n\n> Note: The spec does not impart meaning to order of resource identifier\n> objects in linkage arrays of to-many relationships, although implementations\n> may do that. Arrays of resource identifier objects may represent ordered\n> or unordered relationships, and both types can be mixed in one response\n> object.\n\nFor example, the following article is associated with an `author`:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nThe `author` relationship includes a link for the relationship itself (which\nallows the client to change the related author directly), a related resource\nlink to fetch the resource objects, and linkage information.\n\n#### Resource Links\n\nThe optional `links` member within each resource object contains links\nrelated to the resource.\n\nIf present, this links object **MAY** contain a `self` link that\nidentifies the resource represented by the resource object.\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nA server **MUST** respond to a `GET` request to the specified URL with a\nresponse that includes the resource as the primary data.\n\n### Resource Identifier Objects\n\nA “resource identifier object” is an object that identifies an individual\nresource.\n\nA “resource identifier object” **MUST** contain a `type` member. It **MUST**\nalso contain an `id` member, except when it represents a new resource to be\ncreated on the server. In this case, a `lid` member **MUST** be included that\nidentifies the new resource.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nA “resource identifier object” **MAY** also include a `meta` member, whose value is a meta object that\ncontains non-standard meta-information.\n\n### Compound Documents\n\nServers **MAY** allow responses that include related resources along with the\nrequested primary resources. Such responses are called “compound documents”.\n\nIn a compound document, all included resources **MUST** be represented as an\narray of resource objects in a top-level `included` member.\n\nEvery included resource object **MUST** be identified via a chain of\nrelationships originating in a document’s primary data. This means that\ncompound documents require “full linkage” and that no resource object can be\nincluded without a direct or indirect relationship to the document’s primary\ndata.\n\nThe only exception to the full linkage requirement is when relationship fields\nthat would otherwise contain linkage data are excluded due to\nsparse fieldsets requested by the client.\n\nA complete example document with multiple included relationships:\n\n```\n{ \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"links\": { \"self\": \"http://example.com/articles/1\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }, \"comments\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": \"http://example.com/articles/1/comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"5\" }, { \"type\": \"comments\", \"id\": \"12\" } ] } } }], \"included\": [{ \"type\": \"people\", \"id\": \"9\", \"attributes\": { \"firstName\": \"Dan\", \"lastName\": \"Gebhardt\", \"twitter\": \"dgeb\" }, \"links\": { \"self\": \"http://example.com/people/9\" } }, { \"type\": \"comments\", \"id\": \"5\", \"attributes\": { \"body\": \"First!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"2\" } } }, \"links\": { \"self\": \"http://example.com/comments/5\" } }, { \"type\": \"comments\", \"id\": \"12\", \"attributes\": { \"body\": \"I like XML better\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/comments/12\" } }] } \n```\n\nA compound document **MUST NOT** include more than one resource object for\neach `type` and `id` pair.\n\n> Note: In a single document, you can think of the `type` and `id` as a\n> composite key that uniquely references resource objects in another part of\n> the document.\n\n> Note: For resources that do not contain an `id` member but do contain a `lid`,\n> the `lid` is sufficient to establish resource identity and thus linkage between\n> resource objects and resource identifier objects throughout the document.\n\n> Note: This approach ensures that a single canonical resource object is\n> returned with each response, even when the same resource is referenced\n> multiple times.\n\n### Meta Information\n\nWhere specified, a `meta` member can be used to include non-standard\nmeta-information. The value of each `meta` member **MUST** be an object (a\n“meta object”).\n\nAny members **MAY** be specified within `meta` objects.\n\nFor example:\n\n```\n{ \"meta\": { \"copyright\": \"Copyright 2015 Example Corp.\", \"authors\": [ \"Yehuda Katz\", \"Steve Klabnik\", \"Dan Gebhardt\", \"Tyler Kellen\" ] }, \"data\": { // ... } } \n```\n\n### Links\n\nWhere specified, a `links` member can be used to represent links. The value\nof this member **MUST** be an object (a “links object”).\n\nWithin this object, a link **MUST** be represented as either:\n\n- a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target,\n- a link object or\n- `null` if the link does not exist.\n\nA link’s relation type **SHOULD** be inferred from the name of the link unless the\nlink is a link object and the link object has a `rel` member.\n\nA link’s context is the top-level object, resource\nobject, or relationship object in which it\nappears.\n\nIn the example below, the `self` link is a string whereas the `related` link is\na link object. The `related` link object provides additional information\nabout the targeted related resource collection as well as a schema that serves\nas a description document for that collection:\n\n```\n\"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": { \"href\": \"http://example.com/articles/1/comments\", \"title\": \"Comments\", \"describedby\": \"http://example.com/schemas/article-comments\", \"meta\": { \"count\": 10 } } } \n```\n\n#### Link objects\n\nA “link object” is an object that represents a [web link](https://tools.ietf.org/html/rfc8288).\n\nA link object **MUST** contain the following member:\n\n- `href` : a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target.\n\nA link object **MAY** also contain any of the following members:\n\n- `rel` : a string indicating the link’s relation type. The string **MUST** be a [valid link relation type](https://tools.ietf.org/html/rfc8288#section-2.1) .\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the link target.\n- `title` : a string which serves as a label for the destination of a link\nsuch that it can be used as a human-readable identifier (e.g., a menu\nentry).\n- `type` : a string indicating the media type of the link’s target.\n- `hreflang` : a string or an array of strings indicating the language(s) of the\nlink’s target. An array of strings indicates that the link’s target is\navailable in multiple languages. Each string **MUST** be a valid language tag\n[ [RFC5646](https://tools.ietf.org/html/rfc5646) ].\n- `meta` : a meta object containing non-standard meta-information about the\nlink.\n\n> Note: the `type` and `hreflang` members are only hints; the target resource\n> is not guaranteed to be available in the indicated media type or language\n> when the link is actually followed.\n\n### JSON:API Object\n\nA JSON:API document **MAY** include information about its implementation\nunder a top level `jsonapi` member. If present, the value of the `jsonapi`\nmember **MUST** be an object (a “jsonapi object”).\n\nThe jsonapi object **MAY** contain any of the following members:\n\n- `version` - whose value is a string indicating the highest JSON:API version\nsupported.\n- `ext` - an array of URIs for all applied extensions .\n- `profile` - an array of URIs for all applied profiles .\n- `meta` - a meta object that contains non-standard meta-information.\n\nClients and servers **MUST NOT** use an `ext` or `profile` member for content\nnegotiation. Content negotiation **MUST** only happen based on media type\nparameters in `Content-Type` header.\n\nA simple example appears below:\n\n```\n{ \"jsonapi\": { \"version\": \"1.1\", \"ext\": [ \"https://jsonapi.org/ext/atomic\" ], \"profile\": [ \"http://example.com/profiles/flexible-pagination\", \"http://example.com/profiles/resource-versioning\" ] } } \n```\n\nIf the `version` member is not present, clients should assume the server\nimplements at least version 1.0 of the specification.\n\n> Note: Because JSON:API is committed to making additive changes only, the\n> version string primarily indicates which new features a server may support.\n\n### Member Names\n\nImplementation and profile defined member names used in a JSON:API document\n**MUST** be treated as case sensitive by clients and servers, and they **MUST**\nmeet all of the following conditions:\n\n- Member names **MUST** contain at least one character.\n- Member names **MUST** contain only the allowed characters listed below.\n- Member names **MUST** start and end with a “globally allowed character”,\nas defined below.\n\nTo enable an easy mapping of member names to URLs, it is **RECOMMENDED** that\nmember names use only non-reserved, URL safe characters specified in [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).\n\n#### Allowed Characters\n\nThe following “globally allowed characters” **MAY** be used anywhere in a member name:\n\n- U+0061 to U+007A, “a-z”\n- U+0041 to U+005A, “A-Z”\n- U+0030 to U+0039, “0-9”\n- U+0080 and above (non-ASCII Unicode characters; *not recommended, not URL safe* )\n\nAdditionally, the following characters are allowed in member names, except as the\nfirst or last character:\n\n- U+002D HYPHEN-MINUS, “-“\n- U+005F LOW LINE, “_”\n- U+0020 SPACE, “ “ *(not recommended, not URL safe)*\n\n#### Reserved Characters\n\nThe following characters **MUST NOT** be used in implementation and\nprofile defined member names:\n\n- U+002B PLUS SIGN, “+” *(has overloaded meaning in URL query strings)*\n- U+002C COMMA, “,” *(used as a separator between relationship paths)*\n- U+002E PERIOD, “.” *(used as a separator within relationship paths)*\n- U+005B LEFT SQUARE BRACKET, “[” *(used in query parameter families)*\n- U+005D RIGHT SQUARE BRACKET, “]” *(used in query parameter families)*\n- U+0021 EXCLAMATION MARK, “!”\n- U+0022 QUOTATION MARK, â€�”’\n- U+0023 NUMBER SIGN, “#”\n- U+0024 DOLLAR SIGN, “$”\n- U+0025 PERCENT SIGN, “%”\n- U+0026 AMPERSAND, “&”\n- U+0027 APOSTROPHE, “’”\n- U+0028 LEFT PARENTHESIS, “(“\n- U+0029 RIGHT PARENTHESIS, “)”\n- U+002A ASTERISK, “*”\n- U+002F SOLIDUS, “/”\n- U+003A COLON, “:”\n- U+003B SEMICOLON, “;”\n- U+003C LESS-THAN SIGN, “<”\n- U+003D EQUALS SIGN, “=”\n- U+003E GREATER-THAN SIGN, “>”\n- U+003F QUESTION MARK, “?”\n- U+0040 COMMERCIAL AT, “@” (except as first character in @-Members )\n- U+005C REVERSE SOLIDUS, “\\”\n- U+005E CIRCUMFLEX ACCENT, “^”\n- U+0060 GRAVE ACCENT, “`”\n- U+007B LEFT CURLY BRACKET, “{“\n- U+007C VERTICAL LINE, “|”\n- U+007D RIGHT CURLY BRACKET, “}”\n- U+007E TILDE, “~”\n- U+007F DELETE\n- U+0000 to U+001F (C0 Controls)\n\n#### @-Members\n\nMember names **MAY** also begin with an at sign (U+0040 COMMERCIAL AT, “@”).\nMembers named this way are called “@-Members”. @-Members **MAY** appear\nanywhere in a document.\n\nThis specification provides no guidance on the meaning or usage of @-Members,\nwhich are considered to be implementation semantics. @-Members\n**MUST** be ignored when interpreting this specification’s definitions and\nprocessing instructions given outside of this subsection. For example, an\nattribute is defined above as any member of the attributes object.\nHowever, because @-Members must be ignored when interpreting that definition, an\n@-Member that occurs in an attributes object is not an attribute.\n\n> Note: Among other things, “@” members can be used to add JSON-LD data to a\n> JSON:API document. Such documents should be served with [an extra header](http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld)\n> to convey to JSON-LD clients that they contain JSON-LD data.\n\n#### Extension Members\n\nThe name of every new member introduced by an extension **MUST** be prefixed\nwith the extension’s namespace followed by a colon (`:`).\nThe remainder of the name **MUST** adhere to the rules for implementation\ndefined member names.\n\n## Fetching Data\n\nData, including resources and relationships, can be fetched by sending a\n`GET` request to an endpoint.\n\nResponses can be further refined with the optional features described below.\n\n### Fetching Resources\n\nA server **MUST** support fetching resource data for every URL provided as:\n\n- a `self` link as part of the top-level links object\n- a `self` link as part of a resource-level links object\n- a `related` link as part of a relationship-level links object\n\nFor example, the following request fetches a collection of articles:\n\n```\nGET /articles HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe following request fetches an article:\n\n```\nGET /articles/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches an article’s author:\n\n```\nGET /articles/1/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch an individual\nresource or resource collection with a `200 OK` response.\n\nA server **MUST** respond to a successful request to fetch a resource\ncollection with an array of resource objects or an empty array (`[]`) as\nthe response document’s primary data.\n\nFor example, a `GET` request to a collection of articles could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" } }, { \"type\": \"articles\", \"id\": \"2\", \"attributes\": { \"title\": \"Rails is Omakase\" } }] } \n```\n\nA similar response representing an empty collection would be:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [] } \n```\n\nA server **MUST** respond to a successful request to fetch an individual\nresource with a resource object or `null` provided as\nthe response document’s primary data.\n\n`null` is only an appropriate response when the requested URL is one that\nmight correspond to a single resource, but doesn’t currently.\n\n> Note: Consider, for example, a request to fetch a to-one related resource link.\n> This request would respond with `null` when the relationship is empty (such that\n> the link is corresponding to no resources) but with the single related resource’s\n> resource object otherwise.\n\nFor example, a `GET` request to an individual article could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1\" }, \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"related\": \"http://example.com/articles/1/author\" } } } } } \n```\n\nIf the above article’s author is missing, then a `GET` request to that related\nresource would return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1/author\" }, \"data\": null } \n```\n\n##### 404 Not Found\n\nA server **MUST** respond with `404 Not Found` when processing a request to\nfetch a single resource that does not exist, except when the request warrants a\n`200 OK` response with `null` as the primary data (as described above).\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Fetching Relationships\n\nA server **MUST** support fetching relationship data for every relationship URL\nprovided as a `self` link as part of a relationship’s `links` object.\n\nFor example, the following request fetches data about an article’s comments:\n\n```\nGET /articles/1/relationships/comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches data about an article’s author:\n\n```\nGET /articles/1/relationships/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch a relationship\nwith a `200 OK` response.\n\nThe primary data in the response document **MUST** match the appropriate\nvalue for resource linkage, as described above for\nrelationship objects.\n\nThe top-level links object **MAY** contain `self` and `related` links,\nas described above for relationship objects.\n\nFor example, a `GET` request to a URL from a to-one relationship link could\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": null } \n```\n\nA `GET` request to a URL from a to-many relationship link could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [] } \n```\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to fetch\na relationship link URL that does not exist.\n\n> Note: This can happen when the parent resource of the relationship\n> does not exist. For example, when `/articles/1` does not exist, request to\n> `/articles/1/relationships/tags` returns `404 Not Found`.\n\nIf a relationship link URL exists but the relationship is empty, then\n`200 OK` **MUST** be returned, as described above.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\nAn endpoint **MAY** return resources related to the primary data by default.\n\nAn endpoint **MAY** also support an `include` query parameter to allow the\nclient to customize which related resources should be returned.\n\nIf an endpoint does not support the `include` parameter, it **MUST** respond\nwith `400 Bad Request` to any requests that include it.\n\nIf an endpoint supports the `include` parameter and a client supplies it:\n\n- The server’s response **MUST** be a compound document with an `included` key — even if that `included` key holds an empty array (because the requested relationships are empty).\n- The server **MUST NOT** include unrequested resource objects in the `included` section of the compound document .\n\nThe value of the `include` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list of relationship paths. A relationship path is a dot-separated\n(U+002E FULL-STOP, “.”) list of relationship names. An empty\nvalue indicates that no related resources should be returned.\n\nIf a server is unable to identify a relationship path or does not support\ninclusion of resources from a path, it **MUST** respond with 400 Bad Request.\n\n> Note: For example, a relationship path could be `comments.author`, where\n> `comments` is a relationship listed under a `articles` resource object, and\n> `author` is a relationship listed under a `comments` resource object.\n\nFor instance, comments could be requested with an article:\n\n```\nGET /articles/1?include=comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn order to request resources related to other resources, a dot-separated path\nfor each relationship name can be specified:\n\n```\nGET /articles/1?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: Because compound documents require full linkage\n> (except when relationship linkage is excluded by sparse fieldsets), intermediate\n> resources in a multi-part path must be returned along with the leaf nodes. For\n> example, a response to a request for `comments.author` should include `comments`\n> as well as the `author` of each of those `comments`.\n\n> Note: A server may choose to expose a deeply nested relationship such as\n> `comments.author` as a direct relationship with an alternative name such as\n> `commentAuthors`. This would allow a client to request\n> `/articles/1?include=commentAuthors` instead of\n> `/articles/1?include=comments.author`. By exposing the nested relationship with\n> an alternative name, the server can still provide full linkage in compound\n> documents without including potentially unwanted intermediate resources.\n\nMultiple related resources can be requested in a comma-separated list:\n\n```\nGET /articles/1?include=comments.author,ratings HTTP/1.1 Accept: application/vnd.api+json \n```\n\nFurthermore, related resources can be requested from a relationship endpoint:\n\n```\nGET /articles/1/relationships/comments?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn this case, the primary data would be a collection of\nresource identifier objects that represent linkage to comments for an article,\nwhile the full comments and comment authors would be returned as included data.\n\n> Note: This section applies to any endpoint that responds with primary\n> data, regardless of the request type. For instance, a server could support\n> the inclusion of related resources along with a `POST` request to create a\n> resource or relationship.\n\n### Sparse Fieldsets\n\nA client **MAY** request that an endpoint return only specific fields in the\nresponse on a per-type basis by including a `fields[TYPE]` query parameter.\n\nThe value of any `fields[TYPE]` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list that refers to the name(s) of the fields to be returned.\nAn empty value indicates that no fields should be returned.\n\nIf a client requests a restricted set of fields for a given resource type,\nan endpoint **MUST NOT** include additional fields in resource objects of\nthat type in its response.\n\nIf a client does not specify the set of fields for a given resource type, the\nserver **MAY** send all fields, a subset of fields, or no fields for that\nresource type.\n\n```\nGET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply for\n> readability. In practice, these characters should be percent-encoded. See\n> “Square Brackets in Parameter Names”.\n\n> Note: This section applies to any endpoint that responds with resources as\n> primary or included data, regardless of the request type. For instance, a\n> server could support sparse fieldsets along with a `POST` request to create\n> a resource.\n\n### Sorting\n\nA server **MAY** choose to support requests to sort resource collections\naccording to one or more criteria (“sort fields”).\n\n> Note: Although recommended, sort fields do not necessarily need to\n> correspond to resource attribute and relationship names.\n\n> Note: It is recommended that dot-separated (U+002E FULL-STOP, “.”) sort\n> fields be used to request sorting based upon relationship attributes. For\n> example, a sort field of `author.name` could be used to request that the\n> primary data be sorted based upon the `name` attribute of the `author`\n> relationship.\n\nAn endpoint **MAY** support requests to sort the primary data with a `sort`\nquery parameter. The value for `sort` **MUST** represent sort fields.\n\n```\nGET /people?sort=age HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAn endpoint **MAY** support multiple sort fields by allowing comma-separated\n(U+002C COMMA, “,”) sort fields. Sort fields **SHOULD** be applied in the\norder specified.\n\n```\nGET /people?sort=age,name HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe sort order for each sort field **MUST** be ascending unless it is prefixed\nwith a minus (U+002D HYPHEN-MINUS, “-“), in which case it **MUST** be descending.\n\n```\nGET /articles?sort=-created,title HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe above example should return the newest articles first. Any articles\ncreated on the same date will then be sorted by their title in ascending\nalphabetical order.\n\nIf the server does not support sorting as specified in the query parameter\n`sort`, it **MUST** return `400 Bad Request`.\n\nIf sorting is supported by the server and requested by the client via query\nparameter `sort`, the server **MUST** return elements of the top-level\n`data` array of the response ordered according to the criteria specified.\nThe server **MAY** apply default sorting rules to top-level `data` if\nrequest parameter `sort` is not specified.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\nA server **MAY** choose to limit the number of resources returned in a response\nto a subset (“page”) of the whole set available.\n\nA server **MAY** provide links to traverse a paginated data set (“pagination\nlinks”).\n\nPagination links **MUST** appear in the links object that corresponds to a\ncollection. To paginate the primary data, supply pagination links in the\ntop-level `links` object. To paginate an included collection returned in\na compound document, supply pagination links in the corresponding links\nobject.\n\nThe following keys **MUST** be used for pagination links:\n\n- `first` : the first page of data\n- `last` : the last page of data\n- `prev` : the previous page of data\n- `next` : the next page of data\n\nKeys **MUST** either be omitted or have a `null` value to indicate that a\nparticular link is unavailable.\n\nConcepts of order, as expressed in the naming of pagination links, **MUST**\nremain consistent with JSON:API’s sorting rules.\n\nThe `page` query parameter family is reserved for pagination. Servers and\nclients **SHOULD** use these parameters for pagination operations.\n\n> Note: JSON API is agnostic about the pagination strategy used by a server, but\n> the `page` query parameter family can be used regardless of the strategy\n> employed. For example, a page-based strategy might use query parameters such\n> as `page[number]` and `page[size]`, while a cursor-based strategy might use\n> `page[cursor]`.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\n### Filtering\n\nThe `filter` query parameter family is reserved for filtering data. Servers\nand clients **SHOULD** use these parameters for filtering operations.\n\n> Note: JSON API is agnostic about the strategies supported by a server.\n\n## Creating, Updating and Deleting Resources\n\nA server **MAY** allow resources of a given type to be created. It **MAY**\nalso allow existing resources to be modified or deleted.\n\nA request **MUST** completely succeed or fail (in a single “transaction”). No\npartial updates are allowed.\n\n> Note: The `type` member is required in every resource object throughout requests and\n> responses in JSON:API. There are some cases, such as when `POST`ing to an\n> endpoint representing heterogeneous data, when the `type` could not be inferred\n> from the endpoint. However, picking and choosing when it is required would be\n> confusing; it would be hard to remember when it was required and when it was\n> not. Therefore, to improve consistency and minimize confusion, `type` is\n> always required.\n\n### Creating Resources\n\nA resource can be created by sending a `POST` request to a URL that represents\na collection of resources. The request **MUST** include a single resource object\nas primary data. The resource object **MUST** contain at least a `type` member.\n\nFor instance, a new photo might be created with the following request:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"relationships\": { \"photographer\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } } \n```\n\nIf a relationship is provided in the `relationships` member of the\nresource object, its value **MUST** be a relationship object with a `data`\nmember. The value of this key represents the linkage the new resource is to\nhave.\n\n#### Client-Generated IDs\n\nA server **MAY** accept a client-generated ID along with a request to create\na resource. An ID **MUST** be specified with an `id` key, the value of\nwhich **MUST** be a universally unique identifier. The client **SHOULD** use\na properly generated and formatted *UUID* as described in RFC 4122\n[[RFC4122](http://tools.ietf.org/html/rfc4122.html)].\n\n> NOTE: In some use-cases, such as importing data from another source, it\n> may be possible to use something other than a UUID that is still guaranteed\n> to be globally unique. Do not use anything other than a UUID unless you are\n> 100% confident that the strategy you are using indeed generates globally\n> unique identifiers.\n\nFor example:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" } } } \n```\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto create a resource with a client-generated ID.\n\n#### Responses\n\n##### 201 Created\n\nIf the requested resource has been created successfully and the server changes\nthe resource in any way (for example, by assigning an `id`), the server **MUST**\nreturn a `201 Created` response and a document that contains the resource as\nprimary data.\n\nThe response **SHOULD** include a `Location` header identifying the location\nof the newly created resource, in order to comply with [RFC\n7231](http://tools.ietf.org/html/rfc7231#section-6.3.2).\n\nIf the resource object returned by the response contains a `self` key in its\n`links` member and a `Location` header is provided, the value of the `self`\nmember **MUST** match the value of the `Location` header.\n\n```\nHTTP/1.1 201 Created Location: http://example.com/photos/550e8400-e29b-41d4-a716-446655440000 Content-Type: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"links\": { \"self\": \"http://example.com/photos/550e8400-e29b-41d4-a716-446655440000\" } } } \n```\n\nA server **MAY** return a `201 Created` response with a document that contains\nno primary data if the requested resource has been created successfully and the\nserver does not change the resource in any way (for example, by assigning an\n`id` or `createdAt` attribute). Other top-level members, such as meta, could\nbe included in the response document.\n\n> Note: Only servers that accept Client-Generated\n> IDs can avoid assigning an `id` to a new resource.\n\n##### 202 Accepted\n\nIf a request to create a resource has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf the requested resource has been created successfully and the server does not\nchange the resource in any way (for example, by assigning an `id` or `createdAt`\nattribute), the server **MUST** return either a `201 Created` status code and\nresponse document (as described above) or a `204 No Content` status code with no\nresponse document.\n\n##### 403 Forbidden\n\nA server **MAY** return `403 Forbidden` in response to an unsupported request\nto create a resource.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MUST** return `409 Conflict` when processing a `POST` request to\ncreate a resource with a client-generated ID that already exists.\n\nA server **MUST** return `409 Conflict` when processing a `POST` request in\nwhich the resource object’s `type` is not among the type(s) that constitute the\ncollection represented by the endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Resources\n\nA resource can be updated by sending a `PATCH` request to the URL that\nrepresents the resource.\n\nThe URL for a resource can be obtained in the `self` link of the resource\nobject. Alternatively, when a `GET` request returns a single resource object as\nprimary data, the same request URL can be used for updates.\n\nThe `PATCH` request **MUST** include a single resource object as primary data.\nThe resource object **MUST** contain `type` and `id` members.\n\nFor example:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\" } } } \n```\n\n#### Updating a Resource’s Attributes\n\nAny or all of a resource’s attributes **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the attributes for a resource, the server\n**MUST** interpret the missing attributes as if they were included with their\ncurrent values. The server **MUST NOT** interpret missing attributes as `null`\nvalues.\n\nFor example, the following `PATCH` request is interpreted as a request to\nupdate only the `title` and `text` attributes of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\", \"text\": \"TLDR; It's complicated... but check your test coverage regardless.\" } } } \n```\n\n#### Updating a Resource’s Relationships\n\nAny or all of a resource’s relationships **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the relationships for a resource, the server\n**MUST** interpret the missing relationships as if they were included with their\ncurrent values. It **MUST NOT** interpret them as `null` or empty values.\n\nIf a relationship is provided in the `relationships` member of a resource\nobject in a `PATCH` request, its value **MUST** be a relationship object\nwith a `data` member. The relationship’s value will be replaced with the\nvalue specified in this member.\n\nFor instance, the following `PATCH` request will update the `author` relationship of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"1\" } } } } } \n```\n\nLikewise, the following `PATCH` request performs a complete replacement of\nthe `tags` for an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"tags\": { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } } } } \n```\n\nA server **MAY** reject an attempt to do a full replacement of a to-many\nrelationship. In such a case, the server **MUST** reject the entire update,\nand return a `403 Forbidden` response.\n\n> Note: Since full replacement may be a very dangerous operation, a server\n> may choose to disallow it. For example, a server may reject full replacement if\n> it has not provided the client with the full list of associated objects, and\n> does not want to allow deletion of records the client has not seen.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted resource in ways\nother than those specified by the request (for example, updating the\n`updatedAt` attribute or a computed `sha`), it **MUST** return a `200 OK`\nresponse and a document that contains the updated resource as primary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted resource in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf an update request has been accepted for processing, but the processing\nhas not been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nresource in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a resource or relationship.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to modify\na resource that does not exist.\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MAY** return `409 Conflict` when processing a `PATCH` request to\nupdate a resource if that update would violate other server-enforced\nconstraints (such as a uniqueness constraint on a property other than `id`).\n\nA server **MUST** return `409 Conflict` when processing a `PATCH` request in\nwhich the resource object’s `type` or `id` do not match the server’s endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Relationships\n\nAlthough relationships can be modified along with resources (as described\nabove), JSON:API also supports updating of relationships independently at\nURLs from relationship links.\n\n> Note: Relationships are updated without exposing the underlying server\n> semantics, such as foreign keys. Furthermore, relationships can be updated\n> without necessarily affecting the related resources. For example, if an article\n> has many authors, it is possible to remove one of the authors from the article\n> without deleting the person itself. Similarly, if an article has many tags, it\n> is possible to add or remove tags. Under the hood on the server, the first\n> of these examples might be implemented with a foreign key, while the second\n> could be implemented with a join table, but the JSON:API protocol would be\n> the same in both cases.\n\n> Note: A server may choose to delete the underlying resource if a\n> relationship is deleted (as a garbage collection measure).\n\n#### Updating To-One Relationships\n\nA to-one relationship can be updated by sending a `PATCH` request to a URL\nfrom a to-one relationship link.\n\nThe `PATCH` request **MUST** include a top-level member named `data` containing\none of:\n\n- a resource identifier object corresponding to the new related resource.\n- `null` , to remove the relationship.\n\nFor example, the following request updates the author of an article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nAnd the following request clears the author of the same article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": null } \n```\n\nIf the relationship is updated successfully then the server **MUST** return\na successful response.\n\n#### Updating To-Many Relationships\n\nA to-many relationship can be updated by sending a `PATCH`, `POST`, or\n`DELETE` request to a URL from a to-many relationship link.\n\nFor all request types, the body **MUST** contain a `data` member whose value\nis an empty array or an array of resource identifier objects.\n\nIf a client makes a `PATCH` request to a URL from a to-many\nrelationship link, the server **MUST** either completely\nreplace every member of the relationship, return an appropriate error response\nif some resources cannot be found or accessed, or return a `403 Forbidden`\nresponse if complete replacement is not allowed by the server.\n\nFor example, the following request replaces every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nAnd the following request clears every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [] } \n```\n\nIf a client makes a `POST` request to a URL from a\nrelationship link, the server **MUST** add the specified\nmembers to the relationship unless they are already present. If a given `type`\nand `id` is already in the relationship, the server **MUST NOT** add it again.\n\n> Note: This matches the semantics of databases that use foreign keys for\n> has-many relationships. Document-based storage should check the has-many\n> relationship before appending to avoid duplicates.\n\nIf all of the specified resources can be added to, or are already present\nin, the relationship then the server **MUST** return a successful response.\n\n> Note: This approach ensures that a request is successful if the server’s\n> state matches the requested state, and helps avoid pointless race conditions\n> caused by multiple clients making the same changes to a relationship.\n\nIn the following example, the comment with ID `123` is added to the list of\ncomments for the article with ID `1`:\n\n```\nPOST /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"123\" } ] } \n```\n\nIf the client makes a `DELETE` request to a URL from a\nrelationship link the server **MUST** delete the specified\nmembers from the relationship or return a `403 Forbidden` response. If all of\nthe specified resources are able to be removed from, or are already missing\nfrom, the relationship then the server **MUST** return a successful response.\n\n> Note: As described above for `POST` requests, this approach helps avoid\n> pointless race conditions between multiple clients making the same changes.\n\nRelationship members are specified in the same way as in the `POST` request.\n\nIn the following example, comments with IDs of `12` and `13` are removed\nfrom the list of comments for the article with ID `1`:\n\n```\nDELETE /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"12\" }, { \"type\": \"comments\", \"id\": \"13\" } ] } \n```\n\n> Note: RFC 7231 specifies that a DELETE request may include a body, but\n> that a server may reject the request. This spec defines the semantics of a\n> server, and we are defining its semantics for JSON:API.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted relationship in\nother ways than those specified by the request, it **MUST** return a `200 OK`\nresponse and a document that includes the updated relationship data as its\nprimary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted relationship in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a relationship update request has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nrelationship in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n> Note: This is the appropriate response to a `POST` request sent to a URL\n> from a to-many relationship link when that relationship already\n> exists. It is also the appropriate response to a `DELETE` request sent to a URL\n> from a to-many relationship link when that relationship does\n> not exist.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a relationship.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Deleting Resources\n\nA resource can be deleted by sending a `DELETE` request to the URL\nthat represents the resource:\n\n```\nDELETE /photos/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if a deletion request is successful. Other top-level members, such\nas meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a deletion request has been accepted for processing, but the processing has\nnot been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf a deletion request is successful, the server **MUST** return either a `200\nOK` status code and response document (as described above) or a `204 No Content`\nstatus code with no response document.\n\n##### 404 NOT FOUND\n\nA server **SHOULD** return a `404 Not Found` status code if a deletion request fails\ndue to the resource not existing.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n## Query Parameters\n\n### Query Parameter Families\n\nAlthough “query parameter” is a common term in everyday web development, it is\nnot a well-standardized concept. Therefore, JSON:API provides its own\ndefinition of a query parameter.\n\nFor the most part, JSON:API’s definition coincides with colloquial usage, and its\ndetails can be safely ignored. However, one important consequence of this\ndefinition is that a URL like the following is considered to have two distinct\nquery parameters:\n\n```\n/?page[offset]=0&page[limit]=10\n```\n\nThe two parameters are named `page[offset]` and `page[limit]`; there is no\nsingle `page` parameter.\n\nIn practice, however, parameters like `page[offset]` and `page[limit]` are\nusually defined and processed together, and it’s convenient to refer to them\ncollectively. Therefore, JSON:API introduces the concept of a query parameter\nfamily.\n\nA “query parameter family” is the set of all query parameters whose name starts\nwith a “base name”, followed by zero or more instances of empty square brackets\n(i.e. `[]`), square-bracketed legal member names, or square-bracketed\ndot-separated lists of legal member names. The family is referred to\nby its base name.\n\nFor example, the `filter` query parameter family includes parameters named:\n`filter`, `filter[x]`, `filter[]`, `filter[x][]`, `filter[][]`, `filter[x][y]`,\n`filter[x.y]`, etc. However, `filter[_]` is not a valid parameter name in the\nfamily, because `_` is not a valid member name.\n\n> Note: Dot separated lists of legal member names are intended to be used for\n> relationship paths. For example, this allows filtering strategies using\n> relationship paths as defined for sorting in query parameters\n> such as `GET /posts?sort=author.name&filter[author.status]=active`.\n\n### Extension-Specific Query Parameters\n\nThe base name of every query parameter introduced by an extension **MUST** be\nprefixed with the extension’s namespace followed by a colon (`:`). The\nremainder of the base name **MUST** contain only the characters [a-z] (U+0061\nto U+007A, “a-z”).\n\n### Implementation-Specific Query Parameters\n\nImplementations **MAY** support custom query parameters. However, the names of\nthese query parameters **MUST** come from a family\nwhose base name is a legal member name and also contains at least\none non a-z character (i.e., outside U+0061 to U+007A).\n\nIt is **RECOMMENDED** that a capital letter (e.g. camelCasing) be used to\nsatisfy the above requirement.\n\nIf a server encounters a query parameter that does not follow the naming\nconventions above, or the server does not know how to process it as a query\nparameter from this specification, it **MUST** return `400 Bad Request`.\n\n> Note: By forbidding the use of query parameters that contain only the characters\n> [a-z], JSON:API is reserving the ability to standardize additional query\n> parameters later without conflicting with existing implementations.\n\n## Errors\n\n### Processing Errors\n\nA server **MAY** choose to stop processing as soon as a problem is encountered,\nor it **MAY** continue processing and encounter multiple problems. For instance,\na server might process multiple attributes and then return multiple validation\nproblems in a single response.\n\nWhen a server encounters multiple problems for a single request, the most\ngenerally applicable HTTP error code **SHOULD** be used in the response. For\ninstance, `400 Bad Request` might be appropriate for multiple 4xx errors\nor `500 Internal Server Error` might be appropriate for multiple 5xx errors.\n\n### Error Objects\n\nError objects provide additional information about problems encountered while\nperforming an operation. Error objects **MUST** be returned as an array\nkeyed by `errors` in the top level of a JSON:API document.\n\nAn error object **MAY** have the following members, and **MUST** contain at\nleast one of:\n\n- `id` : a unique identifier for this particular occurrence of the problem.\n- `links` : a links object that **MAY** contain the following members:\n - `about` : a link that leads to further details about this\n particular occurrence of the problem. When dereferenced, this URI **SHOULD** return a human-readable description of the error.\n - `type` : a link that identifies the type of error that this\n particular error is an instance of. This URI **SHOULD** be dereferenceable to\n a human-readable explanation of the general error.\n- `status` : the HTTP status code applicable to this problem, expressed as a\nstring value. This **SHOULD** be provided.\n- `code` : an application-specific error code, expressed as a string value.\n- `title` : a short, human-readable summary of the problem that **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of\nlocalization.\n- `detail` : a human-readable explanation specific to this occurrence of the\nproblem. Like `title` , this field’s value can be localized.\n- `source` : an object containing references to the primary source of the error.\nIt **SHOULD** include one of the following members or be omitted:\n - `pointer` : a JSON Pointer [ [RFC6901](https://tools.ietf.org/html/rfc6901) ]\n to the value in the request document that caused the error [e.g. `\"/data\"` for a primary data object, or `\"/data/attributes/title\"` for a specific\n attribute]. This **MUST** point to a value in the request document that\n exists; if it doesn’t, the client **SHOULD** simply ignore the pointer.\n - `parameter` : a string indicating which URI query parameter caused\n the error.\n - `header` : a string indicating the name of a single request header which\n caused the error.\n- `meta` : a meta object containing non-standard meta-information about the\nerror.\n\n## Appendix\n\n### Query Parameters Details\n\n#### Parsing/Serialization\n\nA query parameter is a name–value pair extracted from, or serialized into, a\nURI’s query string.\n\nTo extract the query parameters from a URI, an implementation **MUST** run the\nURI’s query string, excluding the leading question mark, through the\n[`application/x-www-form-urlencoded` parsing algorithm](https://url.spec.whatwg.org/#urlencoded-parsing),\nwith one exception: JSON:API allows the specification that defines a query\nparameter’s usage to provide its own rules for parsing the parameter’s value\nfrom the `value` bytes identified in steps 3.2 and and 3.3 of the `application/x-www-form-urlencoded`\nparsing algorithm. The resulting value might not be a string.\n\n> Note: In general, the query string parsing built in to servers and browsers\n> will match the process specified above, so most implementations do not need\n> to worry about this.\n> \n> The `application/x-www-form-urlencoded` format is referenced because it is\n> the basis for the `a=b&c=d` style that almost all query strings use today.\n> \n> However, `application/x-www-form-urlencoded` parsing contains the bizarre\n> historical artifact that `+` characters must be treated as spaces, and it\n> requires that all values be percent-decoded during parsing, which makes it\n> impossible to use [RFC 3986 delimiter characters](https://tools.ietf.org/html/rfc3986#section-2.2)\n> as delimiters. These issues motivate the exception that JSON:API defines above.\n\nSimilarly, to serialize a query parameter into a URI, an implementation **MUST**\nuse [the `application/x-www-form-urlencoded` serializer](https://url.spec.whatwg.org/#concept-urlencoded-serializer),\nwith the corresponding exception that a parameter’s value — but not its name —\nmay be serialized differently than that algorithm requires, provided the\nserialization does not interfere with the ability to parse back the resulting URI.\n\n#### Square Brackets in Parameter Names\n\nWith query parameter families, JSON:API allows for\nquery parameters whose names contain square brackets (i.e., U+005B “[” and\nU+005D “]”).\n\nAccording to the query parameter serialization rules above, a compliant\nimplementation will percent-encode these square brackets. However, some URI\nproducers — namely browsers — do not always encode them. Servers **SHOULD**\naccept requests in which these square brackets are left unencoded in a query\nparameter’s name. If a server does accept these requests, it **MUST** treat the\nrequest as equivalent to one in which the square brackets were percent-encoded.", "znaku_textu": 74500, "slov": 11324, "odkazu": 140, "kodovani": "windows-1250", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/format", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:49", "sha256": "0561c0d7471422779fc231901aba8e90338b40abb20851689dafaa471df6cb4c", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["http://discuss.jsonapi.org/", "https://github.com/json-api/json-api", "http://www.iana.org/assignments/media-types/application/vnd.api+json", "https://tools.ietf.org/html/bcp14", "https://tools.ietf.org/html/rfc2119", "https://tools.ietf.org/html/rfc8174", "https://tools.ietf.org/html/rfc3986", "https://tools.ietf.org/html/rfc6906", "https://tools.ietf.org/html/rfc3339", "https://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc8259", "https://tools.ietf.org/html/rfc8288", "https://tools.ietf.org/html/rfc5646", "https://datatracker.ietf.org/doc/html/rfc3986", "http://www.w3.org/TR/json-ld/", "http://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc4122.html", "https://tools.ietf.org/html/rfc6901", "https://url.spec.whatwg.org/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/format/1.1/", "titulek": "JSON:API — Specification v1.1 (Archived Copy)", "h1": "Specification v1.1 (Archived Copy)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Specification v1.1 (Archived Copy)"}, {"uroven": 2, "text": "Status"}, {"uroven": 2, "text": "Introduction"}, {"uroven": 2, "text": "Semantics"}, {"uroven": 2, "text": "Conventions"}, {"uroven": 2, "text": "The JSON:API Media Type"}, {"uroven": 3, "text": "Media Type Parameters"}, {"uroven": 3, "text": "Extensions"}, {"uroven": 3, "text": "Profiles"}, {"uroven": 3, "text": "Rules for Media Type Parameters"}, {"uroven": 4, "text": "Rules for Extensions"}, {"uroven": 4, "text": "Rules for Profiles"}, {"uroven": 2, "text": "Content Negotiation"}, {"uroven": 3, "text": "Universal Responsibilities"}, {"uroven": 3, "text": "Client Responsibilities"}, {"uroven": 3, "text": "Server Responsibilities"}, {"uroven": 2, "text": "Document Structure"}, {"uroven": 3, "text": "Top Level"}, {"uroven": 3, "text": "Resource Objects"}, {"uroven": 4, "text": "Identification"}, {"uroven": 4, "text": "Fields"}, {"uroven": 5, "text": "Attributes"}, {"uroven": 5, "text": "Relationships"}, {"uroven": 5, "text": "Resource Linkage"}, {"uroven": 4, "text": "Resource Links"}, {"uroven": 3, "text": "Resource Identifier Objects"}, {"uroven": 3, "text": "Compound Documents"}, {"uroven": 3, "text": "Meta Information"}, {"uroven": 3, "text": "Links"}, {"uroven": 4, "text": "Link objects"}, {"uroven": 3, "text": "JSON:API Object"}, {"uroven": 3, "text": "Member Names"}, {"uroven": 4, "text": "Allowed Characters"}, {"uroven": 4, "text": "Reserved Characters"}, {"uroven": 4, "text": "@-Members"}, {"uroven": 4, "text": "Extension Members"}, {"uroven": 2, "text": "Fetching Data"}, {"uroven": 3, "text": "Fetching Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Fetching Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Sparse Fieldsets"}, {"uroven": 3, "text": "Sorting"}, {"uroven": 3, "text": "Filtering"}, {"uroven": 2, "text": "Creating, Updating and Deleting Resources"}, {"uroven": 3, "text": "Creating Resources"}, {"uroven": 4, "text": "Client-Generated IDs"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "201 Created"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Resources"}, {"uroven": 4, "text": "Updating a Resource’s Attributes"}, {"uroven": 4, "text": "Updating a Resource’s Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Relationships"}, {"uroven": 4, "text": "Updating To-One Relationships"}, {"uroven": 4, "text": "Updating To-Many Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Deleting Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "404 NOT FOUND"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 2, "text": "Query Parameters"}, {"uroven": 3, "text": "Query Parameter Families"}, {"uroven": 3, "text": "Extension-Specific Query Parameters"}, {"uroven": 3, "text": "Implementation-Specific Query Parameters"}, {"uroven": 2, "text": "Errors"}, {"uroven": 3, "text": "Processing Errors"}, {"uroven": 3, "text": "Error Objects"}, {"uroven": 2, "text": "Appendix"}, {"uroven": 3, "text": "Query Parameters Details"}, {"uroven": 4, "text": "Parsing/Serialization"}, {"uroven": 4, "text": "Square Brackets in Parameter Names"}], "markdown": "# Specification v1.1 (Archived Copy)\n\n## Status\n\nThis page presents an archived copy of JSON:API version 1.1. None\n of the normative text on this page will change. **Subsequent versions of\n JSON:API will remain compatible with this one**, as JSON:API uses a *never\n remove, only add* strategy.\n\nIf you catch an error in the specification’s text, or if you write an\n implementation, please let us know by opening an issue or pull request at our\n [GitHub repository](https://github.com/json-api/json-api).\n\n## Introduction\n\nJSON:API is a specification for how a client should request that resources be\nfetched or modified, and how a server should respond to those requests. JSON:API\ncan be easily extended with extensions and profiles.\n\nJSON:API is designed to minimize both the number of requests and the amount of\ndata transmitted between clients and servers. This efficiency is achieved\nwithout compromising readability, flexibility, or discoverability.\n\nJSON:API requires use of the JSON:API media type\n([`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json))\nfor exchanging data.\n\n## Semantics\n\nAll document members, query parameters, and processing rules defined by\nthis specification are collectively called “specification semantics”.\n\nCertain document members, query parameters, and processing rules are reserved\nfor implementors to define at their discretion. These are called “implementation\nsemantics”.\n\nAll other semantics are reserved for potential future use by this specification.\n\n## Conventions\n\nThe key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,\n“SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this\ndocument are to be interpreted as described in\n[BCP 14](https://tools.ietf.org/html/bcp14)\n[[RFC2119](https://tools.ietf.org/html/rfc2119)]\n[[RFC8174](https://tools.ietf.org/html/rfc8174)]\nwhen, and only when, they appear in all capitals, as shown here.\n\n## The JSON:API Media Type\n\nThe JSON:API media type is\n[`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).\n\n### Media Type Parameters\n\nThe JSON:API specification supports two media type parameters: `ext` and\n`profile`, which are used to specify extensions and profiles, respectively.\n\n> Note: A media type parameter is an extra piece of information that can\n> accompany a media type. For example, in the header\n> `Content-Type: text/html;charset=\"utf-8\"`, the media type is `text/html` and\n> `charset` is a parameter.\n\n### Extensions\n\nExtensions provide a means to “extend” the base specification by defining\nadditional specification semantics.\n\nExtensions cannot alter or remove specification semantics, nor can they specify\nimplementation semantics.\n\n### Profiles\n\nProfiles provide a means to share a particular usage of the specification among\nimplementations.\n\nProfiles can specify implementation semantics, but cannot alter,\nadd to, or remove specification semantics.\n\n### Rules for Media Type Parameters\n\nThe JSON:API media type **MUST NOT** be specified with any media type parameters\nother than `ext` and `profile`. The `ext` parameter is used to support\nextensions and the `profile` parameter is used to support profiles.\n\nExtensions and profiles are each uniquely identified by a\n[URI](https://tools.ietf.org/html/rfc3986). Visiting an extension’s or a\nprofile’s URI **SHOULD** return documentation that describes its usage. The\nvalues of the `ext` and `profile` parameters **MUST** equal a space-separated\n(U+0020 SPACE, “ “) list of extension or profile URIs, respectively.\n\n> Note: When serializing the `ext` or `profile` media type parameters, the HTTP\n> specification requires that parameter values be surrounded by quotation marks\n> (U+0022 QUOTATION MARK, “\"”).\n\n#### Rules for Extensions\n\nAn extension **MAY** impose additional processing rules or further restrictions\nand it **MAY** define new object members as described below.\n\nAn extension **MUST NOT** lessen or remove any processing rules, restrictions or\nobject member requirements defined in this specification or other extensions.\n\nAn extension **MAY** define new members within the document structure defined by\nthis specification. The rules for extension member names are covered\nbelow.\n\nAn extension **MAY** define new query parameters. The rules for extension-defined\nquery parameters are covered below.\n\nWhen an extension defines new query parameters or document members, the\nextension **MUST** define a namespace to guarantee that extensions will never\nconflict with current or future versions of this specification. A namespace\n**MUST** meet all of the following conditions:\n\n- A namespace **MUST** contain at least one character.\n- A namespace **MUST** contain only these characters:\n - U+0061 to U+007A, “a-z”\n - U+0041 to U+005A, “A-Z”\n - U+0030 to U+0039, “0-9”\n\nAn extension **MUST NOT** define more than one namespace. The namespace used for\nall query parameters and document members **MUST** be the same for any given\nextension.\n\nIn the following example, an extension with the namespace `version` has\nspecified a resource object member `version:id` to support per-resource\nversioning. This member might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/version\" // ... { \"type\": \"articles\", \"id\": \"1\", \"version:id\": \"42\", \"attributes\": { \"title\": \"Rails is Omakase\" } } // ... \n```\n\n#### Rules for Profiles\n\nThe rules for profile usage are dictated by [RFC\n6906](https://tools.ietf.org/html/rfc6906).\n\nA profile **MAY** define document members and processing rules that are reserved\nfor implementors.\n\nA profile **MUST NOT** define any query parameters except implementation-specific query parameters.\n\nA profile **MUST NOT** alter or remove processing rules that have been defined\nby this specification or by an extension. However, a profile\n**MAY** define processing rules for query parameters whose processing rules\nhave been reserved for implementors to define at their discretion.\n\nFor example, a profile could define rules for interpreting the `filter` query\nparameter, but it could not specify that relationship\nnames in the `include` query parameter are\nspace-separated instead of dot-separated.\n\nUnlike extensions, profiles do not need to define a namespace for document\nmembers because profiles cannot define specification semantics and thus cannot\nconflict with current or future versions of this specification. However, it is\npossible for profiles to conflict with other profiles. Therefore, it is the\nresponsibility of implementors to ensure that they do not support conflicting\nprofiles.\n\nIn the following example, a profile has defined a `timestamps` attribute. According to the profile, the attribute must be an\nobject containing a `created` member and a `modified` member and these members’\nvalues must use the [RFC 3339](https://tools.ietf.org/html/rfc3339) format.\nWith such a profile applied, a response might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;profile=\"https://example.com/resource-timestamps\" // ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\", \"timestamps\": { \"created\": \"2020-07-21T12:09:00Z\", \"modified\": \"2020-07-30T10:19:01Z\" } } } // ... \n```\n\n## Content Negotiation\n\n### Universal Responsibilities\n\nClients and servers **MUST** send all JSON:API payloads using the JSON:API media\ntype in the `Content-Type` header.\n\nClients and servers **MUST** specify the `ext` media type parameter in the\n`Content-Type` header when they have applied one or more extensions to a\nJSON:API document.\n\nClients and servers **MUST** specify the `profile` media type parameters in the\n`Content-Type` header when they have applied one or more profiles to a JSON:API\ndocument.\n\n### Client Responsibilities\n\nWhen processing a JSON:API response document, clients **MUST** ignore any\nparameters other than `ext` and `profile` parameters in the server’s\n`Content-Type` header.\n\nA client **MAY** use the `ext` media type parameter in an `Accept` header to\nrequire that a server apply all the specified extensions to the response\ndocument.\n\nA client **MAY** use the `profile` media type parameter in an `Accept` header\nto request that the server apply one or more profiles to the response document.\n\n> Note: A client is allowed to send more than one acceptable media type in the\n> `Accept` header, including multiple instances of the JSON:API media type. This\n> allows clients to request different combinations of the `ext` and `profile`\n> media type parameters. A client can use [quality values](https://tools.ietf.org/html/rfc7231#section-5.3.2)\n> to indicate that some combinations are less preferable than others. Media types\n> specified without a qvalue are equally preferable to each other, regardless of\n> their order, and are always considered more preferable than a media type with a\n> qvalue less than 1.\n\n### Server Responsibilities\n\nIf a request specifies the `Content-Type` header with the JSON:API media type,\nservers **MUST** respond with a `415 Unsupported Media Type` status code if\nthat media type contains any media type parameters other than `ext` or\n`profile`.\n\nIf a request specifies the `Content-Type` header with an instance of\nthe JSON:API media type modified by the `ext` media type parameter and that\nparameter contains an unsupported extension URI, the server **MUST** respond\nwith a `415 Unsupported Media Type` status code.\n\n> Note: JSON:API servers that do not support version 1.1 of this specification\n> will respond with a `415 Unsupported Media Type` client error if the `ext` or\n> `profile` media type parameter is present.\n\nIf a request’s `Accept` header contains an instance of the JSON:API media type,\nservers **MUST** ignore instances of that media type which are modified by a\nmedia type parameter other than `ext` or `profile`. If all instances of that\nmedia type are modified with a media type parameter other than `ext` or `profile`,\nservers **MUST** respond with a `406 Not Acceptable` status code. If every\ninstance of that media type is modified by the `ext` parameter and each contains\nat least one unsupported extension URI, the server **MUST** also respond with a\n`406 Not Acceptable`.\n\nIf the `profile` parameter is received, a server **SHOULD** attempt to apply any\nrequested profile(s) to its response. A server **MUST** ignore any profiles\nthat it does not recognize.\n\n> Note: The above rules guarantee strict agreement on extensions between the\n> client and server, while the application of profiles is left to the discretion\n> of the server.\n\nServers that support the `ext` or `profile` media type parameters **SHOULD**\nspecify the `Vary` header with `Accept` as one of its values. This applies to\nresponses with and without any profiles or extensions applied.\n\n> Note: Some HTTP intermediaries (e.g. CDNs) may ignore the `Vary` header\n> unless specifically configured to respect it.\n\n## Document Structure\n\nThis section describes the structure of a JSON:API document, which is identified\nby the JSON:API media type. JSON:API documents are\ndefined in JavaScript Object Notation (JSON) [[RFC8259](http://tools.ietf.org/html/rfc8259)].\n\nAlthough the same media type is used for both request and response documents,\ncertain aspects are only applicable to one or the other. These differences are\ncalled out below.\n\nExtensions **MAY** define new members within the document structure. These\nmembers **MUST** comply with the naming requirements specified\nbelow.\n\nUnless otherwise noted, objects defined by this specification or any applied\nextensions **MUST NOT** contain any additional members. Client and server\nimplementations **MUST** ignore non-compliant members.\n\n> Note: These conditions allow this specification to evolve through additive\n> changes.\n\n### Top Level\n\nA JSON object **MUST** be at the root of every JSON:API request and response\ndocument containing data. This object defines a document’s “top level”.\n\nA document **MUST** contain at least one of the following top-level members:\n\n- `data` : the document’s “primary data”.\n- `errors` : an array of error objects .\n- `meta` : a meta object that contains non-standard\nmeta-information.\n- a member defined by an applied extension .\n\nThe members `data` and `errors` **MUST NOT** coexist in the same document.\n\nA document **MAY** contain any of these top-level members:\n\n- `jsonapi` : an object describing the server’s implementation.\n- `links` : a links object related to the document as a whole.\n- `included` : an array of resource objects that are related to the primary\ndata and/or each other (“included resources”).\n\nIf a document does not contain a top-level `data` key, the `included` member\n**MUST NOT** be present either.\n\nThe top-level links object **MAY** contain the following members:\n\n- `self` : the link that generated the current response document. If a\ndocument has extensions or profiles applied to it, this link **SHOULD** be\nrepresented by a link object with the `type` target attribute specifying the\nJSON:API media type with all applicable parameters.\n- `related` : a related resource link when the primary data represents a\nresource relationship.\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the current document.\n- pagination links for the primary data.\n\n> Note: The `self` link in the top-level `links` object allows a client to\n> refresh the data represented by the current response document. The client\n> should be able to use the provided link without applying any additional\n> information. Therefore the link must contain the query parameters provided\n> by the client to generate the response document. This includes but is not\n> limited to query parameters used for inclusion of related resources,\n> sparse fieldsets, sorting,\n> pagination and filtering.\n\nThe document’s “primary data” is a representation of the resource or collection\nof resources targeted by a request.\n\nPrimary data **MUST** be either:\n\n- a single resource object , a single resource identifier object , or `null` ,\nfor requests that target single resources\n- an array of resource objects , an array of resource identifier objects , or\nan empty array ( `[]` ), for requests that target resource collections\n\nFor example, the following primary data is a single resource object:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { // ... this article's attributes }, \"relationships\": { // ... this article's relationships } } } \n```\n\nThe following primary data is a single resource identifier object that\nreferences the same resource:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\" } } \n```\n\nA logical collection of resources **MUST** be represented as an array, even if\nit only contains one item or is empty.\n\n### Resource Objects\n\n“Resource objects” appear in a JSON:API document to represent resources.\n\nA resource object **MUST** contain at least the following top-level members:\n\n- `id`\n- `type`\n\nException: The `id` member is not required when the resource object originates\nat the client and represents a new resource to be created on the server. In that\ncase, a client **MAY** include a `lid` member to uniquely identify the resource\nby `type` *locally* within the document.\n\nIn addition, a resource object **MAY** contain any of these top-level members:\n\n- `attributes` : an attributes object representing some of the resource’s data.\n- `relationships` : a relationships object describing relationships between\n the resource and other JSON:API resources.\n- `links` : a links object containing links related to the resource.\n- `meta` : a meta object containing non-standard meta-information about a\nresource that can not be represented as an attribute or relationship.\n\nHere’s how an article (i.e. a resource of type “articles”) might appear in a document:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } // ... \n```\n\n#### Identification\n\nAs noted above, every resource object **MUST** contain a\n`type` member. Every resource object **MUST** also contain an `id` member,\nexcept when the resource object originates at the client and represents a new\nresource to be created on the server. If `id` is omitted due to this exception,\na `lid` member **MAY** be included to uniquely identify the resource by `type` *locally* within the document. The value of the `lid` member **MUST** be\nidentical for every representation of the resource in the document, including\nresource identifier objects.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nWithin a given API, each resource object’s `type` and `id` pair **MUST**\nidentify a single, unique resource. (The set of URIs controlled by a server,\nor multiple servers acting as one, constitute an API.)\n\nThe `type` member is used to describe resource objects that share common\nattributes and relationships.\n\nThe values of `type` members **MUST** adhere to the same constraints as\nmember names.\n\n> Note: This spec is agnostic about inflection rules, so the value of `type`\n> can be either plural or singular. However, the same value should be used\n> consistently throughout an implementation.\n\n#### Fields\n\nA resource object’s attributes and its relationships are collectively called\nits “fields”.\n\nFields for a resource object **MUST** share a common namespace with each\nother and with `type` and `id`. In other words, a resource can not have an\nattribute and relationship with the same name, nor can it have an attribute\nor relationship named `type` or `id`.\n\n##### Attributes\n\nThe value of the `attributes` key **MUST** be an object (an “attributes\nobject”). Members of the attributes object (“attributes”) represent information\nabout the resource object in which it’s defined.\n\nAttributes may contain any valid JSON value, including complex data structures\ninvolving JSON objects and arrays.\n\nKeys that reference related resources (e.g. `author_id`) **SHOULD NOT** appear\nas attributes. Instead, relationships **SHOULD** be used.\n\n> Note: See fields and member names for more restrictions on this container.\n\n##### Relationships\n\nThe value of the `relationships` key **MUST** be an object (a “relationships\nobject”). Each member of a relationships object represents\na “relationship” from the resource object\nin which it has been defined to other resource objects.\n\nRelationships may be to-one or to-many.\n\nA relationship’s name is given by its key. The value at that key **MUST** be an\nobject (“relationship object”).\n\nA “relationship object” **MUST** contain at least one of the following:\n\n- `links` : a links object containing at least one of the following:\n - `self` : a link for the relationship itself (a “relationship link”). This\n link allows the client to directly manipulate the relationship. For example,\n removing an `author` through an `article` ’s relationship URL would disconnect\n the person from the `article` without deleting the `people` resource itself.\n When fetched successfully, this link returns the linkage for the related resources as its primary data.\n (See Fetching Relationships .)\n - `related` : a related resource link\n - a member defined by an applied extension .\n- `data` : resource linkage\n- `meta` : a meta object that contains non-standard meta-information about the\nrelationship.\n- a member defined by an applied extension .\n\nA relationship object that represents a to-many relationship **MAY** also contain\npagination links under the `links` member, as described below. Any\npagination links in a relationship object **MUST** paginate the relationship\ndata, not the related resources.\n\n> Note: See fields and member names for more restrictions on this container.\n\nA “related resource link” provides access to resource objects linked\nin a relationship. When fetched, the related resource object(s)\nare returned as the response’s primary data.\n\nFor example, an `article`’s `comments` relationship could\nspecify a link that returns a collection of comment resource objects\nwhen retrieved through a `GET` request.\n\nIf present, a related resource link **MUST** reference a valid URL, even if the\nrelationship isn’t currently associated with any target resources. Additionally,\na related resource link **MUST NOT** change because its relationship’s content\nchanges.\n\n##### Resource Linkage\n\nResource linkage in a compound document allows a client to link together all\nof the included resource objects without having to `GET` any URLs via links.\n\nResource linkage **MUST** be represented as one of the following:\n\n- `null` for empty to-one relationships.\n- an empty array ( `[]` ) for empty to-many relationships.\n- a single resource identifier object for non-empty to-one relationships.\n- an array of resource identifier objects for non-empty to-many relationships.\n\n> Note: The spec does not impart meaning to order of resource identifier\n> objects in linkage arrays of to-many relationships, although implementations\n> may do that. Arrays of resource identifier objects may represent ordered\n> or unordered relationships, and both types can be mixed in one response\n> object.\n\nFor example, the following article is associated with an `author`:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nThe `author` relationship includes a link for the relationship itself (which\nallows the client to change the related author directly), a related resource\nlink to fetch the resource objects, and linkage information.\n\n#### Resource Links\n\nThe optional `links` member within each resource object contains links\nrelated to the resource.\n\nIf present, this links object **MAY** contain a `self` link that\nidentifies the resource represented by the resource object.\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nA server **MUST** respond to a `GET` request to the specified URL with a\nresponse that includes the resource as the primary data.\n\n### Resource Identifier Objects\n\nA “resource identifier object” is an object that identifies an individual\nresource.\n\nA “resource identifier object” **MUST** contain a `type` member. It **MUST**\nalso contain an `id` member, except when it represents a new resource to be\ncreated on the server. In this case, a `lid` member **MUST** be included that\nidentifies the new resource.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nA “resource identifier object” **MAY** also include a `meta` member, whose value is a meta object that\ncontains non-standard meta-information.\n\n### Compound Documents\n\nServers **MAY** allow responses that include related resources along with the\nrequested primary resources. Such responses are called “compound documents”.\n\nIn a compound document, all included resources **MUST** be represented as an\narray of resource objects in a top-level `included` member.\n\nEvery included resource object **MUST** be identified via a chain of\nrelationships originating in a document’s primary data. This means that\ncompound documents require “full linkage” and that no resource object can be\nincluded without a direct or indirect relationship to the document’s primary\ndata.\n\nThe only exception to the full linkage requirement is when relationship fields\nthat would otherwise contain linkage data are excluded due to\nsparse fieldsets requested by the client.\n\nA complete example document with multiple included relationships:\n\n```\n{ \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"links\": { \"self\": \"http://example.com/articles/1\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }, \"comments\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": \"http://example.com/articles/1/comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"5\" }, { \"type\": \"comments\", \"id\": \"12\" } ] } } }], \"included\": [{ \"type\": \"people\", \"id\": \"9\", \"attributes\": { \"firstName\": \"Dan\", \"lastName\": \"Gebhardt\", \"twitter\": \"dgeb\" }, \"links\": { \"self\": \"http://example.com/people/9\" } }, { \"type\": \"comments\", \"id\": \"5\", \"attributes\": { \"body\": \"First!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"2\" } } }, \"links\": { \"self\": \"http://example.com/comments/5\" } }, { \"type\": \"comments\", \"id\": \"12\", \"attributes\": { \"body\": \"I like XML better\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/comments/12\" } }] } \n```\n\nA compound document **MUST NOT** include more than one resource object for\neach `type` and `id` pair.\n\n> Note: In a single document, you can think of the `type` and `id` as a\n> composite key that uniquely references resource objects in another part of\n> the document.\n\n> Note: For resources that do not contain an `id` member but do contain a `lid`,\n> the `lid` is sufficient to establish resource identity and thus linkage between\n> resource objects and resource identifier objects throughout the document.\n\n> Note: This approach ensures that a single canonical resource object is\n> returned with each response, even when the same resource is referenced\n> multiple times.\n\n### Meta Information\n\nWhere specified, a `meta` member can be used to include non-standard\nmeta-information. The value of each `meta` member **MUST** be an object (a\n“meta object”).\n\nAny members **MAY** be specified within `meta` objects.\n\nFor example:\n\n```\n{ \"meta\": { \"copyright\": \"Copyright 2015 Example Corp.\", \"authors\": [ \"Yehuda Katz\", \"Steve Klabnik\", \"Dan Gebhardt\", \"Tyler Kellen\" ] }, \"data\": { // ... } } \n```\n\n### Links\n\nWhere specified, a `links` member can be used to represent links. The value\nof this member **MUST** be an object (a “links object”).\n\nWithin this object, a link **MUST** be represented as either:\n\n- a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target,\n- a link object or\n- `null` if the link does not exist.\n\nA link’s relation type **SHOULD** be inferred from the name of the link unless the\nlink is a link object and the link object has a `rel` member.\n\nA link’s context is the top-level object, resource\nobject, or relationship object in which it\nappears.\n\nIn the example below, the `self` link is a string whereas the `related` link is\na link object. The `related` link object provides additional information\nabout the targeted related resource collection as well as a schema that serves\nas a description document for that collection:\n\n```\n\"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": { \"href\": \"http://example.com/articles/1/comments\", \"title\": \"Comments\", \"describedby\": \"http://example.com/schemas/article-comments\", \"meta\": { \"count\": 10 } } } \n```\n\n#### Link objects\n\nA “link object” is an object that represents a [web link](https://tools.ietf.org/html/rfc8288).\n\nA link object **MUST** contain the following member:\n\n- `href` : a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target.\n\nA link object **MAY** also contain any of the following members:\n\n- `rel` : a string indicating the link’s relation type. The string **MUST** be a [valid link relation type](https://tools.ietf.org/html/rfc8288#section-2.1) .\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the link target.\n- `title` : a string which serves as a label for the destination of a link\nsuch that it can be used as a human-readable identifier (e.g., a menu\nentry).\n- `type` : a string indicating the media type of the link’s target.\n- `hreflang` : a string or an array of strings indicating the language(s) of the\nlink’s target. An array of strings indicates that the link’s target is\navailable in multiple languages. Each string **MUST** be a valid language tag\n[ [RFC5646](https://tools.ietf.org/html/rfc5646) ].\n- `meta` : a meta object containing non-standard meta-information about the\nlink.\n\n> Note: the `type` and `hreflang` members are only hints; the target resource\n> is not guaranteed to be available in the indicated media type or language\n> when the link is actually followed.\n\n### JSON:API Object\n\nA JSON:API document **MAY** include information about its implementation\nunder a top level `jsonapi` member. If present, the value of the `jsonapi`\nmember **MUST** be an object (a “jsonapi object”).\n\nThe jsonapi object **MAY** contain any of the following members:\n\n- `version` - whose value is a string indicating the highest JSON:API version\nsupported.\n- `ext` - an array of URIs for all applied extensions .\n- `profile` - an array of URIs for all applied profiles .\n- `meta` - a meta object that contains non-standard meta-information.\n\nClients and servers **MUST NOT** use an `ext` or `profile` member for content\nnegotiation. Content negotiation **MUST** only happen based on media type\nparameters in `Content-Type` header.\n\nA simple example appears below:\n\n```\n{ \"jsonapi\": { \"version\": \"1.1\", \"ext\": [ \"https://jsonapi.org/ext/atomic\" ], \"profile\": [ \"http://example.com/profiles/flexible-pagination\", \"http://example.com/profiles/resource-versioning\" ] } } \n```\n\nIf the `version` member is not present, clients should assume the server\nimplements at least version 1.0 of the specification.\n\n> Note: Because JSON:API is committed to making additive changes only, the\n> version string primarily indicates which new features a server may support.\n\n### Member Names\n\nImplementation and profile defined member names used in a JSON:API document\n**MUST** be treated as case sensitive by clients and servers, and they **MUST**\nmeet all of the following conditions:\n\n- Member names **MUST** contain at least one character.\n- Member names **MUST** contain only the allowed characters listed below.\n- Member names **MUST** start and end with a “globally allowed character”,\nas defined below.\n\nTo enable an easy mapping of member names to URLs, it is **RECOMMENDED** that\nmember names use only non-reserved, URL safe characters specified in [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).\n\n#### Allowed Characters\n\nThe following “globally allowed characters” **MAY** be used anywhere in a member name:\n\n- U+0061 to U+007A, “a-z”\n- U+0041 to U+005A, “A-Z”\n- U+0030 to U+0039, “0-9”\n- U+0080 and above (non-ASCII Unicode characters; *not recommended, not URL safe* )\n\nAdditionally, the following characters are allowed in member names, except as the\nfirst or last character:\n\n- U+002D HYPHEN-MINUS, “-“\n- U+005F LOW LINE, “_”\n- U+0020 SPACE, “ “ *(not recommended, not URL safe)*\n\n#### Reserved Characters\n\nThe following characters **MUST NOT** be used in implementation and\nprofile defined member names:\n\n- U+002B PLUS SIGN, “+” *(has overloaded meaning in URL query strings)*\n- U+002C COMMA, “,” *(used as a separator between relationship paths)*\n- U+002E PERIOD, “.” *(used as a separator within relationship paths)*\n- U+005B LEFT SQUARE BRACKET, “[” *(used in query parameter families)*\n- U+005D RIGHT SQUARE BRACKET, “]” *(used in query parameter families)*\n- U+0021 EXCLAMATION MARK, “!”\n- U+0022 QUOTATION MARK, â€�”’\n- U+0023 NUMBER SIGN, “#”\n- U+0024 DOLLAR SIGN, “$”\n- U+0025 PERCENT SIGN, “%”\n- U+0026 AMPERSAND, “&”\n- U+0027 APOSTROPHE, “’”\n- U+0028 LEFT PARENTHESIS, “(“\n- U+0029 RIGHT PARENTHESIS, “)”\n- U+002A ASTERISK, “*”\n- U+002F SOLIDUS, “/”\n- U+003A COLON, “:”\n- U+003B SEMICOLON, “;”\n- U+003C LESS-THAN SIGN, “<”\n- U+003D EQUALS SIGN, “=”\n- U+003E GREATER-THAN SIGN, “>”\n- U+003F QUESTION MARK, “?”\n- U+0040 COMMERCIAL AT, “@” (except as first character in @-Members )\n- U+005C REVERSE SOLIDUS, “\\”\n- U+005E CIRCUMFLEX ACCENT, “^”\n- U+0060 GRAVE ACCENT, “`”\n- U+007B LEFT CURLY BRACKET, “{“\n- U+007C VERTICAL LINE, “|”\n- U+007D RIGHT CURLY BRACKET, “}”\n- U+007E TILDE, “~”\n- U+007F DELETE\n- U+0000 to U+001F (C0 Controls)\n\n#### @-Members\n\nMember names **MAY** also begin with an at sign (U+0040 COMMERCIAL AT, “@”).\nMembers named this way are called “@-Members”. @-Members **MAY** appear\nanywhere in a document.\n\nThis specification provides no guidance on the meaning or usage of @-Members,\nwhich are considered to be implementation semantics. @-Members\n**MUST** be ignored when interpreting this specification’s definitions and\nprocessing instructions given outside of this subsection. For example, an\nattribute is defined above as any member of the attributes object.\nHowever, because @-Members must be ignored when interpreting that definition, an\n@-Member that occurs in an attributes object is not an attribute.\n\n> Note: Among other things, “@” members can be used to add JSON-LD data to a\n> JSON:API document. Such documents should be served with [an extra header](http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld)\n> to convey to JSON-LD clients that they contain JSON-LD data.\n\n#### Extension Members\n\nThe name of every new member introduced by an extension **MUST** be prefixed\nwith the extension’s namespace followed by a colon (`:`).\nThe remainder of the name **MUST** adhere to the rules for implementation\ndefined member names.\n\n## Fetching Data\n\nData, including resources and relationships, can be fetched by sending a\n`GET` request to an endpoint.\n\nResponses can be further refined with the optional features described below.\n\n### Fetching Resources\n\nA server **MUST** support fetching resource data for every URL provided as:\n\n- a `self` link as part of the top-level links object\n- a `self` link as part of a resource-level links object\n- a `related` link as part of a relationship-level links object\n\nFor example, the following request fetches a collection of articles:\n\n```\nGET /articles HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe following request fetches an article:\n\n```\nGET /articles/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches an article’s author:\n\n```\nGET /articles/1/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch an individual\nresource or resource collection with a `200 OK` response.\n\nA server **MUST** respond to a successful request to fetch a resource\ncollection with an array of resource objects or an empty array (`[]`) as\nthe response document’s primary data.\n\nFor example, a `GET` request to a collection of articles could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" } }, { \"type\": \"articles\", \"id\": \"2\", \"attributes\": { \"title\": \"Rails is Omakase\" } }] } \n```\n\nA similar response representing an empty collection would be:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [] } \n```\n\nA server **MUST** respond to a successful request to fetch an individual\nresource with a resource object or `null` provided as\nthe response document’s primary data.\n\n`null` is only an appropriate response when the requested URL is one that\nmight correspond to a single resource, but doesn’t currently.\n\n> Note: Consider, for example, a request to fetch a to-one related resource link.\n> This request would respond with `null` when the relationship is empty (such that\n> the link is corresponding to no resources) but with the single related resource’s\n> resource object otherwise.\n\nFor example, a `GET` request to an individual article could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1\" }, \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"related\": \"http://example.com/articles/1/author\" } } } } } \n```\n\nIf the above article’s author is missing, then a `GET` request to that related\nresource would return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1/author\" }, \"data\": null } \n```\n\n##### 404 Not Found\n\nA server **MUST** respond with `404 Not Found` when processing a request to\nfetch a single resource that does not exist, except when the request warrants a\n`200 OK` response with `null` as the primary data (as described above).\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Fetching Relationships\n\nA server **MUST** support fetching relationship data for every relationship URL\nprovided as a `self` link as part of a relationship’s `links` object.\n\nFor example, the following request fetches data about an article’s comments:\n\n```\nGET /articles/1/relationships/comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches data about an article’s author:\n\n```\nGET /articles/1/relationships/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch a relationship\nwith a `200 OK` response.\n\nThe primary data in the response document **MUST** match the appropriate\nvalue for resource linkage, as described above for\nrelationship objects.\n\nThe top-level links object **MAY** contain `self` and `related` links,\nas described above for relationship objects.\n\nFor example, a `GET` request to a URL from a to-one relationship link could\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": null } \n```\n\nA `GET` request to a URL from a to-many relationship link could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [] } \n```\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to fetch\na relationship link URL that does not exist.\n\n> Note: This can happen when the parent resource of the relationship\n> does not exist. For example, when `/articles/1` does not exist, request to\n> `/articles/1/relationships/tags` returns `404 Not Found`.\n\nIf a relationship link URL exists but the relationship is empty, then\n`200 OK` **MUST** be returned, as described above.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\nAn endpoint **MAY** return resources related to the primary data by default.\n\nAn endpoint **MAY** also support an `include` query parameter to allow the\nclient to customize which related resources should be returned.\n\nIf an endpoint does not support the `include` parameter, it **MUST** respond\nwith `400 Bad Request` to any requests that include it.\n\nIf an endpoint supports the `include` parameter and a client supplies it:\n\n- The server’s response **MUST** be a compound document with an `included` key — even if that `included` key holds an empty array (because the requested relationships are empty).\n- The server **MUST NOT** include unrequested resource objects in the `included` section of the compound document .\n\nThe value of the `include` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list of relationship paths. A relationship path is a dot-separated\n(U+002E FULL-STOP, “.”) list of relationship names. An empty\nvalue indicates that no related resources should be returned.\n\nIf a server is unable to identify a relationship path or does not support\ninclusion of resources from a path, it **MUST** respond with 400 Bad Request.\n\n> Note: For example, a relationship path could be `comments.author`, where\n> `comments` is a relationship listed under a `articles` resource object, and\n> `author` is a relationship listed under a `comments` resource object.\n\nFor instance, comments could be requested with an article:\n\n```\nGET /articles/1?include=comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn order to request resources related to other resources, a dot-separated path\nfor each relationship name can be specified:\n\n```\nGET /articles/1?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: Because compound documents require full linkage\n> (except when relationship linkage is excluded by sparse fieldsets), intermediate\n> resources in a multi-part path must be returned along with the leaf nodes. For\n> example, a response to a request for `comments.author` should include `comments`\n> as well as the `author` of each of those `comments`.\n\n> Note: A server may choose to expose a deeply nested relationship such as\n> `comments.author` as a direct relationship with an alternative name such as\n> `commentAuthors`. This would allow a client to request\n> `/articles/1?include=commentAuthors` instead of\n> `/articles/1?include=comments.author`. By exposing the nested relationship with\n> an alternative name, the server can still provide full linkage in compound\n> documents without including potentially unwanted intermediate resources.\n\nMultiple related resources can be requested in a comma-separated list:\n\n```\nGET /articles/1?include=comments.author,ratings HTTP/1.1 Accept: application/vnd.api+json \n```\n\nFurthermore, related resources can be requested from a relationship endpoint:\n\n```\nGET /articles/1/relationships/comments?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn this case, the primary data would be a collection of\nresource identifier objects that represent linkage to comments for an article,\nwhile the full comments and comment authors would be returned as included data.\n\n> Note: This section applies to any endpoint that responds with primary\n> data, regardless of the request type. For instance, a server could support\n> the inclusion of related resources along with a `POST` request to create a\n> resource or relationship.\n\n### Sparse Fieldsets\n\nA client **MAY** request that an endpoint return only specific fields in the\nresponse on a per-type basis by including a `fields[TYPE]` query parameter.\n\nThe value of any `fields[TYPE]` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list that refers to the name(s) of the fields to be returned.\nAn empty value indicates that no fields should be returned.\n\nIf a client requests a restricted set of fields for a given resource type,\nan endpoint **MUST NOT** include additional fields in resource objects of\nthat type in its response.\n\nIf a client does not specify the set of fields for a given resource type, the\nserver **MAY** send all fields, a subset of fields, or no fields for that\nresource type.\n\n```\nGET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply for\n> readability. In practice, these characters should be percent-encoded. See\n> “Square Brackets in Parameter Names”.\n\n> Note: This section applies to any endpoint that responds with resources as\n> primary or included data, regardless of the request type. For instance, a\n> server could support sparse fieldsets along with a `POST` request to create\n> a resource.\n\n### Sorting\n\nA server **MAY** choose to support requests to sort resource collections\naccording to one or more criteria (“sort fields”).\n\n> Note: Although recommended, sort fields do not necessarily need to\n> correspond to resource attribute and relationship names.\n\n> Note: It is recommended that dot-separated (U+002E FULL-STOP, “.”) sort\n> fields be used to request sorting based upon relationship attributes. For\n> example, a sort field of `author.name` could be used to request that the\n> primary data be sorted based upon the `name` attribute of the `author`\n> relationship.\n\nAn endpoint **MAY** support requests to sort the primary data with a `sort`\nquery parameter. The value for `sort` **MUST** represent sort fields.\n\n```\nGET /people?sort=age HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAn endpoint **MAY** support multiple sort fields by allowing comma-separated\n(U+002C COMMA, “,”) sort fields. Sort fields **SHOULD** be applied in the\norder specified.\n\n```\nGET /people?sort=age,name HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe sort order for each sort field **MUST** be ascending unless it is prefixed\nwith a minus (U+002D HYPHEN-MINUS, “-“), in which case it **MUST** be descending.\n\n```\nGET /articles?sort=-created,title HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe above example should return the newest articles first. Any articles\ncreated on the same date will then be sorted by their title in ascending\nalphabetical order.\n\nIf the server does not support sorting as specified in the query parameter\n`sort`, it **MUST** return `400 Bad Request`.\n\nIf sorting is supported by the server and requested by the client via query\nparameter `sort`, the server **MUST** return elements of the top-level\n`data` array of the response ordered according to the criteria specified.\nThe server **MAY** apply default sorting rules to top-level `data` if\nrequest parameter `sort` is not specified.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\nA server **MAY** choose to limit the number of resources returned in a response\nto a subset (“page”) of the whole set available.\n\nA server **MAY** provide links to traverse a paginated data set (“pagination\nlinks”).\n\nPagination links **MUST** appear in the links object that corresponds to a\ncollection. To paginate the primary data, supply pagination links in the\ntop-level `links` object. To paginate an included collection returned in\na compound document, supply pagination links in the corresponding links\nobject.\n\nThe following keys **MUST** be used for pagination links:\n\n- `first` : the first page of data\n- `last` : the last page of data\n- `prev` : the previous page of data\n- `next` : the next page of data\n\nKeys **MUST** either be omitted or have a `null` value to indicate that a\nparticular link is unavailable.\n\nConcepts of order, as expressed in the naming of pagination links, **MUST**\nremain consistent with JSON:API’s sorting rules.\n\nThe `page` query parameter family is reserved for pagination. Servers and\nclients **SHOULD** use these parameters for pagination operations.\n\n> Note: JSON API is agnostic about the pagination strategy used by a server, but\n> the `page` query parameter family can be used regardless of the strategy\n> employed. For example, a page-based strategy might use query parameters such\n> as `page[number]` and `page[size]`, while a cursor-based strategy might use\n> `page[cursor]`.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\n### Filtering\n\nThe `filter` query parameter family is reserved for filtering data. Servers\nand clients **SHOULD** use these parameters for filtering operations.\n\n> Note: JSON API is agnostic about the strategies supported by a server.\n\n## Creating, Updating and Deleting Resources\n\nA server **MAY** allow resources of a given type to be created. It **MAY**\nalso allow existing resources to be modified or deleted.\n\nA request **MUST** completely succeed or fail (in a single “transaction”). No\npartial updates are allowed.\n\n> Note: The `type` member is required in every resource object throughout requests and\n> responses in JSON:API. There are some cases, such as when `POST`ing to an\n> endpoint representing heterogeneous data, when the `type` could not be inferred\n> from the endpoint. However, picking and choosing when it is required would be\n> confusing; it would be hard to remember when it was required and when it was\n> not. Therefore, to improve consistency and minimize confusion, `type` is\n> always required.\n\n### Creating Resources\n\nA resource can be created by sending a `POST` request to a URL that represents\na collection of resources. The request **MUST** include a single resource object\nas primary data. The resource object **MUST** contain at least a `type` member.\n\nFor instance, a new photo might be created with the following request:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"relationships\": { \"photographer\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } } \n```\n\nIf a relationship is provided in the `relationships` member of the\nresource object, its value **MUST** be a relationship object with a `data`\nmember. The value of this key represents the linkage the new resource is to\nhave.\n\n#### Client-Generated IDs\n\nA server **MAY** accept a client-generated ID along with a request to create\na resource. An ID **MUST** be specified with an `id` key, the value of\nwhich **MUST** be a universally unique identifier. The client **SHOULD** use\na properly generated and formatted *UUID* as described in RFC 4122\n[[RFC4122](http://tools.ietf.org/html/rfc4122.html)].\n\n> NOTE: In some use-cases, such as importing data from another source, it\n> may be possible to use something other than a UUID that is still guaranteed\n> to be globally unique. Do not use anything other than a UUID unless you are\n> 100% confident that the strategy you are using indeed generates globally\n> unique identifiers.\n\nFor example:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" } } } \n```\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto create a resource with a client-generated ID.\n\n#### Responses\n\n##### 201 Created\n\nIf the requested resource has been created successfully and the server changes\nthe resource in any way (for example, by assigning an `id`), the server **MUST**\nreturn a `201 Created` response and a document that contains the resource as\nprimary data.\n\nThe response **SHOULD** include a `Location` header identifying the location\nof the newly created resource, in order to comply with [RFC\n7231](http://tools.ietf.org/html/rfc7231#section-6.3.2).\n\nIf the resource object returned by the response contains a `self` key in its\n`links` member and a `Location` header is provided, the value of the `self`\nmember **MUST** match the value of the `Location` header.\n\n```\nHTTP/1.1 201 Created Location: http://example.com/photos/550e8400-e29b-41d4-a716-446655440000 Content-Type: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"links\": { \"self\": \"http://example.com/photos/550e8400-e29b-41d4-a716-446655440000\" } } } \n```\n\nA server **MAY** return a `201 Created` response with a document that contains\nno primary data if the requested resource has been created successfully and the\nserver does not change the resource in any way (for example, by assigning an\n`id` or `createdAt` attribute). Other top-level members, such as meta, could\nbe included in the response document.\n\n> Note: Only servers that accept Client-Generated\n> IDs can avoid assigning an `id` to a new resource.\n\n##### 202 Accepted\n\nIf a request to create a resource has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf the requested resource has been created successfully and the server does not\nchange the resource in any way (for example, by assigning an `id` or `createdAt`\nattribute), the server **MUST** return either a `201 Created` status code and\nresponse document (as described above) or a `204 No Content` status code with no\nresponse document.\n\n##### 403 Forbidden\n\nA server **MAY** return `403 Forbidden` in response to an unsupported request\nto create a resource.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MUST** return `409 Conflict` when processing a `POST` request to\ncreate a resource with a client-generated ID that already exists.\n\nA server **MUST** return `409 Conflict` when processing a `POST` request in\nwhich the resource object’s `type` is not among the type(s) that constitute the\ncollection represented by the endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Resources\n\nA resource can be updated by sending a `PATCH` request to the URL that\nrepresents the resource.\n\nThe URL for a resource can be obtained in the `self` link of the resource\nobject. Alternatively, when a `GET` request returns a single resource object as\nprimary data, the same request URL can be used for updates.\n\nThe `PATCH` request **MUST** include a single resource object as primary data.\nThe resource object **MUST** contain `type` and `id` members.\n\nFor example:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\" } } } \n```\n\n#### Updating a Resource’s Attributes\n\nAny or all of a resource’s attributes **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the attributes for a resource, the server\n**MUST** interpret the missing attributes as if they were included with their\ncurrent values. The server **MUST NOT** interpret missing attributes as `null`\nvalues.\n\nFor example, the following `PATCH` request is interpreted as a request to\nupdate only the `title` and `text` attributes of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\", \"text\": \"TLDR; It's complicated... but check your test coverage regardless.\" } } } \n```\n\n#### Updating a Resource’s Relationships\n\nAny or all of a resource’s relationships **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the relationships for a resource, the server\n**MUST** interpret the missing relationships as if they were included with their\ncurrent values. It **MUST NOT** interpret them as `null` or empty values.\n\nIf a relationship is provided in the `relationships` member of a resource\nobject in a `PATCH` request, its value **MUST** be a relationship object\nwith a `data` member. The relationship’s value will be replaced with the\nvalue specified in this member.\n\nFor instance, the following `PATCH` request will update the `author` relationship of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"1\" } } } } } \n```\n\nLikewise, the following `PATCH` request performs a complete replacement of\nthe `tags` for an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"tags\": { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } } } } \n```\n\nA server **MAY** reject an attempt to do a full replacement of a to-many\nrelationship. In such a case, the server **MUST** reject the entire update,\nand return a `403 Forbidden` response.\n\n> Note: Since full replacement may be a very dangerous operation, a server\n> may choose to disallow it. For example, a server may reject full replacement if\n> it has not provided the client with the full list of associated objects, and\n> does not want to allow deletion of records the client has not seen.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted resource in ways\nother than those specified by the request (for example, updating the\n`updatedAt` attribute or a computed `sha`), it **MUST** return a `200 OK`\nresponse and a document that contains the updated resource as primary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted resource in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf an update request has been accepted for processing, but the processing\nhas not been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nresource in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a resource or relationship.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to modify\na resource that does not exist.\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MAY** return `409 Conflict` when processing a `PATCH` request to\nupdate a resource if that update would violate other server-enforced\nconstraints (such as a uniqueness constraint on a property other than `id`).\n\nA server **MUST** return `409 Conflict` when processing a `PATCH` request in\nwhich the resource object’s `type` or `id` do not match the server’s endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Relationships\n\nAlthough relationships can be modified along with resources (as described\nabove), JSON:API also supports updating of relationships independently at\nURLs from relationship links.\n\n> Note: Relationships are updated without exposing the underlying server\n> semantics, such as foreign keys. Furthermore, relationships can be updated\n> without necessarily affecting the related resources. For example, if an article\n> has many authors, it is possible to remove one of the authors from the article\n> without deleting the person itself. Similarly, if an article has many tags, it\n> is possible to add or remove tags. Under the hood on the server, the first\n> of these examples might be implemented with a foreign key, while the second\n> could be implemented with a join table, but the JSON:API protocol would be\n> the same in both cases.\n\n> Note: A server may choose to delete the underlying resource if a\n> relationship is deleted (as a garbage collection measure).\n\n#### Updating To-One Relationships\n\nA to-one relationship can be updated by sending a `PATCH` request to a URL\nfrom a to-one relationship link.\n\nThe `PATCH` request **MUST** include a top-level member named `data` containing\none of:\n\n- a resource identifier object corresponding to the new related resource.\n- `null` , to remove the relationship.\n\nFor example, the following request updates the author of an article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nAnd the following request clears the author of the same article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": null } \n```\n\nIf the relationship is updated successfully then the server **MUST** return\na successful response.\n\n#### Updating To-Many Relationships\n\nA to-many relationship can be updated by sending a `PATCH`, `POST`, or\n`DELETE` request to a URL from a to-many relationship link.\n\nFor all request types, the body **MUST** contain a `data` member whose value\nis an empty array or an array of resource identifier objects.\n\nIf a client makes a `PATCH` request to a URL from a to-many\nrelationship link, the server **MUST** either completely\nreplace every member of the relationship, return an appropriate error response\nif some resources cannot be found or accessed, or return a `403 Forbidden`\nresponse if complete replacement is not allowed by the server.\n\nFor example, the following request replaces every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nAnd the following request clears every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [] } \n```\n\nIf a client makes a `POST` request to a URL from a\nrelationship link, the server **MUST** add the specified\nmembers to the relationship unless they are already present. If a given `type`\nand `id` is already in the relationship, the server **MUST NOT** add it again.\n\n> Note: This matches the semantics of databases that use foreign keys for\n> has-many relationships. Document-based storage should check the has-many\n> relationship before appending to avoid duplicates.\n\nIf all of the specified resources can be added to, or are already present\nin, the relationship then the server **MUST** return a successful response.\n\n> Note: This approach ensures that a request is successful if the server’s\n> state matches the requested state, and helps avoid pointless race conditions\n> caused by multiple clients making the same changes to a relationship.\n\nIn the following example, the comment with ID `123` is added to the list of\ncomments for the article with ID `1`:\n\n```\nPOST /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"123\" } ] } \n```\n\nIf the client makes a `DELETE` request to a URL from a\nrelationship link the server **MUST** delete the specified\nmembers from the relationship or return a `403 Forbidden` response. If all of\nthe specified resources are able to be removed from, or are already missing\nfrom, the relationship then the server **MUST** return a successful response.\n\n> Note: As described above for `POST` requests, this approach helps avoid\n> pointless race conditions between multiple clients making the same changes.\n\nRelationship members are specified in the same way as in the `POST` request.\n\nIn the following example, comments with IDs of `12` and `13` are removed\nfrom the list of comments for the article with ID `1`:\n\n```\nDELETE /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"12\" }, { \"type\": \"comments\", \"id\": \"13\" } ] } \n```\n\n> Note: RFC 7231 specifies that a DELETE request may include a body, but\n> that a server may reject the request. This spec defines the semantics of a\n> server, and we are defining its semantics for JSON:API.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted relationship in\nother ways than those specified by the request, it **MUST** return a `200 OK`\nresponse and a document that includes the updated relationship data as its\nprimary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted relationship in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a relationship update request has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nrelationship in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n> Note: This is the appropriate response to a `POST` request sent to a URL\n> from a to-many relationship link when that relationship already\n> exists. It is also the appropriate response to a `DELETE` request sent to a URL\n> from a to-many relationship link when that relationship does\n> not exist.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a relationship.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Deleting Resources\n\nA resource can be deleted by sending a `DELETE` request to the URL\nthat represents the resource:\n\n```\nDELETE /photos/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if a deletion request is successful. Other top-level members, such\nas meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a deletion request has been accepted for processing, but the processing has\nnot been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf a deletion request is successful, the server **MUST** return either a `200\nOK` status code and response document (as described above) or a `204 No Content`\nstatus code with no response document.\n\n##### 404 NOT FOUND\n\nA server **SHOULD** return a `404 Not Found` status code if a deletion request fails\ndue to the resource not existing.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n## Query Parameters\n\n### Query Parameter Families\n\nAlthough “query parameter” is a common term in everyday web development, it is\nnot a well-standardized concept. Therefore, JSON:API provides its own\ndefinition of a query parameter.\n\nFor the most part, JSON:API’s definition coincides with colloquial usage, and its\ndetails can be safely ignored. However, one important consequence of this\ndefinition is that a URL like the following is considered to have two distinct\nquery parameters:\n\n```\n/?page[offset]=0&page[limit]=10\n```\n\nThe two parameters are named `page[offset]` and `page[limit]`; there is no\nsingle `page` parameter.\n\nIn practice, however, parameters like `page[offset]` and `page[limit]` are\nusually defined and processed together, and it’s convenient to refer to them\ncollectively. Therefore, JSON:API introduces the concept of a query parameter\nfamily.\n\nA “query parameter family” is the set of all query parameters whose name starts\nwith a “base name”, followed by zero or more instances of empty square brackets\n(i.e. `[]`), square-bracketed legal member names, or square-bracketed\ndot-separated lists of legal member names. The family is referred to\nby its base name.\n\nFor example, the `filter` query parameter family includes parameters named:\n`filter`, `filter[x]`, `filter[]`, `filter[x][]`, `filter[][]`, `filter[x][y]`,\n`filter[x.y]`, etc. However, `filter[_]` is not a valid parameter name in the\nfamily, because `_` is not a valid member name.\n\n> Note: Dot separated lists of legal member names are intended to be used for\n> relationship paths. For example, this allows filtering strategies using\n> relationship paths as defined for sorting in query parameters\n> such as `GET /posts?sort=author.name&filter[author.status]=active`.\n\n### Extension-Specific Query Parameters\n\nThe base name of every query parameter introduced by an extension **MUST** be\nprefixed with the extension’s namespace followed by a colon (`:`). The\nremainder of the base name **MUST** contain only the characters [a-z] (U+0061\nto U+007A, “a-z”).\n\n### Implementation-Specific Query Parameters\n\nImplementations **MAY** support custom query parameters. However, the names of\nthese query parameters **MUST** come from a family\nwhose base name is a legal member name and also contains at least\none non a-z character (i.e., outside U+0061 to U+007A).\n\nIt is **RECOMMENDED** that a capital letter (e.g. camelCasing) be used to\nsatisfy the above requirement.\n\nIf a server encounters a query parameter that does not follow the naming\nconventions above, or the server does not know how to process it as a query\nparameter from this specification, it **MUST** return `400 Bad Request`.\n\n> Note: By forbidding the use of query parameters that contain only the characters\n> [a-z], JSON:API is reserving the ability to standardize additional query\n> parameters later without conflicting with existing implementations.\n\n## Errors\n\n### Processing Errors\n\nA server **MAY** choose to stop processing as soon as a problem is encountered,\nor it **MAY** continue processing and encounter multiple problems. For instance,\na server might process multiple attributes and then return multiple validation\nproblems in a single response.\n\nWhen a server encounters multiple problems for a single request, the most\ngenerally applicable HTTP error code **SHOULD** be used in the response. For\ninstance, `400 Bad Request` might be appropriate for multiple 4xx errors\nor `500 Internal Server Error` might be appropriate for multiple 5xx errors.\n\n### Error Objects\n\nError objects provide additional information about problems encountered while\nperforming an operation. Error objects **MUST** be returned as an array\nkeyed by `errors` in the top level of a JSON:API document.\n\nAn error object **MAY** have the following members, and **MUST** contain at\nleast one of:\n\n- `id` : a unique identifier for this particular occurrence of the problem.\n- `links` : a links object that **MAY** contain the following members:\n - `about` : a link that leads to further details about this\n particular occurrence of the problem. When dereferenced, this URI **SHOULD** return a human-readable description of the error.\n - `type` : a link that identifies the type of error that this\n particular error is an instance of. This URI **SHOULD** be dereferenceable to\n a human-readable explanation of the general error.\n- `status` : the HTTP status code applicable to this problem, expressed as a\nstring value. This **SHOULD** be provided.\n- `code` : an application-specific error code, expressed as a string value.\n- `title` : a short, human-readable summary of the problem that **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of\nlocalization.\n- `detail` : a human-readable explanation specific to this occurrence of the\nproblem. Like `title` , this field’s value can be localized.\n- `source` : an object containing references to the primary source of the error.\nIt **SHOULD** include one of the following members or be omitted:\n - `pointer` : a JSON Pointer [ [RFC6901](https://tools.ietf.org/html/rfc6901) ]\n to the value in the request document that caused the error [e.g. `\"/data\"` for a primary data object, or `\"/data/attributes/title\"` for a specific\n attribute]. This **MUST** point to a value in the request document that\n exists; if it doesn’t, the client **SHOULD** simply ignore the pointer.\n - `parameter` : a string indicating which URI query parameter caused\n the error.\n - `header` : a string indicating the name of a single request header which\n caused the error.\n- `meta` : a meta object containing non-standard meta-information about the\nerror.\n\n## Appendix\n\n### Query Parameters Details\n\n#### Parsing/Serialization\n\nA query parameter is a name–value pair extracted from, or serialized into, a\nURI’s query string.\n\nTo extract the query parameters from a URI, an implementation **MUST** run the\nURI’s query string, excluding the leading question mark, through the\n[`application/x-www-form-urlencoded` parsing algorithm](https://url.spec.whatwg.org/#urlencoded-parsing),\nwith one exception: JSON:API allows the specification that defines a query\nparameter’s usage to provide its own rules for parsing the parameter’s value\nfrom the `value` bytes identified in steps 3.2 and and 3.3 of the `application/x-www-form-urlencoded`\nparsing algorithm. The resulting value might not be a string.\n\n> Note: In general, the query string parsing built in to servers and browsers\n> will match the process specified above, so most implementations do not need\n> to worry about this.\n> \n> The `application/x-www-form-urlencoded` format is referenced because it is\n> the basis for the `a=b&c=d` style that almost all query strings use today.\n> \n> However, `application/x-www-form-urlencoded` parsing contains the bizarre\n> historical artifact that `+` characters must be treated as spaces, and it\n> requires that all values be percent-decoded during parsing, which makes it\n> impossible to use [RFC 3986 delimiter characters](https://tools.ietf.org/html/rfc3986#section-2.2)\n> as delimiters. These issues motivate the exception that JSON:API defines above.\n\nSimilarly, to serialize a query parameter into a URI, an implementation **MUST**\nuse [the `application/x-www-form-urlencoded` serializer](https://url.spec.whatwg.org/#concept-urlencoded-serializer),\nwith the corresponding exception that a parameter’s value — but not its name —\nmay be serialized differently than that algorithm requires, provided the\nserialization does not interfere with the ability to parse back the resulting URI.\n\n#### Square Brackets in Parameter Names\n\nWith query parameter families, JSON:API allows for\nquery parameters whose names contain square brackets (i.e., U+005B “[” and\nU+005D “]”).\n\nAccording to the query parameter serialization rules above, a compliant\nimplementation will percent-encode these square brackets. However, some URI\nproducers — namely browsers — do not always encode them. Servers **SHOULD**\naccept requests in which these square brackets are left unencoded in a query\nparameter’s name. If a server does accept these requests, it **MUST** treat the\nrequest as equivalent to one in which the square brackets were percent-encoded.", "znaku_textu": 74467, "slov": 11327, "odkazu": 139, "kodovani": "windows-1250", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:56", "sha256": "0619dfb37f2b46f10960c393ec8fff157f4eca04fe21b278b23f39056b863050", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://github.com/json-api/json-api", "http://www.iana.org/assignments/media-types/application/vnd.api+json", "https://tools.ietf.org/html/bcp14", "https://tools.ietf.org/html/rfc2119", "https://tools.ietf.org/html/rfc8174", "https://tools.ietf.org/html/rfc3986", "https://tools.ietf.org/html/rfc6906", "https://tools.ietf.org/html/rfc3339", "https://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc8259", "https://tools.ietf.org/html/rfc8288", "https://tools.ietf.org/html/rfc5646", "https://datatracker.ietf.org/doc/html/rfc3986", "http://www.w3.org/TR/json-ld/", "http://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc4122.html", "https://tools.ietf.org/html/rfc6901", "https://url.spec.whatwg.org/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/implementations/", "titulek": "JSON:API — Implementations", "h1": "Implementations", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Implementations"}, {"uroven": 2, "text": "Client libraries"}, {"uroven": 3, "text": "JavaScript"}, {"uroven": 3, "text": "Typescript"}, {"uroven": 3, "text": "iOS"}, {"uroven": 3, "text": "Ruby"}, {"uroven": 3, "text": "PHP"}, {"uroven": 3, "text": "Dart"}, {"uroven": 3, "text": "Perl"}, {"uroven": 3, "text": "Java"}, {"uroven": 3, "text": "Android"}, {"uroven": 3, "text": "R"}, {"uroven": 3, "text": "Elm"}, {"uroven": 3, "text": ".NET"}, {"uroven": 3, "text": "Python"}, {"uroven": 2, "text": "Server libraries"}, {"uroven": 3, "text": "Swift"}, {"uroven": 3, "text": "PHP"}, {"uroven": 3, "text": "Node.js"}, {"uroven": 3, "text": "Ruby"}, {"uroven": 3, "text": "Python"}, {"uroven": 3, "text": "Go"}, {"uroven": 3, "text": ".NET"}, {"uroven": 3, "text": "Java"}, {"uroven": 3, "text": "Scala"}, {"uroven": 3, "text": "Elixir"}, {"uroven": 3, "text": "Haskell"}, {"uroven": 3, "text": "Perl"}, {"uroven": 3, "text": "Vala"}, {"uroven": 3, "text": "Rust"}, {"uroven": 3, "text": "Dart"}, {"uroven": 3, "text": "Crystal"}, {"uroven": 2, "text": "Examples"}, {"uroven": 3, "text": "Playground"}, {"uroven": 3, "text": "Ruby"}, {"uroven": 3, "text": "JavaScript"}, {"uroven": 3, "text": "Python"}], "markdown": "# Implementations\n\nThe following are projects implementing JSON:API. If you’d like your project listed, [send a\npull request](https://github.com/json-api/json-api).\n\n> Note: This specification marked 1.0 on May 29th, 2015. The implementations\n> below have not been verified for compliance, but a test suite is now being\n> assembled to vet them.\n\n## Client libraries\n\n### JavaScript\n\n- [ember-data](https://github.com/emberjs/data) is one of the original exemplar implementations. There is now an [official adapter](https://emberjs.com/api/ember-data/release/classes/DS.JSONAPIAdapter) to support json-api.\n- [backbone-relational-jsonapi](https://github.com/xbill82/backbone-relational-jsonapi) is a parsing layer for Backbone.Relational. Entities specified in JSON:API are automatically parsed to be injected into Backbone.Relational relations.\n- [orbit.js](https://github.com/orbitjs/orbit.js) is a standalone library for\ncoordinating access to data sources and keeping their contents synchronized.\nOrbit’s Common Library includes [JSONAPISource](https://github.com/orbitjs/orbit.js/blob/master/lib/orbit-common/jsonapi-source.js) for accessing JSON:API servers. Orbit can be used\nindependently or with Ember.js through the [ember-orbit](https://github.com/orbitjs/ember-orbit) integration library.\n- [YAYSON](https://github.com/confetti/yayson) is an isomorphic library for serializing and reading JSON:API data. Extend it to fit your models or just use it with plain objects.\n- [Ember JSON API Resources](https://github.com/pixelhandler/ember-jsonapi-resources) is an [Ember CLI](http://www.ember-cli.com) Addon for a lightweight solution for data persistence in an [Ember.js](http://emberjs.com) application.\n- [hapi-json-api](https://github.com/wraithgar/hapi-json-api) Plugin for the hapi framework; enforces Accept/Content-type rules and rewrites Boom errors to be spec compliant.\n- [jsonapi-datastore](https://github.com/beauby/jsonapi-datastore) is a lightweight standalone library for reading, serializing, and synchronizing relational JSON:API data.\n- [superagent-jsonapify](https://github.com/alex94puchades/superagent-jsonapify) A really lightweight (50 lines) JSON-API client addon for [superagent](https://github.com/visionmedia/superagent) , the isomorphic ajax client.\n- [angular-jsonapi](https://github.com/jakubrohleder/angular-jsonapi) An AngularJS JSON:API client\n- [redux-json-api](https://github.com/dixieio/redux-json-api) A library which integrated JSON:APIs with Redux store\n- [devour-client](https://github.com/twg/devour) A lightweight, framework agnostic, highly flexible JSON:API client\n- [json-api-normalizer](https://github.com/yury-dymov/json-api-normalizer) Normalizes JSON:API documents for state management solutions like Redux and Mobx\n- [jsona](https://github.com/olosegres/jsona) Data formatter that creates customizable, simplified objects from JSON or stored reduxObject (result object of [json-api-normalizer](https://github.com/yury-dymov/json-api-normalizer) ), and creates correct JSON from the same simplified objects.\n- [active-resource](https://github.com/nicklandgrebe/activeresource.js) A standalone, convention-driven JavaScript ORM that maps to your JSON:API server and allows for advanced queries and relational management through a smooth interface.\n- [redux-bees](https://github.com/cantierecreativo/redux-bees) A nice, short and declarative way to interact with JSON:APIs in React+Redux\n- [Coloquent](https://github.com/DavidDuwaer/Coloquent) Javascript/Typescript library mapping objects and their interrelations to JSON:API, with a clean, fluent ActiveRecord-like (e.g. similar to Laravel’s Eloquent) syntax for creating, retrieving, updating and deleting model objects.\n- [kitsu](https://github.com/wopian/kitsu) A simple, lightweight & framework agnostic JSON:API client\n- [Sarala JSON API data formatter](https://github.com/milroyfraser/sarala-json-api-data-formatter) is a simple and fluent framework agnostic javascript library to transform standard JSON:API responses to simple JSON objects and vice versa.\n- [Sarala](https://github.com/milroyfraser/sarala) is a javascript package which gives you a [Laravel Eloquent](https://laravel.com/docs/5.6/eloquent) like syntax to perform CRUD operations against an JSON:API built according to [JSON:API specification](http://jsonapi.org/format/) .\n- [jsonapi-client](https://github.com/itsfadnis/jsonapi-client) A convenient module to consume a jsonapi service\n- [JSORM](https://github.com/jsonapi-suite/jsorm) is an\nisomorphic ActiveRecord clone that issues JSON:API requests instead of SQL and is part of the larger [JSONAPI Suite](https://github.com/jsonapi-suite/) .\n- [jsonapi-vuex](https://github.com/mrichar1/jsonapi-vuex) A module for interacting with a jsonapi service using a Vuex store, restructuring/normalizing records to make life easier.\n- [heather-js](https://github.com/bitex-la/heather-js) A library for parsing JSONAPI into objects from ES6 classes.\n- [@hyral/core](https://github.com/SyneticNL/Hyral) - An advanced, documented, easily extendable and lightweight (JSON:)API abstraction library with ORM-like CRUD support, automatic relationships handling and support for multiple (different) backends.\n- [@hyral/vue](https://github.com/SyneticNL/Hyral/tree/master/packages/vue) - Vue(x) integration for [@hyral/core](https://github.com/SyneticNL/Hyral) for Store-module creation and mixins\n- [jsonapi-redux-data](https://github.com/wednesday-solutions/jsonapi-redux-data) - a library that makes integration of jsonapi with react + redux effortless and easy.\n- [jsonapi-fractal](https://github.com/andersondanilo/jsonapi-fractal) JSON:API Serializer inspired by Fractal (PHP)\n- [ts-japi](https://github.com/jun-sheaf/ts-japi) - A zero-dependency, highly-modular, js/ts-friendly, recursible, framework-agnostic library for serializing data to the JSON:API specification. Serializes the entire specification.\n- [mobx-async-store](https://github.com/artemis-ag/mobx-async-store) - A Mobx-based store for async data fetching and state management for the JSON:API specification.\n- [spraypaint](https://github.com/graphiti-api/spraypaint.js) - JS Client for Graphiti similar to ActiveRecord. Written in Typescript but works in plain old ES5 as well. This library is isomorphic - use it from the browser, or from the server with NodeJS.\n- [json-api-models](https://github.com/tobyzerner/json-api-models) - A lightweight layer for working with JSON:API data.\n- [fetchja](https://github.com/caiotarifa/fetchja) - A super simple, modern, and lightweight library for dealing with JSON:API (Kitsu-like, but using Fetch API instead of Axios).\n\n### Typescript\n\n- [ts-angular-jsonapi](https://github.com/reyesoft/ts-angular-jsonapi) A JSON:API library developed for AngularJS in Typescript\n- [ngrx-json-api](https://github.com/abdulhaq-e/ngrx-json-api) A JSON:API client for Angular 2 ngrx toolset\n- [ts-jsonapi](https://github.com/mohuk/ts-jsonapi) JSON:API (De)Serializer in Typescript\n- [ngx-jsonapi](https://github.com/reyesoft/ngx-jsonapi) A JSON:API fast client library for Angular with storage+memory cache.\n- [@crnk/angular-ngrx](https://www.npmjs.com/package/@crnk/angular-ngrx) Angular helper library for ngrx-json-api and (optionally) crnk. Facilitates the binding of UI components to ngrx-json-api, most notably tables and forms.\n- [Grivet](https://github.com/muellerbbm-vas/grivet) A JSON:API client library written in TypeScript with emphasis on RESTful traversal of resources according to HATEOAS principles.\n- [DatX](https://github.com/infinum/datx) is an opinionated data store for use with the MobX state management library that adds JSON:API support with [datx-jsonapi](https://github.com/infinum/datx/tree/master/packages/datx-jsonapi) mixin.\n- [jsonapi-fractal](https://github.com/andersondanilo/jsonapi-fractal) JSON:API Serializer inspired by Fractal (PHP)\n- [ts-japi](https://github.com/jun-sheaf/ts-japi) - A zero-dependency, highly-modular, js/ts-friendly, recursible, framework-agnostic library for serializing data to the JSON:API specification. Serializes the entire specification.\n- [drupal-jsonapi-params](https://github.com/d34dman/drupal-jsonapi-params) A library for building query parameters when connecting with Drupal CMS’s JSON:API.\n- [EntityStore.TS](https://github.com/dipscope/EntityStore.TS) - ORM like abstraction layer for TypeScript which includes extensible [provider](https://github.com/dipscope/JsonApiEntityProvider.TS) for accessing JSON:API servers.\n\n### iOS\n\n- [jsonapi-ios](https://github.com/joshdholtz/jsonapi-ios) is a library for loading data from a JSON:API datasource. Parses JSON:API data into models with support for auto-linking of resources and custom model classes.\n- [Spine](https://github.com/wvteijlingen/spine) is a Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.\n- [Vox](https://github.com/aronbalog/Vox) is a Swift JSON:API client framework with custom model classes support and nice networking interface.\n- [Japx](https://github.com/infinum/Japx) is lightweight JSON:API parser that flattens complex JSON:API structure and turns it into simple JSON and vice versa. It works by transferring Dictionary to Dictionary, so you can use Codable, Unbox, Wrap, ObjectMapper or any other object mapping tool that you prefer. It supports Objective-C as well.\n- [mattpolzin / JSONAPI](https://github.com/mattpolzin/JSONAPI) is a Swift Codable library with heavy emphasis on type-safety. It is platform agnostic so it can be used client- and server-side.\n- [IzzyParser](https://github.com/undabot/izzyparser-ios) is a lightweight library for serializing and deserializing JSON:API objects.\n- [Datadog/swift-jsonapi](https://github.com/Datadog/swift-jsonapi) is a Swift library that provides macros to simplify the encoding and decoding of JSON:API responses.\n\n### Ruby\n\n- [jsonapi-consumer](https://github.com/jsmestad/jsonapi-consumer) a ruby library for consuming JSONAPI payloads.\n- [JsonApiClient](https://github.com/chingor13/json_api_client) attempts to give you a query building framework that is easy to understand (similar to ActiveRecord scopes).\n- [Munson](https://github.com/coryodaniel/munson) is a ruby JSONAPI client that can act as an ORM or integrate with your models via fine-grained agnosticism. Easy to configure and customize. Includes a chainable/customizable query builder, attributes API and dirty tracking.\n- [json-api-vanilla](https://github.com/trainline/json-api-vanilla) a reference-aware ruby library for JSONAPI deserialization that doesn’t require setting up classes.\n- [SimpleJSONAPIClient](https://github.com/amcaplan/simple_jsonapi_client) gives you lower-level control for API operations, while your models and their relationships maintain a neat, ActiveRecord-inspired interface.\n- [jsonapi-unwrapper](https://github.com/Sonberg/jsonapi-unwrapper) a simple and lightweight library to deserialize JSON:API payloads.\n\n### PHP\n\n- [Art4 / json-api-client](https://github.com/Art4/json-api-client) is a library for validating and handling the response body in a simple OOP way.\n- [woohoolabs / yang](https://github.com/woohoolabs/yang) is a PSR-7 compatible library that is able to build and send requests, and handle responses.\n- [enm/json-api-client](https://eosnewmedia.github.io/JSON-API-Client/) is an abstract client-side PHP implementation of the json:api specification which is based on [enm/json-api-common](https://eosnewmedia.github.io/JSON-API-Common/) . It allows you to send json:api requests via your own http client implementation or via a buzz or guzzle client.\n- [floor9design-ltd/json-api-formatter](https://github.com/floor9design-ltd/json-api-formatter) An open source library designed to be used for generating and interacting with (making and receiving) JSON API requests. 100% unit tested and actively maintained by the author. Easy to use with frameworks such as Laravel/Symfony.\n- [swisnl/json-api-client](https://github.com/swisnl/json-api-client) Is a package for mapping remote {json:api} resources to Eloquent like models and collections.\n\n### Dart\n\n- [json_api](https://pub.dev/packages/json_api) is a full-fledged client for Flutter/Web/VM.\n- [rest_data](https://pub.dev/packages/rest_data) is a REST API client based on `ember-data` concepts which includes a JSON:API adapter.\n- [jsonapi_client](https://pub.dev/packages/jsonapi_client) is a simple JSON:API v1.0 client written in Dart.\n- [japx](https://pub.dev/packages/japx) is a lightweight JSON:API parser that flattens complex JSON:API structure and turns it into simple JSON and vice versa\n\n### Perl\n\n- [PONAPI::Client](https://metacpan.org/pod/PONAPI::Client) is a simple/extensible JSON:API v1.0 client.\n\n### Java\n\n- [jsonapi-converter](https://github.com/jasminb/jsonapi-converter) is a Java JSON:API v1.0 client. Besides providing means for serialisation/deserialisation, client comes with Retrofit plugin.\n- [crnk.io](http://www.crnk.io) is a JSON:API framework for clients and servers. On the client-side it targets\nboth Java and Android development. As for the backend side a rich set of modules helps with the integration of various\nJava frameworks.\n- [jsonapi](https://github.com/MarkoMilos/jsonapi) Library for streamlined use of JSON:API using Kotlin and Java built on top of Moshi from Square. It is built with a powerful api and supports JVM (Java/Kotlin) and Android. Supporting deserialization and serialization it is meant to be used on both client and server side.\n\n### Android\n\n- [faogustavo/JSONApi](https://github.com/faogustavo/JSONApi) library for deserializing automatic. It can be integrated with retrofit. It has some ideas from Morpheus and jsonapi-converter but has some aditionals.\n- [moshi-jsonapi](https://github.com/kamikat/moshi-jsonapi) serialize/deserialize JSON:API v1.0 using fantistic Moshi API! With friendly Java interface and easy integration with Retrofit.\n- [Morpheus](https://github.com/xamoom/Morpheus) library for deserializing your resources with automatic mapping for relationships. Uses gson to map objects in attributes.\n- [Izzy JSONAPI parser](https://github.com/undabot/izzy-json-api-android) library for deserializing and serializing resources with support both for Gson and Jackson parsers. It also has simple Retrofit integration.\n- [JsonApiX](https://github.com/infinum/kotlin-jsonapix) annotation processor library for serializing and deserializing Kotlin classes. It’s easy to use - setup only requires annotating classes. Retrofit integration is included.\n\n### R\n\n- [rjsonapi](https://github.com/sckott/rjsonapi) is an R client to consume JSONAPI’s.\n\n### Elm\n\n- [elm-jsonapi](https://github.com/noahzgordon/elm-jsonapi) provides decoders and helper functions for clients receiving JSON:API payloads.\n- [elm-jsonapi-http](https://github.com/noahzgordon/elm-jsonapi-http) wraps `elm-jsonapi` and handles the details of content negotiation with JSON:API-compliant servers, providing a smoother interface for consumers.\n\n### .NET\n\n- [Hypermedia.JsonApi.Client](https://github.com/cosullivan/Hypermedia/) is a set of extension methods to the HttpClient which allow for reading\nand writing of JSON:API documents.\n- [JsonApiSerializer](https://github.com/codecutout/JsonApiSerializer) is a configurationless JSON:API serialization and deserialization library implemented as a Json.NET `JsonSerializerSetting` . It leverages the existing power and flexibility of Json.NET while providing a sensible default mapping between JSON:API and CLR objects.\n- [JsonApiFramework.Client](https://github.com/scott-mcdonald/JsonApiFramework) is a *portable* .NET Standard/Core client-side framework where developers define the domain model of the resources of a hypermedia API server either through configuration and/or conventions called a *service model* . With a *service model* developers can use a *document context* that represents a session with a JSON:API compound *document* for reading or writing of various JSON:API abstractions such as resources, resource identifiers, relationships, links, meta information, error objects, and version information all serialized/deserialized as high level CLR objects.\n- [FSharp.JsonApi](https://github.com/cmeeren/FSharp.JsonApi/) is a library that allows you to use F# to easily create and consume flexible, strongly typed web APIs following the JSON:API specification.\n- [jsonapi-consumer](https://github.com/OKTAYKIR/jsonapi-consumer/) is a simple client-side .NET Standard wrapper framework for consuming JSON:API based APIs.\n\n### Python\n\n- [jsonapi-requests](https://github.com/socialwifi/jsonapi-requests/) Simple and fun high-level JSONAPI client for Python. Contains ORM which makes consuming the API even easier, in a DRY manner. It has a low-level API similar to requests as well, which gives you all the flexibility that you may need.\n- [jsonapi-client](https://github.com/qvantel/jsonapi-client) Comprehensive yet easy-to-use, pythonic, ORM-like access to JSON:API services\n- [json-api-doc](https://github.com/noplay/json-api-doc) JSON:API parser returning a simple Python dictionary\n- [json-api-smart](https://github.com/NilssonPL/json-api-smart) JSON:API with an ORM interface\n\n## Server libraries\n\n### Swift\n\n- [aonawale / JSONAPISerializer](https://github.com/aonawale/JSONAPISerializer) is a server side swift framework agnostic library that implements JSON:API v1.0.\n- [mattpolzin / JSONAPI](https://github.com/mattpolzin/JSONAPI) is a Swift Codable library with heavy emphasis on type-safety. It is platform agnostic so it can be used client- and server-side.\n- [Datadog/swift-jsonapi](https://github.com/Datadog/swift-jsonapi) is a Swift library that provides macros to simplify the encoding and decoding of JSON:API responses.\n\n### PHP\n\n- [tobyz / json-api-server](https://github.com/tobyzerner/json-api-server) is a framework-agnostic declarative JSON:API server implementation.\n- [neomerx / json-api](https://github.com/neomerx/json-api) is a framework agnostic library that fully implements JSON:API v1.0.\n- [limoncello-php / app](https://github.com/limoncello-php/app) is a JSON:API v1.0 quick start server application for [neomerx / json-api](https://github.com/neomerx/json-api) .\n- [lode / jsonapi](https://github.com/lode/jsonapi) is a human-friendly library to implement JSON:API v1.1 without needing to know the specification.\n- [woohoolabs / yin](https://github.com/woohoolabs/yin) is a library for advanced users aiming for efficiency and elegance.\n- [nilportugues / json-api](https://github.com/nilportugues/json-api) Serializer transformers outputting valid API responses in JSON and JSON:API formats.\n- [nilportugues / symfony2-jsonapi-transformer](https://github.com/nilportugues/symfony2-jsonapi-transformer) Symfony 2 JSON:API Transformer Bundle outputting valid API responses in JSON and JSON:API formats.\n- [nilportugues / laravel5-jsonapi-transformer](https://github.com/nilportugues/laravel5-jsonapi-transformer) Laravel 5 JSON:API Transformer Package outputting valid API responses in JSON and JSON:API formats.\n- [tuyakhov / yii2-json-api](https://github.com/tuyakhov/yii2-json-api) Implementation of JSON:API specification for the Yii framework.\n- [json-api-php/json-api](https://github.com/json-api-php/json-api) An attempt to translate the JSON:API specification into a set of high quality unit/functional tests and implement it in PHP 7 strictly following TDD and SOLID OOP principles.\n- [laravel-json-api/laravel](https://github.com/laravel-json-api/laravel) Laravel implementation of the JSON:API specification, with full feature support and extensive documentation.\n- [FriendsOfCake/crud-json-api](https://github.com/FriendsOfCake/crud-json-api) CakePHP Crud Listener for building maintainable JSON:API compliant APIs.\n- [thephpleague/fractal](http://fractal.thephpleague.com/) A partial implementation of the JSON:API spec allowing for an easy drop in JSON rendering solution.\n- [oligus/jad](https://github.com/oligus/jad) A library that turns doctrine entities into json:api resource, or collection of resources, automagically.\n- [enm/json-api-server](https://eosnewmedia.github.io/JSON-API-Server/) is an abstract server-side PHP (>= 7.2) implementation of the json:api specification, based on [enm/json-api-common](https://eosnewmedia.github.io/JSON-API-Common/) . It handles json:api requests via request handlers through a centralized handle-method. It can be used with psr-7-request/response or your own request and response logic.\n- [enm/json-api-server-bundle](https://eosnewmedia.github.io/JSON-API-Server-Bundle/) is a symfony bundle which integrates [enm/json-api-server](https://eosnewmedia.github.io/JSON-API-Server/) into your symfony application (symfony version ^4.0).\n- [raml-json-api](https://github.com/RJAPI/raml-json-api) RAML based JSON:API code generator for Laravel. Generates controllers, middlewares, models, routes, migrations and serves JSON:API.\n- [paknahad/jsonapi-bundle](https://github.com/paknahad/jsonapi-bundle) is a Symfony bundle. It is the fastest way to generate API.\n- [swisnl/json-api-server](https://github.com/swisnl/json-api-server) is a Laravel package to get a JSON:API up and running in minutes.\n- [hackerboy/json-api](https://github.com/hackerboydotcom/json-api) is a lightweight library that helps you to implement JSONAPI easily\n- [drupal](https://www.drupal.org/project/drupal) The Drupal CMS supports exposing all data it manages (entities) according to the JSON:API specification. [jsonapi_extras](https://www.drupal.org/project/jsonapi_extras) is an optional extra module to change resource type names, field names and more.\n- [bednic/json-api](https://gitlab.com/bednic/json-api) Annotation driven library for creating valid JSON API response document from your objects.\n- [pz/doctrine-rest](https://github.com/R3VoLuT1OneR/doctrine-rest) library provides basic tools for implementation of JSON:API with Doctrine 2\n- [pz/jsonapi-resource](https://github.com/R3VoLuT1OneR/jsonapi-resource) Serialize PHP class object into JSON:API resource object using PHP 8.0 Attributes.\n- [binarcode/laravel-restify](https://github.com/binarcode/laravel-restify) The fastest way to make a powerful JSON:API compatible Rest API with Laravel [Reference Docs](https://restify.binarcode.com/) .\n- [API Platform](https://api-platform.com) is an API-first Framework supporting JSON:API.\n\n### Node.js\n\n- [Fortune.js](http://fortune.js.org/) is a library that includes a [comprehensive implementation of JSON:API](https://github.com/fortunejs/fortune-json-api) .\n- [json-api](https://www.npmjs.org/package/json-api) turns an Express + Mongoose app into a JSON-API server.\n- [endpoints](https://github.com/endpoints) is an implementation of JSON:API using [Bookshelf](http://bookshelfjs.org) .\n- [YAYSON](https://github.com/confetti/yayson) is an isomorphic library for serializing and reading JSON:API data. Simply use it with plain objects or extend it to fit your ORM (currently it has an adapter for [Sequelize](http://sequelizejs.com) ).\n- [jsonapi-serializer](https://github.com/SeyZ/jsonapi-serializer) is a Node.js framework agnostic library for serializing your data to JSON:API.\n- [jsonapi-server](https://github.com/holidayextras/jsonapi-server) A feature-rich config-driven json:api framework.\n - [jsonapi-store-memoryhandler](https://github.com/holidayextras/jsonapi-server/blob/master/documentation/resources.md) An in-memory data store for rapid prototyping.\n - [jsonapi-store-relationaldb](https://github.com/holidayextras/jsonapi-store-relationaldb) A relational database handler for jsonapi-server.\n - [jsonapi-store-mongodb](https://github.com/holidayextras/jsonapi-store-mongodb) A mongodb handler for jsonapi-server.\n - [jsonapi-store-elasticsearch](https://github.com/holidayextras/jsonapi-store-elasticsearch) An elasticsearch handler for jsonapi-server.\n- [jagql](https://jagql.github.io) A resource driven framework to set up a {json:api} + GraphQL endpoint in record time.\n - [jagql/store-sequelize](https://npmjs.com/@jagql/store-sequelize) persist jagql resources to Postgres/MySQL/MSSQL/SQLite\n- [loopback-component-jsonapi](https://github.com/digitalsadhu/loopback-component-jsonapi) JSON:API support for [loopback](https://github.com/strongloop/loopback) highly-extensible, open-source Node.js framework\n- [loopback-jsonapi-model-serializer](https://www.npmjs.com/package/loopback-jsonapi-model-serializer) JSON:API serializer for loopback models.\n- [jsonapi-mapper](https://github.com/scoutforpets/jsonapi-mapper) JSON:API-Compliant Serialization for your Node ORM.\n- [jaysonapi](https://github.com/digia/jaysonapi) jaysonapi is a framework agnostic JSON:API v1.0.0 serializer. jaysonapi provides more of a functional approach to serializing your data. Define a serializer with a type and schema, and call serialize on it passing in the data, included, meta, errors, etc. as a plain object.\n- [json-api-ify](https://github.com/kutlerskaggs/json-api-ify) serialize the **** out of your data. json:api v1.0 complaint.\n- [bookshelf-jsonapi-params](https://github.com/scoutforpets/bookshelf-jsonapi-params) automatically apply JSON:API filtering, pagination, sparse fieldsets, includes, and sorting to your Bookshelf.js queries.\n- [Lux](https://github.com/postlight/lux) is a MVC style Node.js framework for building lightning fast JSON:APIs.\n- [jsonapi-mock](https://github.com/Thomas-X/jsonapi-mock) A [json-server](https://github.com/typicode/json-server) inspired jsonapi mock server. Setup a jsonapi mock server in almost no time, uses lowdb.\n- [DenaliJS](http://denalijs.org) A layered-conventions framework for building ambitious APIs. Includes a powerful addon system, best-in-class developer experience, and extensive documentation.\n- [jsonapi-fractal](https://github.com/andersondanilo/jsonapi-fractal) JSON:API Serializer inspired by Fractal (PHP)\n- [ts-japi](https://github.com/jun-sheaf/ts-japi) - A zero-dependency, highly-modular, js/ts-friendly, recursible, framework-agnostic library for serializing data to the JSON:API specification. Serializes the entire specification.\n- [Kurier](https://github.com/kurierjs/kurier) is a TypeScript framework to create APIs following the [1.1 Spec of JSON:API](https://jsonapi.org/format/1.1/) + the [Operations proposal spec](https://github.com/json-api/json-api/blob/999e6df77b28549d6c37b163b73c8e9102400020/_format/1.1/index.md#operations) .\n- [nestjs-json-api](https://github.com/klerick/nestjs-json-api) A module for NestJS and TypeORM to implement JSON API supporting features such as, end point, query params, body params, validation and transformation response.\n\n### Ruby\n\n- Plain Ruby\n - [Yaks](https://github.com/plexus/yaks) Library for building hypermedia APIs, contains a JSON:API output format.\n - [JSONAPI::Serializers](https://github.com/fotinakis/jsonapi-serializers) provides a pure Ruby, readonly serializer implementation.\n - [JSONAPI::Realizer](https://github.com/krainboltgreene/jsonapi-realizer) provides a pure Ruby pattern for turning JSON:API requests into models (has active record support and rails instructions)\n - [Roar](https://github.com/apotonick/roar) Renders and parses representations of Ruby objects\n - [Jbuilder::JsonAPI](https://github.com/vladfaust/jbuilder-json_api) Simple & lightweight extension for Jbuilder\n - [jsonapi-rb](http://jsonapi-rb.org) Ruby library for efficiently building and consuming JSON:API documents - with Rails and Hanami integrations.\n - [fast_jsonapi](https://github.com/Netflix/fast_jsonapi) A lightning fast JSON:API serializer for Ruby Objects.\n - [jsonapi_parameters](https://github.com/visualitypl/jsonapi_parameters) Rails-way to consume JSON:API input.\n- Ruby on Rails\n - [Jsonapi-for-rails](https://github.com/doga/jsonapi_for_rails) empowers your JSONAPI compliant [Rails](http://rubyonrails.org/) APIs. Implement your APIs with very little coding.\n - [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) is one of the original exemplar implementations, but is slightly out of date at\n the moment.\n - [JSONAPI::Resources](https://github.com/cerebris/jsonapi-resources) provides a complete framework for developing a JSON:API server. It is designed to work with Rails, and provides routes, controllers, and serializers.\n - [JSONAPI::Utils](https://github.com/b2beauty/jsonapi-utils) works on top of [JSONAPI::Resources](https://github.com/cerebris/jsonapi-resources) taking advantage of its resource-driven style and bringing a Rails way to build modern APIs with no or less learning curve.\n - [Caprese](https://github.com/nicklandgrebe/caprese) An opinionated Rails library for creating JSON:API servers that lets you focus on customizing the behavior of your endpoints rather than the dirty work of setting them up. Leverages the power of [ActiveModel::Serializer](https://github.com/rails-api/active_model_serializers) .\n - [JSONAPI Suite](https://github.com/jsonapi-suite) facilitates a server capable of deep querying and nested writes. Works\n with any ORM or datastore; comes with integration test helpers and\n automatic swagger documentation.\n - [JSONAPI.rb](https://github.com/stas/jsonapi.rb#usage) A set of pluggable\n mixins providing support for serialization (using `fast_jsonapi` ), error\n handling, includes, sparse fields, pagination, filtering (using `ransack` )\n and sorting. Strives to implement as much of the JSONAPI spec as possible.\n Small codebase (~500 sloc), good documentation and test coverage.\n - [Graphiti](https://www.graphiti.dev/guides/) a ruby library for RESTful Resources based on JSON:API. Works with vanilla Ruby, Sinatra and Rails.\n- Sinatra\n - [Sinja](https://github.com/mwpastore/sinja) extends [Sinatra](http://www.sinatrarb.com) and leverages [JSONAPI::Serializers](https://github.com/fotinakis/jsonapi-serializers) to enable rapid development of comprehensive, read-and-write, and JSON:API v1.0-compliant web services using the DAL/ORM of your choice. It includes a simple role-based authorization scheme, support for client-generated IDs, patchless clients, and coalesced find requests, exception handling, and more.\n\n### Python\n\n- [Hyp](https://github.com/kalasjocke/hyp) is a library for creating json-api responses.\n- [SQLAlchemy-JSONAPI](https://github.com/coltonprovias/sqlalchemy-jsonapi) provides JSON:API serialization for SQLAlchemy models.\n- [django-rest-framework-json-api](https://github.com/django-json-api/django-rest-framework-json-api) provides JSON:API parsing and rendering for the Django REST Framework\n- [jsoongia](https://github.com/digia/jsoongia) is a framework agnostic JSON:API implementation.\n- [ripozo](https://github.com/vertical-knowledge/ripozo/) provides a framework for serving JSON:API content (among other Hypermedia formats) in Flask, Django and more.\n- [marshmallow-jsonapi](https://github.com/marshmallow-code/marshmallow-jsonapi) provides JSON:API data formatting for any Python web framework.\n- [neoapi](https://pypi.python.org/pypi/neoapi/) serializes JSON:API–compliant responses from neomodel StructuredNodes for Neo4j data\n- [xamoom-janus](https://github.com/xamoom/xamoom-janus) is a Python module to easily and fast extend Python web frameworks like Flask or BottlyPy with json:api functionality. Also offers a flexible mechanism for data mapping and hooks to intercept and extend its functionality according to your projects needs.\n- [pyramid-jsonapi](https://github.com/colinhiggs/pyramid-jsonapi) Auto-build a JSON:API from sqlalchemy models using the pyramid framework.\n- [Flask-REST-JSONAPI](https://github.com/miLibris/flask-rest-jsonapi) Flask extension to create web api according to jsonapi specification with Flask, Marshmallow and data provider of your choice (SQLAlchemy, MongoDB, …)\n- [Flump](https://github.com/rolepoint/flump) Database agnostic JSON:API builder which depends on Flask and Marshmallow.\n- [SAFRS JSON API Framework](https://github.com/thomaxxl/safrs) Flask-SQLAlchemy jsonapi implementation with auto-generated openapi (fka swagger) interface.\n- [pydantic-jsonapi](https://github.com/DeanWay/pydantic-jsonapi) JSON:api validation with python type hinting using [pydantic](https://pydantic-docs.helpmanual.io/)\n- [pydanja](https://github.com/Centurix/pydanja) JSON:API implementation for [pydantic](https://pydantic-docs.helpmanual.io/) and [FastAPI](https://fastapi.tiangolo.com/) using generic types, complete with helpers for simplifying OpenAPI docs\n- [Flask-Restless-NG](https://github.com/mrevutskyi/flask-restless-ng) Builds JSON:API from SQLAlchemy models using Flask\n- [starlette-jsonapi](https://github.com/vladmunteanu/starlette-jsonapi) Microframework on top of Starlette and marshmallow-jsonapi with support for asynchronous ORMs\n- [kt.jsonapi](https://pypi.org/project/kt.jsonapi/) JSON:API response generation using the Zope Component Architecture.\n- [Flask-COMBO-JSONAPI](https://github.com/AdCombo/flask-combo-jsonapi) JSON:API flask extension for building REST APIs.\n- [FastAPI-JSONAPI](https://github.com/mts-ai/FastAPI-JSONAPI) FastAPI-JSONAPI is a FastAPI extension for building REST APIs\n\n### Go\n\n- [api2go](https://github.com/manyminds/api2go) is a full-fledged library to make it simple to provide a JSON:API with your Golang project.\n- [jsonapi](https://github.com/google/jsonapi) serializes and deserializes jsonapi formatted payloads using struct tags to annotate the structs that you already have in your Golang project. [Godoc](http://godoc.org/github.com/google/jsonapi)\n- [go-json-spec-handler](https://github.com/derekdowling/go-json-spec-handler) drop-in library for handling requests and sending responses in an existing API.\n- [jsh-api](https://github.com/derekdowling/go-json-spec-handler/tree/master/jsh-api) deals with the dirty work of building JSON:API resource endpoints. Built on top of [jsh](https://github.com/derekdowling/go-json-spec-handler)\n- [mfcochauxlaberge/jsonapi](https://github.com/mfcochauxlaberge/jsonapi) offers a large set of tools to build a JSON:API compliant service.\n- [pieoneers/jsonapi-go](https://github.com/pieoneers/jsonapi-go) lightweight JSON API implementation in Go. Make your client and server applications JSON API-enabled in hours not months.\n\n### .NET\n\n- [JsonApiDotNetCore](https://github.com/json-api-dotnet/JsonApiDotNetCore) is a framework for building json:api compliant REST APIs using .NET Core and Entity Framework Core. It eliminates as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic.\n- [JsonApiNet](https://github.com/l8nite/JsonApiNet) lets you quickly deserialize JSON:API documents into C# entities. Supports compound documents, complex type mapping from attributes, attribute mapping, and more. [See the README](https://github.com/l8nite/JsonApiNet/blob/master/README.md) for full details.\n- [NJsonApi](https://github.com/jacek-gorgon/NJsonApi) is a .NET server implementation of the standard. It aims at good extensibility and performance while maintaining developer-friendliness with interchangeable conventions and builder-style configuration.\n- [Migrap.AspNetCore.Hateoas](https://github.com/dcomartin/Migrap.AspNetCore.Hateoas) HATEOAS (Hypermedia as the Engine of Application State) framework for ASP.NET Core. Current implementation(s): Siren, JsonApi.\n- [Saule](https://github.com/joukevandermaas/saule/) is a small JSON:API 1.0 compatible library that integrates well with established Web API conventions. It has complete documentation and near 100% test coverage.\n- [Hypermedia.JsonApi.WebApi](https://github.com/cosullivan/Hypermedia/) is a Web API media type formatter for reading and writing JSON:API. It supports an external resource model definition and natively\nincludes related resources.\n- [JsonApiSerializer](https://github.com/codecutout/JsonApiSerializer) is a configurationless JSON:API serialization and deserialization library implemented as a Json.NET `JsonSerializerSetting` . It leverages the existing power and flexibility of Json.NET while providing a sensible default mapping between JSON:API and CLR objects.\n- [JsonApiFramework.Server](https://github.com/scott-mcdonald/JsonApiFramework) is a *portable* .NET Standard/Core server-side framework where developers define the domain model of the resources of a hypermedia API server either through configuration and/or conventions called a *service model* . With a *service model* developers can use a *document context* that represents a session with a JSON:API compound *document* for reading or writing of various JSON:API abstractions such as resources, resource identifiers, relationships, links, meta information, error objects, and version information all serialized/deserialized as high level CLR objects with automatic generation of JSON:API hypermedia.\n- [FSharp.JsonApi](https://github.com/cmeeren/FSharp.JsonApi/) is a library that allows you to use F# to easily create and consume flexible, strongly typed web APIs following the JSON:API specification.\n- [Felicity](https://github.com/cmeeren/Felicity/) is a boilerplate-free JSON:API framework for your functional F# domain model, optimized for developer happiness\n\n### Java\n\n- [crnk.io](http://www.crnk.io) is a JSON:API framework for clients and servers. It was started as a fork for Katharsis after the later [lost development momentum](https://www.reddit.com/r/java/comments/6hs0n8/crnkio_10_released_crank_up_rest_development/) . It has similar concepts but with active development support. On the server-side it comes, among others,\nwith a rich set of integrations (Servlet, JAX-RS, Spring, JPA, Bean Validation, Zipkin and more), bulk updates with JSON Patch, a meta-model for automation purposes, client stub generation for TypeScript and a module API for third-party contributions.\n- [Elide](http://elide.io) is a web framework supporting JSON:API. Through annotation-based JSON:API endpoint generation, Elide enables you to focus on your data model, security model, and business logic while avoiding unnecessary boilerplate. Moreover, through use of the JSON:API Patch extension, [Elide](http://elide.io) provides full support for database transactions.\n- [JSON:API for Spring HATEOAS](https://github.com/toedter/spring-hateoas-jsonapi) provides serialization/deserialization of the Spring HATEOAS representation models. The project also provides a builder to easily create relationships, included resource objects, pagination, and more.\n- [jsonapi-rvp](https://github.com/xlate/jsonapi-rvp) utilizes the platform capabilities available in the Jakarta EE environment (formerly Java EE) to expose JPA entities via JSON:API. Features include query and entity validation (using Bean Validators), pagination, use of surrogate keys as record identifiers, support for LEFT outer join conditions, and a simple JavaScript client.\n- [JSON:API object converter](https://github.com/MieskeB/json-api-spring-boot) converts normal Java objects to JSON:API standard with the use of annotations in the viewmodels (dtos).\n- [Dashjoin Low Code Development Platform](https://github.com/dashjoin/platform) connects to relational, document, and graph databases and makes them available via JSON:API. The platform offers powerful access control mechanisms, a query editor, and graphical layout designers.\n- [jsonapi-simple](https://github.com/devslm/jsonapi-simple) is a simple implementation of the JSON:API specification (only required output fields). This library implements only top-level fields: data, links, errors and meta (using spring boot dependencies) without any relationships, includes and others. It implemented also filtering, sorting and sparse fieldset. [See the documentation](https://devslm.github.io/jsonapi-simple/) for full details.\n\n### Scala\n\n- [scala-jsonapi](https://github.com/scala-jsonapi/scala-jsonapi) A Scala library for producing JSON output (and deserializing JSON input) based on JSON:API specification.\n\n### Elixir\n\n- [ja_serializer](https://github.com/AgilionApps/ja_serializer) is a behaviour and DSL to emit conforming JSON. Suitable for use in a Phoenix view or in a Plug stack.\n- [jsonapi](https://github.com/jeregrine/jsonapi) is a serializer and query parser built with plain old functions. Can parse and validate a JSONAPI compliant query and serialize Ecto Models or Elixir Structs into conforming JSON. Suitable for use in a Phoenix view, Plug Stack or anywhere you can call functions.\n\n### Haskell\n\n- [json-api](https://github.com/toddmohney/json-api) functions and datatypes for representing user-defined resources in accordance with the JSON-API specification.\n\n### Perl\n\n- [PONAPI::Server](https://metacpan.org/pod/PONAPI::Server) is a Plack-based web server, providing a generic service adhering to the spec. just plug your data-repository & play.\n\n### Vala\n\n- [JSON-API-GLib](https://github.com/major-lab/json-api-glib) provides GObjects that can be serialized to and unserialized from payloads with [JSON-GLib](https://wiki.gnome.org/Projects/JsonGlib) .\n\n### Rust\n\n- [jsonapi-rust](https://github.com/michiel/jsonapi-rust) A Rust library for serializing, deserializing and working with JSON-API data\n\n### Dart\n\n- [json_api_server](https://pub.dartlang.org/packages/json_api_server) is a JSON:API server running on Dart VM.\n\n### Crystal\n\n- [jsonapi-serializer-cr](https://github.com/andersondanilo/jsonapi-serializer-cr) is a JSON:API Serializer for Crystal Lang.\n\n## Examples\n\n- [Endpoints provides a fully working example API](http://github.com/endpoints/example/)\n- [Sinja provides a fully-working example API](https://github.com/mwpastore/sinja/tree/master/demo-app)\n\n### Playground\n\n- [json-api-document-viewer](https://tadast.github.io/json-api-document-viewer) the flat json:api structure is a good way to express complex relationships between objects. However the same flatness makes it difficult for humans to “parse” these relationships. This tool visualises object relationships by visually nesting them.\n- [corroborate](http://corroborate.arenpatel.com/) JSON:API request/response payload validator. It warns when there is a specification violation and also informs when a recommendation has not been followed.\n\n### Ruby\n\n- [json-patch](https://github.com/guillec/json-patch) implementation of JSON Patch (rfc6902)\n- [hana](https://github.com/tenderlove/hana) implementation of the JSON Patch and JSON pointer spec\n\n### JavaScript\n\n- [json-api-merge](https://www.npmjs.com/package/json-api-merge) JSON:API specific redundant duplication algorithm for merging included resources into original data\n- [json-patch](https://www.npmjs.org/package/json-patch) implementation of JSON Patch (rfc6902)\n\n### Python\n\n- [jsonpatch](https://python-json-patch.readthedocs.org) implementation of JSON Patch (rfc6902)\n- [drf-json-patch](https://drf-json-patch.readthedocs.org) integrates jsonpatch with Django REST Framework", "znaku_textu": 42509, "slov": 4691, "odkazu": 289, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:17", "sha256": "f78dae18bb3871f183b472b922fc3fb6d6e4bd93da9de7bd90d67d7ec3f4fd4f", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://github.com/json-api/json-api", "https://github.com/emberjs/data", "https://emberjs.com/api/ember-data/release/classes/DS.JSONAPIAdapter", "https://github.com/xbill82/backbone-relational-jsonapi", "https://github.com/orbitjs/orbit.js", "https://github.com/orbitjs/orbit.js/blob/master/lib/orbit-common/jsonapi-source.js", "https://github.com/orbitjs/ember-orbit", "https://github.com/confetti/yayson", "https://github.com/pixelhandler/ember-jsonapi-resources", "http://www.ember-cli.com/", "http://emberjs.com/", "https://github.com/wraithgar/hapi-json-api", "https://github.com/beauby/jsonapi-datastore", "https://github.com/alex94puchades/superagent-jsonapify", "https://github.com/visionmedia/superagent", "https://github.com/jakubrohleder/angular-jsonapi", "https://github.com/dixieio/redux-json-api", "https://github.com/twg/devour", "https://github.com/yury-dymov/json-api-normalizer", "https://github.com/olosegres/jsona", "https://github.com/nicklandgrebe/activeresource.js", "https://github.com/cantierecreativo/redux-bees", "https://github.com/DavidDuwaer/Coloquent", "https://github.com/wopian/kitsu", "https://github.com/milroyfraser/sarala-json-api-data-formatter", "https://github.com/milroyfraser/sarala", "https://laravel.com/docs/5.6/eloquent", "https://github.com/itsfadnis/jsonapi-client", "https://github.com/jsonapi-suite/jsorm", "https://github.com/jsonapi-suite/", "https://github.com/mrichar1/jsonapi-vuex", "https://github.com/bitex-la/heather-js", "https://github.com/SyneticNL/Hyral", "https://github.com/SyneticNL/Hyral/tree/master/packages/vue", "https://github.com/wednesday-solutions/jsonapi-redux-data", "https://github.com/andersondanilo/jsonapi-fractal", "https://github.com/jun-sheaf/ts-japi", "https://github.com/artemis-ag/mobx-async-store", "https://github.com/graphiti-api/spraypaint.js", "https://github.com/tobyzerner/json-api-models", "https://github.com/caiotarifa/fetchja", "https://github.com/reyesoft/ts-angular-jsonapi", "https://github.com/abdulhaq-e/ngrx-json-api", "https://github.com/mohuk/ts-jsonapi", "https://github.com/reyesoft/ngx-jsonapi", "https://www.npmjs.com/package/@crnk/angular-ngrx", "https://github.com/muellerbbm-vas/grivet", "https://github.com/infinum/datx", "https://github.com/infinum/datx/tree/master/packages/datx-jsonapi", "https://github.com/d34dman/drupal-jsonapi-params", "https://github.com/dipscope/EntityStore.TS", "https://github.com/dipscope/JsonApiEntityProvider.TS", "https://github.com/joshdholtz/jsonapi-ios", "https://github.com/wvteijlingen/spine", "https://github.com/aronbalog/Vox", "https://github.com/infinum/Japx", "https://github.com/mattpolzin/JSONAPI", "https://github.com/undabot/izzyparser-ios", "https://github.com/Datadog/swift-jsonapi", "https://github.com/jsmestad/jsonapi-consumer", "https://github.com/chingor13/json_api_client", "https://github.com/coryodaniel/munson", "https://github.com/trainline/json-api-vanilla", "https://github.com/amcaplan/simple_jsonapi_client", "https://github.com/Sonberg/jsonapi-unwrapper", "https://github.com/Art4/json-api-client", "https://github.com/woohoolabs/yang", "https://eosnewmedia.github.io/JSON-API-Client/", "https://eosnewmedia.github.io/JSON-API-Common/", "https://github.com/floor9design-ltd/json-api-formatter", "https://github.com/swisnl/json-api-client", "https://pub.dev/packages/json_api", "https://pub.dev/packages/rest_data", "https://pub.dev/packages/jsonapi_client", "https://pub.dev/packages/japx", "https://metacpan.org/pod/PONAPI::Client", "https://github.com/jasminb/jsonapi-converter", "http://www.crnk.io/", "https://github.com/MarkoMilos/jsonapi", "https://github.com/faogustavo/JSONApi", "https://github.com/kamikat/moshi-jsonapi", "https://github.com/xamoom/Morpheus", "https://github.com/undabot/izzy-json-api-android", "https://github.com/infinum/kotlin-jsonapix", "https://github.com/sckott/rjsonapi", "https://github.com/noahzgordon/elm-jsonapi", "https://github.com/noahzgordon/elm-jsonapi-http", "https://github.com/cosullivan/Hypermedia/", "https://github.com/codecutout/JsonApiSerializer", "https://github.com/scott-mcdonald/JsonApiFramework", "https://github.com/cmeeren/FSharp.JsonApi/", "https://github.com/OKTAYKIR/jsonapi-consumer/", "https://github.com/socialwifi/jsonapi-requests/", "https://github.com/qvantel/jsonapi-client", "https://github.com/noplay/json-api-doc", "https://github.com/NilssonPL/json-api-smart", "https://github.com/aonawale/JSONAPISerializer", "https://github.com/tobyzerner/json-api-server", "https://github.com/neomerx/json-api", "https://github.com/limoncello-php/app"]} {"url": "http://jsonapi.org/profiles/ethanresnick/cursor-pagination", "titulek": "JSON API — “Cursor Pagination” Profile", "h1": "Cursor Pagination", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "“Cursor Pagination” Profile"}, {"uroven": 2, "text": "Introduction"}, {"uroven": 2, "text": "Specification"}, {"uroven": 3, "text": "Concepts"}, {"uroven": 4, "text": "Sorting Requirement"}, {"uroven": 4, "text": "Cursors"}, {"uroven": 3, "text": "Query Parameters"}, {"uroven": 4, "text": "page[size]"}, {"uroven": 4, "text": "page[after] and page[before]"}, {"uroven": 5, "text": "Omitting Both page[after] and page[before]"}, {"uroven": 5, "text": "Combining page[after] and page[before]"}, {"uroven": 3, "text": "Document Structure"}, {"uroven": 4, "text": "Terms"}, {"uroven": 4, "text": "page Meta Object Members"}, {"uroven": 4, "text": "Item Cursors"}, {"uroven": 4, "text": "Links"}, {"uroven": 4, "text": "Collection Sizes"}, {"uroven": 3, "text": "Error Cases"}, {"uroven": 4, "text": "Unsupported Sort Error"}, {"uroven": 4, "text": "Max Page Size Exceeded Error"}, {"uroven": 4, "text": "Invalid Parameter Value Error"}, {"uroven": 3, "text": "Notes"}, {"uroven": 2, "text": "Version History"}, {"uroven": 2, "text": "Contact the Editor"}], "markdown": "# “Cursor Pagination” Profile\n\n## Introduction\n\nThis is the specification of [a profile](http://jsonapi.org/format/1.1/#profiles) for the JSON:API specification.\n\nThe url for this profile is `http://jsonapi.org/profiles/ethanresnick/cursor-pagination/`.\n\nCursor-based pagination (aka keyset pagination) is a [common](https://slack.engineering/evolving-api-pagination-at-slack-1c1f644f8e12) [pagination strategy](https://www.citusdata.com/blog/2016/03/30/five-ways-to-paginate/)\nthat avoids many of the pitfalls of “offset–limit” pagination.\n\nFor example, with offset–limit pagination, if an item from a prior page is\ndeleted while the client is paginating, all subsequent results will be shifted\nforward by one. Therefore, when the client requests the next page, there’s one\nresult that it will skip over and never see. Conversely, if a result is added\nto the list of results as the client is paginating, the client may see the\nsame result multiple times, on different pages. Cursor-based pagination\ncan prevent both of these possibilities.\n\nCursor-based pagination also performs better for large data sets under most\nimplementations.\n\nTo support cursor-based pagination, this specification defines three query\nparameters — `page[size]`, `page[before]`, and `page[after]` — \nand a method for providing clients with pagination links and cursors in response\nbodies.\n\nFor example, this request would get the next 100 people after the cursor `abcde`:\n\n```\nGET /people?page[size]=100&page[after]=abcde\n```\n\nReplacing `page[after]` with `page[before]` would allow the client to paginate\nbackwards.\n\nAlternatively, to find all people between cursors `abcde` and `fghij`\n(exclusive), the client could request:\n\n```\nGET /people?page[after]=abcde&page[before]=fghij\n```\n\nOther combinations are possible, and these parameters are described more below.\n\n## Specification\n\n### Concepts\n\n#### Sorting Requirement\n\n**Pagination only applies to an ordered list of results.** This order must not\nchange between requests unless the underlying data changes, to ensure that\nresults don’t arbitrarily move between pages.\n\nIf the client’s paginated request includes a `?sort` query parameter that\nonly partially orders the results, the server **MUST** apply additional\nsorting constraints — consistent with the client-requested ones — to produce\na unique ordering, if it wishes to support pagination of that data.\n\nFor example, suppose a client requests `GET /people?sort=age&page[size]=10`.\nIf multiple people have the same age, their relative ordering is not defined\n(and could vary between requests), making pagination impossible. Therefore,\nto fulfill the request, the server must treat all paginated requests with\n`?sort=age` as though the client had instead asked to sort by age followed\nby some unique field or combination of fields (e.g., `?sort=age,id`).\n\nSimilarly, when the collection being paginated has no natural or\nclient-requested order (like the set of resource identifier objects in\na relationship), the server **MUST** assign an order if it wishes to support\npagination.\n\nThe server **MAY** reject pagination requests if the client has requested that\nthe results be sorted in a way that server cannot efficiently paginate. In that\ncase, the server **MUST** reject the request according to the rules for the\nunsupported sort error.\n\n#### Cursors\n\nA “cursor” is a string, created by the server using whatever method it likes,\nthat divides the list of results into those that fall before the cursor, those\nthat fall after the cursor, and, optionally, one result that falls “on” the\ncursor.\n\nFor example, imagine that the list of results being paginated is as follows:\n\n```\n[\n { \"type\": \"examples\", \"id\": \"1\" },\n { \"type\": \"examples\", \"id\": \"5\" },\n { \"type\": \"examples\", \"id\": \"7\" },\n { \"type\": \"examples\", \"id\": \"8\" },\n { \"type\": \"examples\", \"id\": \"9\" }\n]\n```\n\nFor this list, the server might produce the cursor string `abcde` as its way of\nencoding “id = 5”. With that cursor, then, the first result would fall before\nthe cursor, the second result would fall on the cursor, and the other results\nwould fall after it.\n\nThe list of results **MAY** change between the client’s pagination requests.\nFor example, the result with `\"id\": \"5\"` might be removed from the result set if\nthe resource it refers to is deleted. In that case, the cursor `abcde` would no\nlonger fall on any one result, but the same results would still come before it\nand after it.\n\nIn rare cases, a server may find it unacceptable for the results list to change\nbetween a client’s pagination requests. In those cases, the server **MAY**\nencode into the cursor information uniquely identifying the client or its session,\nand use that identifier to return consistent results from a single “snapshot” in\ntime.\n\n### Query Parameters\n\n#### `page[size]`\n\nThe `page[size]` parameter indicates the number of results that the client\nwould like to see in the response.\n\nIf `page[size]` is provided, it **MUST** be a positive integer.1\nIf this requirement isn’t met — e.g. if `page[size]` is negative — the server\n**MUST** respond according to the rules for the invalid query parameter error.\n\nFor each endpoint on which it supports pagination, a server **MAY** define a\nmaximum number of results that it will send in response to a paginated request\nto that endpoint. This is called the “max page size”. If the server does not\nchoose a max page size for a given endpoint, it is implicitly infinity.\n\nIf `page[size]` exceeds the server-defined max page size, the server **MUST**\nrespond according to the rules for the max page size exceeded error.\n\nIf `page[size]` is omitted, the server **MUST** choose a “default page size”.\nThis default size **MUST** be an integer between 1 and the max page size,\ninclusive.\n\nThe `page[size]` value, or the default page\nsize if `page[size]` is omitted, is called the “used page size”.\n\nOn any valid paginated request, the number of pagination items\nreturned **MUST** equal the used page size — provided there are at\nleast that many items in the results list, and which satisfy the constraints of\nthe `page[after]` and/or `page[before]` parameters (if any).\n\n#### `page[after]` and `page[before]`\n\nThe `page[after]` and `page[before]` parameters are both optional and both, if\nprovided, take a cursor as their value. If their value is not a valid cursor,\nthe server **MUST** respond according to the rules for the\ninvalid query parameter error.\n\nThe `page[after]` parameter is typically sent by the client to get the next page,\nwhile `page[before]` is used to get the prior page.\n\nMore formally, when `page[after]` is provided, the returned paginated data **MUST** have as its first item the item that is *immediately after* the cursor\nin the results list. (An exception is that, if there are no items in the results\nlist that fall after the cursor, the returned paginated data **MUST** be an\nempty array.)\n\nWhen `page[before]` is provided, the *last* item returned in the paginated data **MUST** be the item that is closest to, but still before, the cursor in the\nunpaginated results list. (Analogous to the above, if there are no items in the\nresults list that fall before the cursor, the returned paginated data **MUST**\nbe an empty array.)\n\nFor example, imagine that the list of results being paginated is again:\n\n```\n[\n { \"type\": \"examples\", \"id\": \"1\" },\n { \"type\": \"examples\", \"id\": \"5\" },\n { \"type\": \"examples\", \"id\": \"7\" },\n { \"type\": \"examples\", \"id\": \"8\" },\n { \"type\": \"examples\", \"id\": \"9\" }\n]\n```\n\nFurther, imagine that the cursor `xxx` falls on the entry with `\"id\": \"9\"`,\nwhile the cursor `abcde` still falls on the entry with `\"id\": \"5\"`.\n\nThen, for example, if the request was:\n\n```\nGET /example-data?page[after]=abcde&page[size]=2\n```\n\nThe response would contain:\n\n```\n{\n \"links\": {\n \"prev\": \"/example-data?page[before]=yyy&page[size]=2\",\n \"next\": \"/example-data?page[after]=zzz&page[size]=2\"\n },\n \"data\": [\n // the pagination item metadata is optional below.\n { \"type\": \"examples\", \"id\": \"7\", \"meta\": { \"page\": { \"cursor\": \"yyy\" } } },\n { \"type\": \"examples\", \"id\": \"8\", \"meta\": { \"page\": { \"cursor\": \"zzz\" } } }\n ]\n}\n```\n\nAlternatively, if the request was:\n\n```\nGET /example-data?page[before]=xxx&page[size]=3\n```\n\nThe response would contain:\n\n```\n{\n \"links\": {\n \"prev\": \"/example-data?page[before]=abcde&page[size]=3\",\n \"next\": \"/example-data?page[after]=zzz&page[size]=3\"\n },\n \"data\": [\n // again, optional pagination item metadata is allowed for each item here.\n { \"type\": \"examples\", \"id\": \"5\" },\n { \"type\": \"examples\", \"id\": \"7\" },\n { \"type\": \"examples\", \"id\": \"8\" }\n ]\n}\n```\n\nNotice that the `page[before]=xxx` is causing the last item in the response’s\npaginated data to be the entry with `\"id\": \"8\"`, while the number of items in\nthe paginated data above that item is controlled by the used page size.\n\n##### Omitting Both `page[after]` and `page[before]`\n\nIf the client’s paginated request includes neither the `page[after]` nor the\n`page[before]` parameters, the returned paginated data **MUST** start with\nthe first item from the results list. (If the results list is empty, the\npaginated data **MUST** be an empty array.)\n\n##### Combining `page[after]` and `page[before]`\n\nClients **MAY** use the `page[after]` and `page[before]` parameters together on\nthe same request. These are called “range pagination requests”, as the client is\nasking for all the results starting from immediately after the `page[after]`\ncursor and continuing up until the `page[before]` cursor.\n\nServers are not required to support such requests. If the server chooses not to\nsupport these requests, it **MUST** respond according to the rules for the\nrange pagination not supported error.\n\nOn range pagination requests, the server **MUST** use its max page size for that\nendpoint as the default page size. In other words, the used page size will\neither by the value of the `page[size]` parameter or the max page size.\n\nIf the number of results that satisfy both the `page[after]` and `page[before]`\nconstraints exceeds the used page size, the server **MUST** respond with the\nsame paginated data that it would have if the `page[before]` parameter had not\nbeen provided. However, in this case the server **MUST** also add\n`\"rangeTruncated\": true` to the pagination metadata to indicate to the client\nthat the paginated data does not contain all the results it requested.\n\nFor example, given our example data and cursors above, imagine the client\nrequests:\n\n```\nGET /example-data?page[after]=abcde&page[before]=xxx\n```\n\nThen, assuming our server’s max page size was greater than 1, the response\nwould contain:\n\n```\n{\n \"links\": {\n \"prev\": \"/example-data?page[before]=yyy\",\n \"next\": \"/example-data?page[after]=zzz\"\n },\n \"data\": [\n { \"type\": \"examples\", \"id\": \"7\" },\n { \"type\": \"examples\", \"id\": \"8\" }\n ]\n}\n```\n\nHowever, if our server’s max page size was 1, or the client included\n`page[size]=1` in its request, the response would contain:\n\n```\n{\n \"meta\": {\n \"page\": { \"rangeTruncated\": true }\n },\n \"links\": {\n \"prev\": \"/example-data?page[before]=yyy&page[size]=1\",\n \"next\": \"/example-data?page[after]=yyy&page[size]=1\"\n },\n \"data\": [\n { \"type\": \"examples\", \"id\": \"7\" }\n ]\n}\n```\n\n### Document Structure\n\n#### Terms\n\nThis profile uses the following terms to refer to different document elements:\n\n1. paginated data: an array in a JSON:API\n response document that holds the results that were extracted from a full list\n of results being paginated. It is always the value of a `data` key. When the\n [primary data](https://jsonapi.org/format/#document-top-level) is being\n paginated, the value of the document’s top-level `data` key is paginated data.\n When the resource identifier objects in a relationship are being paginated,\n the value of the `data` key in the relationship object is paginated data.\n2. pagination links: the `links` object\n that’s a sibling of the paginated data.\n3. pagination metadata: the `page`\n member of the `meta` object that’s a sibling of the paginated data (and\n pagination links).\n4. pagination item: an entry in the\n paginated data array.\n5. pagination item metadata: the\n `page` member of the `meta` object that’s at the top-level of a\n paginated data item.\n\nTo demonstrate these terms, various elements are labeled in the following\nexample:\n\n```\nGET /people?page[size]=1\n```\n\n```\n{\n // \"pagination links\" (for the top-level `data`)\n \"links\": { },\n \"meta\": {\n // \"pagination metadata\"\n \"page\": {}\n },\n // \"paginated data\"\n \"data\": [\n // a \"pagination item\"\n {\n \"type\": \"people\",\n \"id\": \"1\",\n // \"pagination item metadata\" in `page`.\n \"meta\": { \"page\": {} },\n \"attributes\": {},\n \"relationships\": {\n \"friends\": {\n // \"pagination links\".\n // would be non-empty in practice to indicate that the server\n // has chosen to paginate this relationship, even though the\n // client hasn't explicitly asked, which is allowed.\n \"links\": {},\n // another instance of \"paginated data\"\n \"data\": [\n // a \"pagination item\", with (empty) \"pagination item metadata\".\n { \"type\": \"people\", \"id\": \"3\", \"meta\": { \"page\": { } } }\n ]\n }\n }\n }\n ]\n}\n```\n\n#### `page` Meta Object Members\n\nThis profile reserves a `page` member in every JSON:API-defined `meta` object.\n(Each of these `page` members constitutes an element defined by this profile,\nso they can be [aliased](https://jsonapi.org/format/1.1/#profile-keywords-and-aliases).)\n\nThe `page` member, when present, **MUST** hold an object as its value; any other\nvalues are [unrecognized](https://jsonapi.org/format/1.1/#profiles-processing).\nThe recognized keys/values in these various `page` objects are defined throughout\nthis specification.\n\n#### Item Cursors\n\nThe server **MAY** choose to send some or all pagination items back to the client\nwith a `cursor` member in the pagination item’s metadata.\nIf present, this member **MUST** hold a cursor that (at the time of the response)\n“falls on” the item it is returned with. Clients can use this cursor\nto paginate from this item.\n\nFor example, a response might contain:\n\n```\n{\n // top-level links, meta, etc. omitted.\n // more people would likely be in the response as well.\n \"data\": [{\n \"type\": \"people\",\n \"id\": \"3\",\n \"meta\": {\n \"page\": { \"cursor\": \"someOpaqueString\" }\n }\n //...\n }]\n}\n```\n\nWith this response, clients could use `page[before]=someOpaqueString` or\n`page[after]=someOpaqueString` to paginate from person 3 in either direction.\n\n#### Links\n\nJSON:API allows four types of pagination links: [`prev`, `next`, `first`, and\n`last`](https://jsonapi.org/format/#fetching-pagination).\n\nIt is **RECOMMENDED** that servers include `first` and `last` links when these\nare inexpensive to compute.\n\nHowever, servers **MUST** include a `prev` and a `next` link for each instance\nof paginated data in a response.\n\nIf a request does not contain the `page[before]` parameter, the server **MUST**\ndetermine whether a next page exists, and return `null` as the `next` link if not.\n\nIf a request does not contain the `page[after]` parameter, the server **MUST**\ndetermine whether a previous page exists, and return `null` as the `prev` link\nif not.\n\nIn all other cases, a server **SHOULD** set these links to `null` when it can\ninexpensively determine that the current response is for the first or last page\nrespectively.\n\nHowever, if the server can’t easily determine whether there are prior results\n(when computing the `prev` link) or subsequent results (when computing the\n`next` link), it **MAY** use a URI in these links that returns an empty array\nas its paginated data.\n\nFor example, imagine a request for:\n\n```\nGET /example-data?page[before]=xyz\n```\n\nTo fulfill this request, the server will likely issue a query that filters the\nfull `example-data` results list to find only records that are before the cursor.\nFrom those query results, the server would not know whether there are additional\nresults that come *after* the cursor, and it may not have a cheap way to find out.\n\nSo, in this case, the server can simply return a `next` URI where the `page[after]`\nparameter is set to the item cursor for the last item in the\nresponse’s paginated data.\n\nIf the client goes to fetch this link, it will either receive an empty array\nas the paginated data, in which case it knows it’s reached the end, or it will\nget the subsequent results.\n\n> Note: in general, servers are likely to find it more expensive to determine\n> whether a previous page exists when `page[after]` is in use, and whether a\n> subsequent page exists when `page[before]` is in use. Luckily, when `page[after]`\n> is in use, clients usually don’t care about the previous page (only the next\n> one), and vice-versa when `page[before]` is in use. So, by allowing the server\n> to return a link that might end up corresponding to an empty page, the server\n> can often skip a query that will never be needed.\n\n#### Collection Sizes\n\nThe pagination metadata **MAY** contain a `total` member containing an integer\nindicating the total number of items in the list of results that’s being\npaginated.\n\nFor example, a response to `GET /people?page[size]=2` might include:\n\n```\n{\n \"meta\": {\n \"page\": { \"total\": 200 }\n },\n // links omitted\n \"data\": [\n {\n \"type\": \"people\",\n // ...\n },\n {\n \"type\": \"people\",\n // ...\n }\n ]\n}\n```\n\nThe pagination metadata **MAY** also contain an `estimatedTotal` member.\nIf present, the value of this member **MUST** be an object. That object\n**MAY** have one key, `bestGuess`. If present, `bestGuess` **MUST** contain\nan integer indicating the server’s best estimate of the size of the full results\nlist.\n\nServer’s might choose to use `estimatedTotal` instead of `total` when computing\nthe exact total is costly.\n\n### Error Cases\n\n#### Unsupported Sort Error\n\nThe server **MUST** respond to this error by sending a `400 Bad Request`. The\nresponse document **MUST** contain an error object that identifies the `sort`\nparameter as the [error’s `source`](https://jsonapi.org/format/#error-objects),\nand has a `type` link of:\n\n```\nhttps://jsonapi.org/profiles/ethanresnick/cursor-pagination/unsupported-sort\n```\n\n#### Max Page Size Exceeded Error\n\nThe server **MUST** respond to this error by sending a `400 Bad Request`. The\nresponse document **MUST** contain an error object that:\n\n- identifies `page[size]` as the error’s `source` ;\n- provides the maximum page size as an integer in `maxSize` member of the `page` element in the error object’s `meta` object; and\n- includes a `type` link of: `https://jsonapi.org/profiles/ethanresnick/cursor-pagination/max-size-exceeded`\n\nIf this profile’s `page` element has not been [aliased](https://jsonapi.org/format/1.1/#profile-keywords-and-aliases),\nthe error object might look like:\n\n```\n{\n \"status\": \"400\",\n \"meta\": {\n \"page\": { \"maxSize\": 100 }\n },\n \"title\": \"Page size requested is too large.\",\n \"detail\": \"You requested a size of 200, but 100 is the maximum.\",\n \"source\": {\n \"parameter\": \"page[size]\"\n },\n \"links\": {\n \"type\": [\"https://jsonapi.org/profiles/ethanresnick/cursor-pagination/max-size-exceeded\"]\n }\n}\n```\n\n#### Invalid Parameter Value Error\n\nThe server **MUST** respond to this error by sending a `400 Bad Request` with an\nerror object in the response document that identifies the problematic parameter\nin the error object’s `source` member.\n\nFor example, the server might send:\n\n```\n{\n \"errors\": [{\n \"title\": \"Invalid Parameter.\",\n \"detail\": \"page[size] must be a positive integer; got 0\",\n \"source\": { \"parameter\": \"page[size]\" },\n \"status\": \"400\"\n }]\n}\n```\n\nThe server **MUST** respond to this error by sending a `400 Bad Request`. The\nresponse document **MUST** contain an error object that has a `type` link of:\n\n```\nhttps://jsonapi.org/profiles/ethanresnick/cursor-pagination/range-pagination-not-supported\n```\n\n### Notes\n\n1. Technically, a URI is a series of characters, so the value\nof a query parameter – including `page[size]` – is always a string. When\nthe text says the value “MUST be a positive integer”, it means more precisely\nthat the value **MUST** be a sequence of characters matching the regular\nexpression `^[0-9]+$` , which **MUST** then be interpreted as a base-10 integer.\n\n## Version History\n\n[View changes to this profile over time](https://github.com/json-api/json-api/commits/gh-pages/_profiles/ethanresnick/cursor-pagination/index.md)\n\n## Contact the Editor\n\nEthan Resnick\n [ethan.resnick@gmail.com](mailto:ethan.resnick@gmail.com)\n [https://ethanresnick.com/](https://ethanresnick.com/)\n [13104398032](tel:13104398032)", "znaku_textu": 19810, "slov": 3062, "odkazu": 44, "kodovani": "windows-1250", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:30", "sha256": "8a2a1444c7a9ef1c9eb78239a963781f131bc61a00cfe477860b6553692c47d9", "hloubka": 4, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://slack.engineering/evolving-api-pagination-at-slack-1c1f644f8e12", "https://www.citusdata.com/blog/2016/03/30/five-ways-to-paginate/", "https://github.com/json-api/json-api/commits/gh-pages/_profiles/ethanresnick/cursor-pagination/index.md", "https://ethanresnick.com/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "http://jsonapi.org/recommendations/", "titulek": "JSON:API — Recommendations", "h1": "Recommendations", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Recommendations"}, {"uroven": 2, "text": "Naming"}, {"uroven": 2, "text": "URL Design"}, {"uroven": 3, "text": "Reference Document"}, {"uroven": 3, "text": "URLs for Resource Collections"}, {"uroven": 3, "text": "URLs for Individual Resources"}, {"uroven": 2, "text": "Filtering"}, {"uroven": 2, "text": "Including Top-level, Resource-level and Relationship Links"}, {"uroven": 2, "text": "Supporting Clients Lacking PATCH"}, {"uroven": 2, "text": "Formatting Date and Time Fields"}, {"uroven": 2, "text": "Asynchronous Processing"}, {"uroven": 2, "text": "Authoring Profiles"}], "markdown": "# Recommendations\n\nThis section contains recommendations for JSON:API implementations. These\nrecommendations are intended to establish a level of consistency in areas that\nare beyond the scope of the base JSON:API specification.\n\n## Naming\n\nThe specification places certain [hard restrictions](http://jsonapi.org/format/#document-member-names) \non how members (i.e., keys) in a JSON:API document may be named. To further \nstandardize member names, which is especially important when mixing profiles\nauthored by different parties, the following rules are also recommended:\n\n- Member names **SHOULD** be camel-cased (i.e., `wordWordWord` )\n- Member names **SHOULD** start and end with a character “a-z” (U+0061 to U+007A)\n- Member names **SHOULD** contain only ASCII alphanumeric characters (i.e., “a-z”, “A-Z”, and “0-9”)\n\n## URL Design\n\n### Reference Document\n\nWhen determining an API’s URL structure, it is helpful to consider that all of\nits resources exist in a single “reference document” in which each resource is\naddressable at a unique path. Resources are grouped by type at the top level of\nthis document. Individual resources are keyed by ID within these typed\ncollections. Attributes and links within individual resources are uniquely\naddressable according to the resource object structure described above.\n\nThis concept of a reference document is used to determine appropriate URLs for\nresources as well as their relationships. It is important to understand that\nthis reference document differs slightly in structure from documents used to\ntransport resources due to different goals and constraints. For instance,\ncollections in the reference document are represented as sets because members\nmust be addressable by ID, while collections are represented as arrays in\ntransport documents because order is significant.\n\n### URLs for Resource Collections\n\nIt is recommended that the URL for a collection of resources be formed from\nthe resource type.\n\nFor example, a collection of resources of type `photos` will have the URL:\n\n```\n/photos\n```\n\n### URLs for Individual Resources\n\nTreat collections of resources as sets keyed by resource ID. The URL for an\nindividual resource can be formed by appending the resource’s ID to the\ncollection URL.\n\nFor example, a photo with an ID of `\"1\"` will have the URL:\n\n```\n/photos/1\n```\n\nAs described in the base specification, there are two URLs that can be exposed\nfor each relationship:\n\n- the “relationship URL” - a URL for the relationship itself, which is\nidentified with the `self` key in a relationship’s `links` object. This URL\nallows the client to directly manipulate the relationship. For example, it would\nallow a client to remove an `author` from a `post` without deleting the `people`\nresource itself.\n- the “related resource URL” - a URL for the related resource(s), which is\nidentified with the `related` key within a relationship’s `links` object. When\nfetched, it returns the related resource object(s) as the response’s primary data.\n\nIt is recommended that a relationship URL be formed by appending `/relationships/`\nand the name of the relationship to the resource’s URL.\n\nFor example, a photo’s `comments` relationship will have the URL:\n\n```\n/photos/1/relationships/comments\n```\n\nAnd a photo’s `photographer` relationship will have the URL:\n\n```\n/photos/1/relationships/photographer\n```\n\nIt is recommended that a related resource URL be formed by appending the name\nof the relationship to the resource’s URL.\n\nFor example, the URL for a photo’s `comments` will be:\n\n```\n/photos/1/comments\n```\n\nAnd the URL for a photo’s `photographer` will be:\n\n```\n/photos/1/photographer\n```\n\nBecause these URLs represent resources in relationships, they should not be\nused as `self` links for the resources themselves. Instead the recommendations\nfor individual resource URLs should still apply when forming `self` links.\n\n## Filtering\n\nThe base specification is agnostic about filtering strategies supported by a\nserver. The `filter` query parameter family is reserved to be used as the basis \nfor any filtering strategy.\n\nIt’s recommended that servers that wish to support filtering of a resource\ncollection based upon associations do so by allowing query parameters that\ncombine `filter` with the association name.\n\nFor example, the following is a request for all comments associated with a\nparticular post:\n\n```\nGET /comments?filter[post]=1 HTTP/1.1 \n```\n\nMultiple filter values can be combined in a comma-separated list. For example:\n\n```\nGET /comments?filter[post]=1,2 HTTP/1.1 \n```\n\nFurthermore, multiple filters can be applied to a single request:\n\n```\nGET /comments?filter[post]=1,2&filter[author]=12 HTTP/1.1 \n```\n\n## Including Top-level, Resource-level and Relationship Links\n\nThe base specification is agnostic about including links with a resource response. However, it is recommended that the following links be included within response documents:\n\n- **Top-level links** like a self-link (for the whole response) as well as relative pagination links (if appropriate).\n- **Resource-level links** like a self-link for each resource (which differs from the top-level, if the resource is part of a collection).\n- **Relationship links** for all available relationships of a resource.\n\nFor example, a request for a collection of comments could prompt the following response:\n\n```\nGET /comments HTTP/1.1\n\n{\n \"data\": [{\n \"type\": \"comments\",\n \"id\": \"1\",\n \"attributes\": {\n \"text\": \"HATEOS are the thing!\"\n },\n \"links\": {\n \"self\": \"/comments/1\"\n },\n \"relationships\": {\n \"author\": {\n \"links\": {\n \"self\": \"/comments/1/relationships/author\",\n \"related\": \"/comments/1/author\"\n }\n },\n \"articles\": {\n \"links\": {\n \"self\": \"/comments/1/relationships/articles\",\n \"related\": \"/comments/1/articles\"\n }\n }\n }\n }],\n \"links\": {\n \"self\": \"/comments\"\n }\n}\n```\n\n## Supporting Clients Lacking `PATCH`\n\nSome clients, like IE8, lack support for HTTP’s `PATCH` method. API servers\nthat wish to support these clients are recommended to treat `POST` requests as\n`PATCH` requests if the client includes the `X-HTTP-Method-Override: PATCH`\nheader. This allows clients that lack `PATCH` support to have their update\nrequests honored, simply by adding the header.\n\n## Formatting Date and Time Fields\n\nAlthough JSON:API does not specify the format of date and time fields, it is\nrecommended that servers align with ISO 8601. [This W3C\nNOTE](http://www.w3.org/TR/NOTE-datetime) provides an overview of the\nrecommended formats.\n\n## Asynchronous Processing\n\nConsider a situation when you need to create a resource and the operation takes a long time to complete.\n\n```\nPOST /photos HTTP/1.1 \n```\n\nThe request **SHOULD** return a status `202 Accepted` with a link in the `Content-Location` header.\n\n```\nHTTP/1.1 202 Accepted Content-Type: application/vnd.api+json Content-Location: https://example.com/photos/jobs/5234 { \"data\": { \"type\": \"jobs\", \"id\": \"5234\", \"attributes\": { \"status\": \"Pending request, waiting other process\" }, \"links\": { \"self\": \"/photos/jobs/5234\" } } } \n```\n\nTo check the status of the job process, a client can send a request to the location given earlier.\n\n```\nGET /photos/jobs/5234 HTTP/1.1 Accept: application/vnd.api+json \n```\n\nRequests for still-pending jobs **SHOULD** return a status `200 OK`, as the server is reporting the status successfully. Optionally, the server can return a `Retry-After` header to provide guidance to the client as to how long it should wait before checking again. Recommendations to retry sooner than 1 second can be accomplished with `Retry-After: 0`.\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json Retry-After: 10 { \"data\": { \"type\": \"jobs\", \"id\": \"5234\", \"attributes\": { \"status\": \"Pending request, waiting other process\" }, \"links\": { \"self\": \"/photos/jobs/5234\" } } } \n```\n\nWhen job process is done, the request **SHOULD** return a status `303 See other` with a link in `Location` header.\n\n```\nHTTP/1.1 303 See other Content-Type: application/vnd.api+json Location: https://example.com/photos/4577 \n```\n\n## Authoring Profiles\n\nProfiles are a mechanism that can be used by the sender of a document to make promises about its content, without adding to or altering the basic semantics of the JSON:API specification. For example, a profile may indicate that all resource objects will have a `timestamps` attribute field and that the members of the `timestamps` object will be formatted using the ISO 8601 date time format.\n\nA profile is an independent specification of those promises. The following example illustrates how the aforementioned profile might be authored:\n\n```\n# Timestamps profile\n\n## Introduction\n\nThis page specifies a profile for the `application/vnd.api+json` media type,\nas described in the [JSON:API specification](http://jsonapi.org/format/).\n\nThis profile allows every resource in a JSON:API document to represent\nsignificant timestamps in a consistent way.\n\n## Document Structure\n\nEvery resource object **MUST** include a `timestamps` member in its associated\n`attributes` object. If this member is present, its value **MUST** be an object that\n**MAY** contain at least one of the following members:\n\n* `created`\n* `updated`\n\nThe value of each member **MUST** comply with the variant of ISO 8601 used by\nJavaScript's `JSON.stringify` method to format Javascript `Date` objects.\n```", "znaku_textu": 8994, "slov": 1322, "odkazu": 29, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:18:09", "sha256": "7ba118069fd9c850d4452f113d1a79ba5f6167443df1909d576805dc287f3dd2", "hloubka": 3, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["http://www.w3.org/TR/NOTE-datetime", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/", "titulek": "JSON:API — A specification for building APIs in JSON", "h1": "JSON:API", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 2, "text": "MIME Types"}, {"uroven": 2, "text": "Format documentation"}, {"uroven": 2, "text": "Extensions"}, {"uroven": 2, "text": "Milestones"}], "markdown": "If you’ve ever argued with your team about the way your JSON responses\nshould be formatted, JSON:API can help you stop the\n[bikeshedding](http://bikeshed.org) and focus on what matters:\n**your application**.\n\nBy following shared conventions, you can increase productivity, take advantage\nof generalized tooling and best practices. Clients built around JSON:API are\nable to take advantage of its features around efficiently caching responses,\nsometimes eliminating network requests entirely.\n\nHere’s an example response from a blog that implements JSON:API:\n\n```\n{ \"links\": { \"self\": \"http://example.com/articles\", \"next\": \"http://example.com/articles?page[offset]=2\", \"last\": \"http://example.com/articles?page[offset]=10\" }, \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }, \"comments\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": \"http://example.com/articles/1/comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"5\" }, { \"type\": \"comments\", \"id\": \"12\" } ] } }, \"links\": { \"self\": \"http://example.com/articles/1\" } }], \"included\": [{ \"type\": \"people\", \"id\": \"9\", \"attributes\": { \"firstName\": \"Dan\", \"lastName\": \"Gebhardt\", \"twitter\": \"dgeb\" }, \"links\": { \"self\": \"http://example.com/people/9\" } }, { \"type\": \"comments\", \"id\": \"5\", \"attributes\": { \"body\": \"First!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"2\" } } }, \"links\": { \"self\": \"http://example.com/comments/5\" } }, { \"type\": \"comments\", \"id\": \"12\", \"attributes\": { \"body\": \"I like XML better\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/comments/12\" } }] } \n```\n\nThe response above contains the first in a collection of “articles”, as well as\nlinks to subsequent members in that collection. It also contains resources\nlinked to the article, including its author and comments. Last but not least,\nlinks are provided that can be used to fetch or update any of these\nresources.\n\nJSON:API covers creating and updating resources as well, not just responses.\n\n## MIME Types\n\nJSON:API has been properly registered with the IANA. Its media\ntype designation is [`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).\n\n## Format documentation\n\nTo get started with JSON:API, check out [documentation for the base\nspecification](/format).\n\n## Extensions\n\nThe JSON:API community has created a collection of extensions that APIs can use\nto provide clients with information or functionality beyond that described in the\nbase JSON:API specification. These extensions are called profiles.\n\nYou can [browse existing profiles](/extensions/#existing-profiles) or\n[create a new one](/extensions/#profile-creation).\n\n## Milestones\n\nMajor milestones for this specification include:\n\n- 2022-09-30: 1.1 final released.\n- 2015-05-29: 1.0 final released.\n- 2013-07-21: Media type registration completed with the IANA.\n- 2013-05-03: Initial release of the draft.\n\nA more thorough history is available [here](/about/#update-history).\n\nYou can subscribe to an RSS feed of individual changes [here](https://github.com/json-api/json-api/commits.atom).", "znaku_textu": 3381, "slov": 440, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:38", "sha256": "03050536b85fcf6ca35c6992223dbb2873ac18c7f380c079f044b00b073b9cac", "hloubka": 0, "zdroj_objevu": "seed", "ze_seznamu": true, "mime": "text/html", "odkazy_externi": ["https://github.com/json-api/json-api", "http://bikeshed.org/", "http://www.iana.org/assignments/media-types/application/vnd.api+json", "https://github.com/json-api/json-api/commits.atom", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/about/", "titulek": "JSON:API — About", "h1": "About", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "About"}, {"uroven": 2, "text": "Channels"}, {"uroven": 2, "text": "Editors"}, {"uroven": 2, "text": "History"}, {"uroven": 3, "text": "Update history"}], "markdown": "# About\n\n## Channels\n\nJSON:API is:\n\n- [@jsonapi](https://twitter.com/jsonapi) on [Twitter](https://twitter.com)\n- *#jsonapi* channel on [Freenode IRC](http://freenode.net)\n- [jsonapi discussion forum](https://discuss.jsonapi.org)\n\n## Editors\n\nThere are four active editors of this specification:\n\n- [Yehuda Katz](https://twitter.com/wycats)\n- [Dan Gebhardt](https://twitter.com/dgeb)\n- [Gabe Sullice](https://twitter.com/gabesullice)\n- [Jeldrik Hanschke](https://twitter.com/jelhan1)\n\nThe following emeritus editors are no longer active:\n\n- [Tyler Kellen](https://twitter.com/tkellen)\n- [Steve Klabnik](https://twitter.com/steveklabnik)\n- [Ethan Resnick](https://twitter.com/ethanresnick)\n\n## History\n\nJSON:API was originally drafted by [Yehuda Katz](https://twitter.com/wycats)\nin May 2013. This first draft was extracted from the JSON transport\nimplicitly defined by [Ember](https://emberjs.com/) Data’s REST adapter.\n\nIn general, Ember Data’s goal is to eliminate the need for ad-hoc code\nper application to communicate with servers that communicate in a\nwell-defined way.\n\nSome servers, like Firebase, Parse and CouchDB already define strict\ncommunication protocols for clients, and were good fits for Ember Data.\nIn contrast, servers written in Rails, Node, and Django tend to be\nwritten in a “REST-style” but lack the precision necessary for drop-in\nclient code.\n\nThe REST Adapter in Ember Data implicitly defined a protocol that\ncustom servers could implement to get a drop-in client for all of their\nresources. [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) is a proof-of-concept library\nfor Rails that implemented the serialization format expected by Ember\nData.\n\nRecord creation, update, and deletion was defined implicitly by the\nEmber Data library and was close to conventions already in wide use by\nRails, Django and Node developers.\n\nThe goals of the media type are to balance:\n\n- A generic media type that can work across a broad set of use cases,\nincluding the generally used relationship types\n- Similarity to existing server-side framework practices (and human\nreadability for debugging)\n- Ease of implementation on the server side\n- Ease of implementation on the client side\n\nThis specification reached a stable version 1.0 on May 29, 2015.\n\n### Update history\n\n- 2022-09-30: 1.1 final released.\n- 2022-08-22: 1.1 Release candidate 4 released.\n - Formalized the definition of specification and implementation [semantics](https://jsonapi.org/format/1.1/#semantics) .\n - Refined the definitions of [extensions](https://jsonapi.org/format/1.1/#extensions) and [profiles](https://jsonapi.org/format/1.1/#profiles) .\n - Clarified details regarding expected and allowed responses, query\n parameters, and more.\n- 2020-10-01: 1.1 Release candidate 3 released.\n - Refined links objects. The link object `params` member was removed to\n better align with other JSON link serializations. The `anchor` target\n attribute was also removed. It may be restored in a future minor release.\n- 2020-08-20: 1.1 Release candidate 2 released.\n - [Extensions](https://jsonapi.org/format/1.1/#extensions) were added and the\n scope of [profiles](https://jsonapi.org/format/1.1/#profiles) were reduced\n since their introduction in RC1.\n - [Links](https://github.com/json-api/json-api/pull/1348) can be represented\n as [RFC 8288](https://tools.ietf.org/html/rfc8288) -style web links.\n - A new [`describedby`](https://github.com/json-api/json-api/pull/1447) [links member](https://jsonapi.org/format/1.1/#document-top-level) was added so that implementors can incorporate description documents (e.g. [OpenAPI](https://www.openapis.org/) or [JSON Schema](https://json-schema.org/specification.html) )\n directly into their APIs.\n - [Local IDs](https://jsonapi.org/format/1.1/#document-resource-object-identification) were [introduced](https://github.com/json-api/json-api/pull/1244) so that a\n client can create a relationship to a resource yet-to-be created by the\n same request.\n- 2018-12-01: 1.1 Release candidate 1 released.\n - New features include: [profiles](https://jsonapi.org/format/1.1/#profiles) , [”@-Members”](https://jsonapi.org/format/1.1/#document-member-names-at-members) , and [error object `type` links](https://jsonapi.org/format/1.1/#error-objects) .\n - There are editorial clarifications around: [query parameters](https://jsonapi.org/format/1.1/#query-parameters) (their parsing/serialization, and reserved parameter names), the appropriate status code for [specific](https://github.com/json-api/json-api/pull/1036) [responses](https://github.com/json-api/json-api/pull/1029) , and the [presence of the `included` key](https://github.com/json-api/json-api/pull/1236) even when its value is an empty array.\n - JSON:API switched to [recommending camelCased names](https://jsonapi.org/recommendations/#naming) .\n- 2015-05-29: 1.0 final released.\n- 2015-05-21: 1.0 Release candidate 4 released.\n- 2015-03-16: 1.0 Release candidate 3 released.\n- 2015-02-18: 1.0 Release candidate 2 released.\n- 2014-07-05: 1.0 Release candidate 1 released.\n- 2013-07-21: Media type registration completed with the IANA.\n- 2013-05-03: Initial release of the draft.", "znaku_textu": 5097, "slov": 612, "odkazu": 48, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/about/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:45", "sha256": "6dc71fbf3521ab19af2e8885d8ee3d1f3c64c0c24fae5208d2e460c36e24e382", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://twitter.com/jsonapi", "https://twitter.com/", "http://freenode.net/", "https://discuss.jsonapi.org/", "https://twitter.com/wycats", "https://twitter.com/dgeb", "https://twitter.com/gabesullice", "https://twitter.com/jelhan1", "https://twitter.com/tkellen", "https://twitter.com/steveklabnik", "https://twitter.com/ethanresnick", "https://emberjs.com/", "https://github.com/rails-api/active_model_serializers", "https://github.com/json-api/json-api/pull/1348", "https://tools.ietf.org/html/rfc8288", "https://github.com/json-api/json-api/pull/1447", "https://www.openapis.org/", "https://json-schema.org/specification.html", "https://github.com/json-api/json-api/pull/1244", "https://github.com/json-api/json-api/pull/1036", "https://github.com/json-api/json-api/pull/1029", "https://github.com/json-api/json-api/pull/1236", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://github.com/json-api"]} {"url": "https://jsonapi.org/examples/", "titulek": "JSON:API — Examples", "h1": "Examples", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Examples"}, {"uroven": 2, "text": "Sparse Fieldsets"}, {"uroven": 2, "text": "Error Objects"}, {"uroven": 3, "text": "A Basic Error Object"}, {"uroven": 3, "text": "Multiple Errors"}, {"uroven": 3, "text": "Error Codes"}, {"uroven": 3, "text": "Advanced source Usage"}, {"uroven": 4, "text": "Invalid Query Parameters"}], "markdown": "# Examples\n\nThis page contains additional examples of how to apply various parts of the specification.\n\n## Sparse Fieldsets\n\nExamples of how [sparse fieldsets](http://jsonapi.org/format/#fetching-sparse-fieldsets) work.\n\nBasic request:\n\n```\nGET /articles?include=author HTTP/1.1 \n```\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\", \"body\": \"The shortest article. Ever.\", \"created\": \"2015-05-22T14:56:29.000Z\", \"updated\": \"2015-05-22T14:56:28.000Z\" }, \"relationships\": { \"author\": { \"data\": {\"id\": \"42\", \"type\": \"people\"} } } }], \"included\": [ { \"type\": \"people\", \"id\": \"42\", \"attributes\": { \"name\": \"John\", \"age\": 80, \"gender\": \"male\" } } ] } \n```\n\nRequest with `fields[articles]` and `fields[people]` parameters:\n\n```\nGET /articles?include=author&fields[articles]=title,body,author&fields[people]=name HTTP/1.1 \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply\n> for readability. In practice, these characters should be percent-encoded, as\n> noted in the base specification. See “[Square Brackets in Parameter Names](/format/1.1/#appendix-query-details-square-brackets)”.\n\nHere we want `articles` objects to have fields `title`, `body` and `author` only and `people` objects to have `name` field only.\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\", \"body\": \"The shortest article. Ever.\" }, \"relationships\": { \"author\": { \"data\": {\"id\": \"42\", \"type\": \"people\"} } } }], \"included\": [ { \"type\": \"people\", \"id\": \"42\", \"attributes\": { \"name\": \"John\" } } ] } \n```\n\nPay attention to the fact that you have to add a relationship name both in `include` and `fields` (since relationships are fields too), otherwise you’ll get:\n\n```\nGET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 \n```\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\", \"body\": \"The shortest article. Ever.\" } }], \"included\": [ { \"type\": \"people\", \"id\": \"42\", \"attributes\": { \"name\": \"John\" } } ] } \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply\n> for readability. In practice, these characters should be percent-encoded, as\n> noted in the base specification. See “[Square Brackets in Parameter Names](/format/1.1/#appendix-query-details-square-brackets)”.\n\nExample of a page-based strategy on how to add [pagination links](http://jsonapi.org/format/#fetching-pagination).\n\nBasic request:\n\n```\nGET /articles?page[number]=3&page[size]=1 HTTP/1.1 \n```\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"meta\": { \"totalPages\": 13 }, \"data\": [ { \"type\": \"articles\", \"id\": \"3\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\", \"body\": \"The shortest article. Ever.\", \"created\": \"2015-05-22T14:56:29.000Z\", \"updated\": \"2015-05-22T14:56:28.000Z\" } } ], \"links\": { \"self\": \"http://example.com/articles?page[number]=3&page[size]=1\", \"first\": \"http://example.com/articles?page[number]=1&page[size]=1\", \"prev\": \"http://example.com/articles?page[number]=2&page[size]=1\", \"next\": \"http://example.com/articles?page[number]=4&page[size]=1\", \"last\": \"http://example.com/articles?page[number]=13&page[size]=1\" } } \n```\n\n> Note: The above example URIs show unencoded `[` and `]` characters simply\n> for readability. In practice, these characters should be percent-encoded, as\n> noted in the base specification. See “[Square Brackets in Parameter Names](/format/1.1/#appendix-query-details-square-brackets)”.\n\n> Note: Putting a property like `\"totalPages\"` in `\"meta\"` can be a convenient way\n> to indicate to clients the total number of pages in a collection (as opposed to\n> the `\"last\"` link, which simply gives the URI of the last page). However, all\n> `\"meta\"` values are implementation-specific, so you can call this member whatever\n> you like (`\"total\"`, `\"count\"`, etc.) or not use it at all.\n\n## Error Objects\n\nExamples of how [error objects](http://jsonapi.org/format/#error-objects) work.\n\n### A Basic Error Object\n\nIn the response below, the server is indicating that it encountered an error\nwhile creating/updating the resource, and that this error was caused\nby an invalid `\"firstName\"` attribute:\n\n```\nHTTP/1.1 422 Unprocessable Entity Content-Type: application/vnd.api+json { \"errors\": [ { \"status\": \"422\", \"source\": { \"pointer\": \"/data/attributes/firstName\" }, \"title\": \"Invalid Attribute\", \"detail\": \"First name must contain at least two characters.\" } ] } \n```\n\nEvery member in an error object is optional, but all help the client\nby providing extra details.\n\nThe `source` member is used to [indicate](https://tools.ietf.org/html/rfc6901)\nwhich part of the request document caused the error.\n\nThe `title` and `detail` members are similar, but `detail` is specific\nto this occurrence of the problem, whereas `title` is more generic.\n\nThe `status` member represents the HTTP status code associated with the problem.\nIt’s very helpful when multiple errors are returned at once (see below), as the\nHTTP response itself can only have one status code. However, it can also be\nuseful for single errors, to save clients the trouble of consulting the HTTP\nheaders, or for using JSON:API over non-HTTP protocols, which may be officially\nsupported in the near future.\n\n### Multiple Errors\n\nWhen multiple errors occur in response to a single request, the server\ncan simply add each error to the `errors` array:\n\n```\nHTTP/1.1 400 Bad Request Content-Type: application/vnd.api+json { \"errors\": [ { \"status\": \"403\", \"source\": { \"pointer\": \"/data/attributes/secretPowers\" }, \"detail\": \"Editing secret powers is not authorized on Sundays.\" }, { \"status\": \"422\", \"source\": { \"pointer\": \"/data/attributes/volume\" }, \"detail\": \"Volume does not, in fact, go to 11.\" }, { \"status\": \"500\", \"source\": { \"pointer\": \"/data/attributes/reputation\" }, \"title\": \"The backend responded with an error\", \"detail\": \"Reputation service not responding after three requests.\" } ] } \n```\n\nThe only uniqueness constraint on error objects is the `id` field. Thus,\nmultiple errors on the same attribute can each be given their own error\nobject. The example below shows multiple errors on the `\"firstName\"` attribute:\n\n```\nHTTP/1.1 422 Unprocessable Entity Content-Type: application/vnd.api+json { \"errors\": [ { \"source\": { \"pointer\": \"/data/attributes/firstName\" }, \"title\": \"Invalid Attribute\", \"detail\": \"First name must contain at least two characters.\" }, { \"source\": { \"pointer\": \"/data/attributes/firstName\" }, \"title\": \"Invalid Attribute\", \"detail\": \"First name must contain an emoji.\" } ] } \n```\n\n> Note: in the responses above with a 422 status code, `400 Bad Request` would\n> also be acceptable. ([More details.](http://stackoverflow.com/a/20215807/1261879))\n> JSON:API doesn’t take a position on 400 vs. 422.\n\n### Error Codes\n\nThe `code` member of an error object contains an application-specific code\nrepresenting the type of problem encountered. `code` is similar to `title`\nin that both identify a general type of problem (unlike `detail`, which is\nspecific to the particular instance of the problem), but dealing with `code`\nis easier programmatically, because the “same” `title` may appear in different\nforms due to localization.\n\nFor the example below, imagine the API docs specified the following mapping:\n\n| Code | Problem |\n| --- | --- |\n| 123 | Value too short |\n| 225 | Password lacks a letter, number, or punctuation character |\n| 226 | Passwords do not match |\n| 227 | Password cannot be one of last five passwords |\n\nMultiple errors on `\"password\"` attribute, with error `code`:\n\n```\nHTTP/1.1 422 Unprocessable Entity Content-Type: application/vnd.api+json { \"jsonapi\": { \"version\": \"1.1\" }, \"errors\": [ { \"code\": \"123\", \"source\": { \"pointer\": \"/data/attributes/firstName\" }, \"title\": \"Value is too short\", \"detail\": \"First name must contain at least two characters.\" }, { \"code\": \"225\", \"source\": { \"pointer\": \"/data/attributes/password\" }, \"title\": \"Passwords must contain a letter, number, and punctuation character.\", \"detail\": \"The password provided is missing a punctuation character.\" }, { \"code\": \"226\", \"source\": { \"pointer\": \"/data/attributes/password\" }, \"title\": \"Password and password confirmation do not match.\" } ] } \n```\n\nNotice that this response includes not only the `errors` top-level member,\nbut the `jsonapi` top-level member. Error responses cannot contain the\ntop-level `data` member, but can include all the other top-level members\nJSON:API defines.\n\nAlso, notice that the third error object lacks a `detail` member (perhaps\nfor security). Again, all error object members are optional.\n\n### Advanced `source` Usage\n\nIn the example below, the user is sending an invalid JSON:API\nrequest, because it’s missing the `data` member:\n\n```\nPATCH /posts/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"datum\": [ ] } \n```\n\nTherefore, the server responds:\n\n```\nHTTP/1.1 422 Unprocesssable Entity Content-Type: application/vnd.api+json { \"errors\": [ { \"source\": { \"pointer\": \"\" }, \"detail\": \"Missing `data` Member at document's top level.\" } ] } \n```\n\nIt uses `source` to point to the top-level of the document (`\"\"`).\n(Pointing to “/” would be an appropriate reference to the string\n`\"some value\"` in the request document `{\"\": \"some value\"}`.\nPointing to `\"/data\"` would be invalid because the request document did\nnot have a value at `\"/data\"`, and `source` is always given with reference\nto the request document.)\n\nIf the server cannot parse the request as valid JSON, including\n`source` doesn’t make sense (because there’s no JSON document for `source` to\nrefer to). Here’s how the server might respond to an invalid JSON document:\n\n```\n{ \"errors\": [{ \"status\": \"400\", \"detail\": \"JSON parse error - Expecting property name at line 1 column 2 (char 1).\" }] } \n```\n\n#### Invalid Query Parameters\n\nThe `source` member can also be used to indicate that the error originated\nfrom a problem with a URI query parameter, like so:\n\n```\nGET /api/posts/1?include=author HTTP/1.1 \n```\n\n```\nHTTP/1.1 400 Bad Request Content-Type: application/vnd.api+json { \"errors\": [ { \"source\": { \"parameter\": \"include\" }, \"title\": \"Invalid Query Parameter\", \"detail\": \"The resource does not have an `author` relationship path.\" } ] } \n```\n\nIn most cases, JSON:API requires the server to return an error when it encounters\nan invalid value for a JSON:API–defined query parameter. However, for API-specific\nquery parameters (i.e. those not defined by JSON:API), a server may choose to\nignore an invalid parameter and have the request succeed, rather than respond with\nan error. [API-specific query parameters must contain one non a-z\ncharacter.](http://jsonapi.org/format/#query-parameters)\n\nOther examples of invalid parameters include: `?fields[people]=` (invalid parameter name;\nshould be `fields[people]`) and `?redirect_to=http%3A%2F%2Fwww.owasp.org` (invalid parameter,\nin this case, a phishing attack), etc.", "znaku_textu": 10836, "slov": 1520, "odkazu": 30, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/examples/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:42", "sha256": "3d78cf8a8a76ae04bdf82eac6c08e8163f8f89f8ec8aee44690789a8bc37d46e", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://tools.ietf.org/html/rfc6901", "http://stackoverflow.com/a/20215807/1261879", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/ext/atomic", "titulek": "JSON:API — Atomic Operations", "h1": "Atomic Operations", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Atomic Operations"}, {"uroven": 2, "text": "URI"}, {"uroven": 2, "text": "Namespace"}, {"uroven": 2, "text": "Document Structure"}, {"uroven": 3, "text": "Operation Objects"}, {"uroven": 3, "text": "Result Objects"}, {"uroven": 2, "text": "Processing"}, {"uroven": 3, "text": "Processing Errors"}, {"uroven": 3, "text": "Processing Specific Operations"}, {"uroven": 4, "text": "Creating Resources"}, {"uroven": 5, "text": "Responses"}, {"uroven": 4, "text": "Updating Resources"}, {"uroven": 5, "text": "Responses"}, {"uroven": 4, "text": "Deleting Resources"}, {"uroven": 5, "text": "Responses"}, {"uroven": 4, "text": "Updating To-One Relationships"}, {"uroven": 5, "text": "Responses"}, {"uroven": 4, "text": "Updating To-Many Relationships"}, {"uroven": 5, "text": "Responses"}, {"uroven": 3, "text": "Processing Multiple Operations"}], "markdown": "# Atomic Operations\n\nThis extension provides a means to perform multiple “operations” in a linear and\natomic manner. Operations are a serialized form of the mutations allowed in the\nbase JSON:API specification.\n\nClients can send an array of operations in a single request. This extension\nguarantees that those operations will be processed in order and will either\ncompletely succeed or fail together.\n\n## URI\n\nThis extension has the URI `https://jsonapi.org/ext/atomic`.\n\n## Namespace\n\nThis extension uses the namespace `atomic`.\n\n> Note: JSON:API extensions can only introduce new document members using a\n> reserved namespace as a prefix.\n\n## Document Structure\n\nA document that supports this extension **MAY** include any of the top-level\nmembers allowed by the base specification with the exception of `data` and\n`included`, which **MUST NOT** be included.\n\nIn addition, such a document **MAY** include either of the following members,\nbut not both:\n\n- `atomic:operations` - an array of one or more operation\nobjects.\n- `atomic:results` - an array of one or more result objects.\n\nIf either `atomic:operations` or `atomic:results` is present, the `errors`\nmember **MUST NOT** be included in the same document.\n\n### Operation Objects\n\nAn operation object **MUST** contain the following member:\n\n- `op`: an operation code, expressed as a string, that indicates the type of\noperation to perform. The value **MUST** be one of the following:\n - `\"add\"` : creates a new resource or relationship\n - `\"update\"` : updates a resource or relationship\n - `\"remove\"` : removes a resource or relationship\n\nAn operation object **MAY** contain either of the following members, but not\nboth, to specify the target of the operation:\n\n- `ref`: an object that **MUST** contain one of the following combinations of\nmembers:\n - `type` and `id` : to target an individual resource.\n - `type` and `lid` : to target an individual resource that has been assigned a\n local identity ( `lid` ) in a prior operation object.\n - `type` , `id` , and `relationship` : to target the relationship of an\n individual resource.\n - `type` , `lid` , and `relationship` : to target the relationship of an\n individual resource that has been assigned a local identity ( `lid` ) in a\n prior operation object.\n- `href`: a string that contains a URI-reference [[RFC3986 Section\n4.1](https://tools.ietf.org/html/rfc3986#section-4.1)] that identifies the\ntarget of the operation.\n\nSome specific types of operations require inclusion of `ref` or `href`, as\ndescribed below.\n\nAn operation object **MAY** also contain any of the following members:\n\n- `data`: the operation’s “primary data”.\n- `meta`: a meta object that contains non-standard\nmeta-information about the operation.\n\nDifferent members are required for processing different types of operations, as\ndescribed below.\n\n### Result Objects\n\nAn operation result object **MAY** contain any of the following members:\n\n- `data`: the “primary data” resulting from the operation.\n- `meta`: a meta object that contains non-standard\nmeta-information about the result.\n\nAn empty result object (`{}`) is acceptable for operations that are not required\nto return `data`.\n\n## Processing\n\nAll HTTP requests sent with this extension **MUST** be issued with `POST`.\n\nA server **MUST** perform operations in the order they appear in the\n`atomic:operations` array.\n\nA server **MUST** perform all operations atomically, so that a failure\nto perform any operation **MUST** invalidate any effects of preceding\noperations.\n\nA server **MUST** respond to a successful operations request with `200 OK` if a\nresponse document is returned. An array of result objects **MUST** be returned in a top-level `atomic:results` member. The results array\n**MUST** be the same length as the requested operations array and each result\n**MUST** correspond positionally to its associated operation.\n\nA server **MAY** respond to successful requests that include operations with\n`204 No Content` and no response document if no operations are required to\nreturn `data`.\n\n### Processing Errors\n\nIf any operation in a request fails, the server **MUST** respond as described\n[in the base specification](/format/#errors-processing). An array of one or\nmore [error objects](/format/#error-objects) **SHOULD** be returned, each with\na `source` member that contains a `pointer` to the source of the problem in the\nrequest document.\n\nIf a requested operation is malformed or incomplete, then a server **MUST**\nrespond with a `400 Bad Request` and **SHOULD** include a document with a\ntop-level `errors` member that contains an error object. The error object\n**SHOULD** include a `source` member with a `pointer` to the invalid operation.\n\nIf an operation is properly formed, but cannot be processed by a server, the\nserver **MUST** respond with a `400 Bad Request` or a more appropriate error\nresponse (e.g. `409 Conflict` or `422 Unprocessable Entity`) and **SHOULD**\ninclude a document with a top-level `errors` member that contains one or more\nerror objects that provide further details.\n\n### Processing Specific Operations\n\nThe following sections describe how to process specific operations.\n\n#### Creating Resources\n\nAn operation that creates a resource **MAY** target a resource collection\nthrough the operation’s `href` member.\n\nThe operation **MUST** include an `op` code of `\"add\"` as well as a resource\nobject as `data`. The resource object **MUST** contain at least a `type` member.\n\nFor example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"add\", \"href\": \"/blogPosts\", \"data\": { \"type\": \"articles\", \"attributes\": { \"title\": \"JSON API paints my bikeshed!\" } } }] } \n```\n\nNote that `href` is used in this example to target a resource collection,\n`blogPosts` in this case, that is distinct from the `type` of the resource.\nThe usage of `href` is entirely optional for this extension, but could be\nrequired by an individual implementation.\n\n##### Responses\n\nIf the server is able to create a resource with a client-generated ID and its\nrepresentation would be identical to the resource in the operation, then the\nserver **MAY** return a result with no `data` member or it **MAY** return a\nresult that contains the created resource as `data`.\n\nIn all other cases in which the server is able to successfully create the\nresource, the server **MUST** return a result that contains the created resource\nas `data`.\n\nFor example:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:results\": [{ \"data\": { \"links\": { \"self\": \"http://example.com/blogPosts/13\" }, \"type\": \"articles\", \"id\": \"13\", \"attributes\": { \"title\": \"JSON API paints my bikeshed!\" } } }] } \n```\n\nIf the server is unable to create the resource, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n#### Updating Resources\n\nAn operation that updates a resource **MAY** target that resource through the\noperation’s `ref` or `href` members, but not both.\n\nThe operation **MUST** include an `op` code of `\"update\"`.\n\nFor example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"update\", \"data\": { \"type\": \"articles\", \"id\": \"13\", \"attributes\": { \"title\": \"To TDD or Not\" } } }] } \n```\n\n##### Responses\n\nIf a server accepts an update but also changes the resource in ways other than\nthose specified by the request (for example, updating the `updatedAt` attribute\nor a computed `sha`), then the server **MUST** return a result that includes a\nrepresentation of the updated resource as `data`.\n\nIf a server accepts an update and doesn’t update any fields besides those\nprovided, the server **MUST** return a result that includes either no `data` or\na representation of the resource as `data` or, if all results are empty, the\nserver **MAY** respond with `204 No Content` and no document.\n\nIf a server is unable to update the resource, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n#### Deleting Resources\n\nAn operation that deletes a resource **MUST** target that resource through the\noperation’s `ref` or `href` members, but not both.\n\nThe operation **MUST** include an `op` code of `\"remove\"`.\n\nFor example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"remove\", \"ref\": { \"type\": \"articles\", \"id\": \"13\" } }] } \n```\n\n##### Responses\n\nIf a server is able to delete the resource, the server **MUST** return a result\nwith no `data` or, if all results are empty, the server **MAY** respond with\n`204 No Content` and no document.\n\nIf a server is unable to delete the resource, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n#### Updating To-One Relationships\n\nAn operation that updates a resource’s to-one relationship **MUST** target that\nrelationship through the operation’s `ref` or `href` members, but not both.\n\nThe operation **MUST** include an `op` code of `\"update\"`.\n\nFor example, the following request assigns a to-one relationship:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"update\", \"ref\": { \"type\": \"articles\", \"id\": \"13\", \"relationship\": \"author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }] } \n```\n\nAnd the following request clears a to-one relationship:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"update\", \"ref\": { \"type\": \"articles\", \"id\": \"13\", \"relationship\": \"author\" }, \"data\": null }] } \n```\n\n##### Responses\n\nIf a server is able to update the relationship, the server **MUST** return a\nresult with no `data` or, if all results are empty, the server **MAY** respond\nwith `204 No Content` and no document.\n\nIf a server is unable to update the relationship, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n#### Updating To-Many Relationships\n\nAn operation that updates a resource’s to-many relationship **MUST** target that\nrelationship through the operation’s `ref` or `href` members, but not both.\n\nTo add members to a to-many relationship, the operation **MUST** include an\n`op` code of `\"add\"`. For example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"add\", \"ref\": { \"type\": \"articles\", \"id\": \"1\", \"relationship\": \"comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"123\" } ] }] } \n```\n\nTo replace all the members of a to-many relationship, the operation **MUST**\ninclude an `op` code of `\"update\"`. For example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"update\", \"ref\": { \"type\": \"articles\", \"id\": \"1\", \"relationship\": \"tags\" }, \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] }] } \n```\n\nTo remove members from a to-many relationship, the operation **MUST** include an\n`op` code of `\"remove\"`. For example:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"remove\", \"ref\": { \"type\": \"articles\", \"id\": \"1\", \"relationship\": \"comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"12\" }, { \"type\": \"comments\", \"id\": \"13\" } ] }] } \n```\n\n##### Responses\n\nIf a server is able to update the relationship, the server **MUST** return a\nresult with no `data` or, if all results are empty, the server **MAY** respond\nwith `204 No Content` and no document.\n\nIf a server is unable to update the relationship, an appropriate error response\n**MUST** be returned and a response document **SHOULD** be returned that\ncontains a top-level `errors` as described above.\n\n### Processing Multiple Operations\n\nThe above examples all perform a single operation that aligns with an equivalent\nsingular request from the base spec. Yet, the primary value of this extension is\nthat unlocks the ability to perform more than one action linearly and\natomically.\n\nThe following example adds two resources and creates a relationship between them\nin a single request:\n\n```\nPOST /operations HTTP/1.1 Host: example.org Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" Accept: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:operations\": [{ \"op\": \"add\", \"data\": { \"type\": \"authors\", \"id\": \"acb2ebd6-ed30-4877-80ce-52a14d77d470\", \"attributes\": { \"name\": \"dgeb\" } } }, { \"op\": \"add\", \"data\": { \"type\": \"articles\", \"id\": \"bb3ad581-806f-4237-b748-f2ea0261845c\", \"attributes\": { \"title\": \"JSON API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"authors\", \"id\": \"acb2ebd6-ed30-4877-80ce-52a14d77d470\" } } } } }] } \n```\n\nA server might respond to this request as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/atomic\" { \"atomic:results\": [{ \"data\": { \"links\": { \"self\": \"http://example.com/authors/acb2ebd6-ed30-4877-80ce-52a14d77d470\" }, \"type\": \"authors\", \"id\": \"acb2ebd6-ed30-4877-80ce-52a14d77d470\", \"attributes\": { \"name\": \"dgeb\" } } }, { \"data\": { \"links\": { \"self\": \"http://example.com/articles/bb3ad581-806f-4237-b748-f2ea0261845c\" }, \"type\": \"articles\", \"id\": \"bb3ad581-806f-4237-b748-f2ea0261845c\", \"attributes\": { \"title\": \"JSON API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/bb3ad581-806f-4237-b748-f2ea0261845c/relationships/author\", \"related\": \"http://example.com/articles/bb3ad581-806f-4237-b748-f2ea0261845c/author\" } } } } }] } \n```\n\n> Note that this operations request could also have been structured to add the\n> author, then add the article, then add the relationship between them.\n\n> Also note that local identities, i.e. `lid` members, are particularly useful\n> for requests that involve multiple operations. Local identities can be used to\n> associate resources that have not yet been assigned an `id`.", "znaku_textu": 14528, "slov": 2129, "odkazu": 27, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/ext/atomic", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:47", "sha256": "c096bba0bb23799f31e65a7a9dca3379b643c0ae73ee49757a743fd883c52a5a", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://tools.ietf.org/html/rfc3986", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/extensions/", "titulek": "JSON:API — Extensions and Profiles", "h1": "Extensions and Profiles", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Extensions and Profiles"}, {"uroven": 2, "text": "Extensions"}, {"uroven": 2, "text": "Profiles"}], "markdown": "# Extensions and Profiles\n\nThe JSON:API specification provides a way to define new functionality not\nprovided by the base specification using [extensions](/format/#extensions). Additionally, it\nprovides a means to share a particular usage of the specification among\nimplementations using [profiles](/format/#profiles).\n\nGenerally speaking, extensions provide a means to standardize a functionality\nthat is not so widely needed that it should be part of the base specification\nbut is general enough that it would benefit the community to have a standard.\nTypically, that functionality is also too difficult and/or unconventional to\nimplement using only the parts of the specification that are reserved for\nimplementations (e.g. implementations can add their own members to\n[`attributes`](/format/#document-resource-object-attributes) objects, but can’t add new members to a resource\nidentifier).\n\nProfiles, on the other hand, are a way to standardize common usages of the base\nspecification that *are* simple to implement using only the parts of the\nspecification that are reserved for implementations (e.g. a common way to\nhandle [pagination](/format/#fetching-pagination)).\n\nOne major difference between extensions and profiles is that an extension must\nbe agreed upon and understood by both the client and the server, while a\nprofile can be safely ignored if either the client or the server does not\nrecognize it.\n\nSome useful extensions and profiles are listed below. However, an extension or\nprofile does not need to appear below to be valid. Anyone can author and host\nan extension or profile document using their own domain for its URI.\n\nIn order to keep the promise of JSON:API as an anti-bikeshedding tool,\nimplementors are **strongly** encouraged to reuse, improve, and collaborate on\ncommon extensions and profiles instead of creating new extensions and profiles\nbecause of trivial or aesthetic differences.\n\nThe extensions and profiles listed on this page have been reviewed by the\nJSON:API specification [editors](/about/#editors) and are considered:\n\n- Compatible with the base specification\n- Able to evolve without backward incompatibilities\n- Broadly useful\n\nNot every extension or profile can or should appear on this page. This listing\nis maintained on a best-effort basis.\n\n## Extensions\n\n- [Atomic Operations](/ext/atomic)\n - URI: `https://jsonapi.org/ext/atomic`\n - Namespace: `atomic`\n - Description: This extension provides a means to perform multiple\n “operations” in a linear and atomic manner.\n\n## Profiles\n\n- [Cursor Pagination](/profiles/ethanresnick/cursor-pagination)\n - URI: `https://jsonapi.org/profiles/ethanresnick/cursor-pagination`\n - Description: Cursor-based pagination (aka keyset pagination) is a\n common pagination strategy that avoids many of the pitfalls of\n “offset–limit” pagination.", "znaku_textu": 2785, "slov": 395, "odkazu": 24, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/extensions/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:40", "sha256": "8216b8f4ed9573e3e2797e1bf4131950329793dffeb0865c11c805cf3c3e9d36", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/faq/", "titulek": "JSON:API — Frequently Asked Questions", "h1": "Frequently Asked Questions", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Frequently Asked Questions"}, {"uroven": 2, "text": "What is the meaning of JSON:API’s version?"}, {"uroven": 2, "text": "Why not use the HAL specification?"}, {"uroven": 2, "text": "How can I discover a resource’s supported actions?"}, {"uroven": 2, "text": "Where’s PUT?"}, {"uroven": 2, "text": "Is there a JSON Schema describing JSON:API?"}, {"uroven": 2, "text": "Why are resource collections returned as arrays instead of sets keyed by ID?"}, {"uroven": 2, "text": "Does JSON:API take any position on URI structure, on rules for custom endpoints, which do not fit the paradigm of GET/POST/PATCH/DELETE on the resource URI, etc.?"}], "markdown": "# Frequently Asked Questions\n\n## What is the meaning of JSON:API’s version?\n\nNow that JSON:API has reached a stable version 1.0, it will always be\nbackwards compatible using a *never remove, only add* strategy.\n\nA version is maintained in order to:\n\n- allow tracking of additive changes to the specification.\n- know what features a particular implementation *may potentially* support.\n\n## Why not use the HAL specification?\n\nThere are several reasons:\n\n- HAL embeds child documents recursively, while JSON:API flattens the entire\ngraph of objects at the top level. This means that if the same “people” are\nreferenced from different kinds of objects (say, the author of both posts and\ncomments), this format ensures that there is only a single representation of\neach person document in the payload.\n- Similarly, JSON:API uses IDs for linkage, which makes it possible to cache\ndocuments from compound responses and then limit subsequent requests to only\nthe documents that aren’t already present locally. If you’re lucky, this can\neven completely eliminate HTTP requests.\n- HAL is a serialization format, but says nothing about how to update\ndocuments. JSON:API thinks through how to update existing records (leaning on\nPATCH and JSON Patch), and how those updates interact with compound documents\nreturned from GET requests. It also describes how to create and delete\ndocuments, and what 200 and 204 responses from those updates mean.\n\nIn short, JSON:API is an attempt to formalize similar ad hoc client-server\ninterfaces that use JSON as an interchange format. It is specifically focused\naround using those APIs with a smart client that knows how to cache documents it\nhas already seen and avoid asking for them again.\n\nIt is extracted from a real-world library already used by a number of projects,\nwhich has informed both the request/response aspects (absent from HAL) and the\ninterchange format itself.\n\n## How can I discover a resource’s supported actions?\n\nWhenever a client requests a URI, the server can include an [`Allow` header](https://tools.ietf.org/html/rfc7231#section-7.4.1)\nin its response to indicate the methods the requested resource supports. Servers\nwishing to support method discovery should include this header. The client can\nthen send a [`HEAD`](https://tools.ietf.org/html/rfc7231#section-4.3.2) request\n(or any other type of request) to the URI in order to discover its supported methods.\n\nFor instance, a client might request `HEAD /articles`, and the response could\ncontain the header `Allow: GET,POST`, indicating that the client can GET the\ncollection and also POST to it to create new resources.\n\nJSON:API is still working on a way for resources to advertise and detail\nnon-standard actions they support. Feel free to\n[join that discussion](https://github.com/json-api/json-api/issues/745)!\n\n## Where’s PUT?\n\nUsing PUT to partially update a resource (i.e. to change only some of its state)\nis not allowed by the\n[HTTP specification](https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.4).\nInstead, PUT is supposed to completely replace the state of a resource:\n\n> “The PUT method requests that the state of the target resource be **created\n> or replaced** with the state…in the request message payload. A successful PUT\n> of a given representation would suggest that a subsequent GET on that same\n> target resource will result in an equivalent representation being sent…”\n\nThe correct method for partial updates, therefore, is [PATCH](https://datatracker.ietf.org/doc/html/rfc5789),\nwhich is what JSON:API uses. And because PATCH can also be used compliantly for\nfull resource replacement, JSON:API hasn’t needed to define any behavior for\nPUT so far. However, it may define PUT semantics in the future.\n\nIn the past, many APIs used PUT for partial updates because PATCH wasn’t yet\nwell-supported. However, almost all clients now support PATCH, and those that\ndon’t can be easily [worked around](/recommendations/#patchless-clients).\n\n## Is there a JSON Schema describing JSON:API?\n\nYes, you can find the JSON Schema definition at\n[http://jsonapi.org/schema](http://jsonapi.org/schema). This schema is as\nrestrictive as possible, but has flexibility to be extended within your\ndocumentation. Validation will not yield false negatives, but could yield false\npositives for the sake of flexibility.\n\nYou can find more information about the JSON Schema format at\n[http://json-schema.org](http://json-schema.org).\n\n## Why are resource collections returned as arrays instead of sets keyed by ID?\n\nA JSON array is naturally ordered while sets require metadata to specify order\namong members. Therefore, arrays allow for more natural sorting by default or\nspecified criteria.\n\nPrimary resources should be isolated because their order and number is often\nsignificant. It’s necessary to separate primary and related resources by more\nthan type because it’s possible that a primary resource may have related\nresources of the same type (e.g. the “parents” of a “person”). Nesting related\nresources in `included` prevents this possible conflict.\n\n## Does JSON:API take any position on URI structure, on rules for custom endpoints, which do not fit the paradigm of GET/POST/PATCH/DELETE on the resource URI, etc.?\n\nJSON:API has no requirements about URI structure, implementations are free to use whatever form they wish.", "znaku_textu": 5281, "slov": 800, "odkazu": 31, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/faq/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:44", "sha256": "35cdbe7867d6a7d4563b907b89849c5c9636118a4549cf618310cf72db5c0545", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://tools.ietf.org/html/rfc7231", "https://github.com/json-api/json-api/issues/745", "https://datatracker.ietf.org/doc/html/rfc7231", "https://datatracker.ietf.org/doc/html/rfc5789", "http://json-schema.org/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/format", "titulek": "JSON:API — Latest Specification (v1.1)", "h1": "Latest Specification (v1.1)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Latest Specification (v1.1)"}, {"uroven": 2, "text": "Status"}, {"uroven": 2, "text": "Introduction"}, {"uroven": 2, "text": "Semantics"}, {"uroven": 2, "text": "Conventions"}, {"uroven": 2, "text": "The JSON:API Media Type"}, {"uroven": 3, "text": "Media Type Parameters"}, {"uroven": 3, "text": "Extensions"}, {"uroven": 3, "text": "Profiles"}, {"uroven": 3, "text": "Rules for Media Type Parameters"}, {"uroven": 4, "text": "Rules for Extensions"}, {"uroven": 4, "text": "Rules for Profiles"}, {"uroven": 2, "text": "Content Negotiation"}, {"uroven": 3, "text": "Universal Responsibilities"}, {"uroven": 3, "text": "Client Responsibilities"}, {"uroven": 3, "text": "Server Responsibilities"}, {"uroven": 2, "text": "Document Structure"}, {"uroven": 3, "text": "Top Level"}, {"uroven": 3, "text": "Resource Objects"}, {"uroven": 4, "text": "Identification"}, {"uroven": 4, "text": "Fields"}, {"uroven": 5, "text": "Attributes"}, {"uroven": 5, "text": "Relationships"}, {"uroven": 5, "text": "Resource Linkage"}, {"uroven": 4, "text": "Resource Links"}, {"uroven": 3, "text": "Resource Identifier Objects"}, {"uroven": 3, "text": "Compound Documents"}, {"uroven": 3, "text": "Meta Information"}, {"uroven": 3, "text": "Links"}, {"uroven": 4, "text": "Link objects"}, {"uroven": 3, "text": "JSON:API Object"}, {"uroven": 3, "text": "Member Names"}, {"uroven": 4, "text": "Allowed Characters"}, {"uroven": 4, "text": "Reserved Characters"}, {"uroven": 4, "text": "@-Members"}, {"uroven": 4, "text": "Extension Members"}, {"uroven": 2, "text": "Fetching Data"}, {"uroven": 3, "text": "Fetching Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Fetching Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Sparse Fieldsets"}, {"uroven": 3, "text": "Sorting"}, {"uroven": 3, "text": "Filtering"}, {"uroven": 2, "text": "Creating, Updating and Deleting Resources"}, {"uroven": 3, "text": "Creating Resources"}, {"uroven": 4, "text": "Client-Generated IDs"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "201 Created"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Resources"}, {"uroven": 4, "text": "Updating a Resource’s Attributes"}, {"uroven": 4, "text": "Updating a Resource’s Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Relationships"}, {"uroven": 4, "text": "Updating To-One Relationships"}, {"uroven": 4, "text": "Updating To-Many Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Deleting Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "404 NOT FOUND"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 2, "text": "Query Parameters"}, {"uroven": 3, "text": "Query Parameter Families"}, {"uroven": 3, "text": "Extension-Specific Query Parameters"}, {"uroven": 3, "text": "Implementation-Specific Query Parameters"}, {"uroven": 2, "text": "Errors"}, {"uroven": 3, "text": "Processing Errors"}, {"uroven": 3, "text": "Error Objects"}, {"uroven": 2, "text": "Appendix"}, {"uroven": 3, "text": "Query Parameters Details"}, {"uroven": 4, "text": "Parsing/Serialization"}, {"uroven": 4, "text": "Square Brackets in Parameter Names"}], "markdown": "# Latest Specification (v1.1)\n\n## Status\n\nThis page presents the latest published version of JSON:API, which is\n currently version 1.1. New versions of JSON:API **will\n always be backwards compatible** using a *never remove, only add* strategy.\n Additions can be proposed in our [discussion forum](http://discuss.jsonapi.org/).\n\nIf you catch an error in the specification’s text, or if you write an\n implementation, please let us know by opening an issue or pull request at our\n [GitHub repository](https://github.com/json-api/json-api).\n\n## Introduction\n\nJSON:API is a specification for how a client should request that resources be\nfetched or modified, and how a server should respond to those requests. JSON:API\ncan be easily extended with extensions and profiles.\n\nJSON:API is designed to minimize both the number of requests and the amount of\ndata transmitted between clients and servers. This efficiency is achieved\nwithout compromising readability, flexibility, or discoverability.\n\nJSON:API requires use of the JSON:API media type\n([`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json))\nfor exchanging data.\n\n## Semantics\n\nAll document members, query parameters, and processing rules defined by\nthis specification are collectively called “specification semantics”.\n\nCertain document members, query parameters, and processing rules are reserved\nfor implementors to define at their discretion. These are called “implementation\nsemantics”.\n\nAll other semantics are reserved for potential future use by this specification.\n\n## Conventions\n\nThe key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,\n“SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this\ndocument are to be interpreted as described in\n[BCP 14](https://tools.ietf.org/html/bcp14)\n[[RFC2119](https://tools.ietf.org/html/rfc2119)]\n[[RFC8174](https://tools.ietf.org/html/rfc8174)]\nwhen, and only when, they appear in all capitals, as shown here.\n\n## The JSON:API Media Type\n\nThe JSON:API media type is\n[`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).\n\n### Media Type Parameters\n\nThe JSON:API specification supports two media type parameters: `ext` and\n`profile`, which are used to specify extensions and profiles, respectively.\n\n> Note: A media type parameter is an extra piece of information that can\n> accompany a media type. For example, in the header\n> `Content-Type: text/html;charset=\"utf-8\"`, the media type is `text/html` and\n> `charset` is a parameter.\n\n### Extensions\n\nExtensions provide a means to “extend” the base specification by defining\nadditional specification semantics.\n\nExtensions cannot alter or remove specification semantics, nor can they specify\nimplementation semantics.\n\n### Profiles\n\nProfiles provide a means to share a particular usage of the specification among\nimplementations.\n\nProfiles can specify implementation semantics, but cannot alter,\nadd to, or remove specification semantics.\n\n### Rules for Media Type Parameters\n\nThe JSON:API media type **MUST NOT** be specified with any media type parameters\nother than `ext` and `profile`. The `ext` parameter is used to support\nextensions and the `profile` parameter is used to support profiles.\n\nExtensions and profiles are each uniquely identified by a\n[URI](https://tools.ietf.org/html/rfc3986). Visiting an extension’s or a\nprofile’s URI **SHOULD** return documentation that describes its usage. The\nvalues of the `ext` and `profile` parameters **MUST** equal a space-separated\n(U+0020 SPACE, “ “) list of extension or profile URIs, respectively.\n\n> Note: When serializing the `ext` or `profile` media type parameters, the HTTP\n> specification requires that parameter values be surrounded by quotation marks\n> (U+0022 QUOTATION MARK, “\"”).\n\n#### Rules for Extensions\n\nAn extension **MAY** impose additional processing rules or further restrictions\nand it **MAY** define new object members as described below.\n\nAn extension **MUST NOT** lessen or remove any processing rules, restrictions or\nobject member requirements defined in this specification or other extensions.\n\nAn extension **MAY** define new members within the document structure defined by\nthis specification. The rules for extension member names are covered\nbelow.\n\nAn extension **MAY** define new query parameters. The rules for extension-defined\nquery parameters are covered below.\n\nWhen an extension defines new query parameters or document members, the\nextension **MUST** define a namespace to guarantee that extensions will never\nconflict with current or future versions of this specification. A namespace\n**MUST** meet all of the following conditions:\n\n- A namespace **MUST** contain at least one character.\n- A namespace **MUST** contain only these characters:\n - U+0061 to U+007A, “a-z”\n - U+0041 to U+005A, “A-Z”\n - U+0030 to U+0039, “0-9”\n\nAn extension **MUST NOT** define more than one namespace. The namespace used for\nall query parameters and document members **MUST** be the same for any given\nextension.\n\nIn the following example, an extension with the namespace `version` has\nspecified a resource object member `version:id` to support per-resource\nversioning. This member might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/version\" // ... { \"type\": \"articles\", \"id\": \"1\", \"version:id\": \"42\", \"attributes\": { \"title\": \"Rails is Omakase\" } } // ... \n```\n\n#### Rules for Profiles\n\nThe rules for profile usage are dictated by [RFC\n6906](https://tools.ietf.org/html/rfc6906).\n\nA profile **MAY** define document members and processing rules that are reserved\nfor implementors.\n\nA profile **MUST NOT** define any query parameters except implementation-specific query parameters.\n\nA profile **MUST NOT** alter or remove processing rules that have been defined\nby this specification or by an extension. However, a profile\n**MAY** define processing rules for query parameters whose processing rules\nhave been reserved for implementors to define at their discretion.\n\nFor example, a profile could define rules for interpreting the `filter` query\nparameter, but it could not specify that relationship\nnames in the `include` query parameter are\nspace-separated instead of dot-separated.\n\nUnlike extensions, profiles do not need to define a namespace for document\nmembers because profiles cannot define specification semantics and thus cannot\nconflict with current or future versions of this specification. However, it is\npossible for profiles to conflict with other profiles. Therefore, it is the\nresponsibility of implementors to ensure that they do not support conflicting\nprofiles.\n\nIn the following example, a profile has defined a `timestamps` attribute. According to the profile, the attribute must be an\nobject containing a `created` member and a `modified` member and these members’\nvalues must use the [RFC 3339](https://tools.ietf.org/html/rfc3339) format.\nWith such a profile applied, a response might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;profile=\"https://example.com/resource-timestamps\" // ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\", \"timestamps\": { \"created\": \"2020-07-21T12:09:00Z\", \"modified\": \"2020-07-30T10:19:01Z\" } } } // ... \n```\n\n## Content Negotiation\n\n### Universal Responsibilities\n\nClients and servers **MUST** send all JSON:API payloads using the JSON:API media\ntype in the `Content-Type` header.\n\nClients and servers **MUST** specify the `ext` media type parameter in the\n`Content-Type` header when they have applied one or more extensions to a\nJSON:API document.\n\nClients and servers **MUST** specify the `profile` media type parameters in the\n`Content-Type` header when they have applied one or more profiles to a JSON:API\ndocument.\n\n### Client Responsibilities\n\nWhen processing a JSON:API response document, clients **MUST** ignore any\nparameters other than `ext` and `profile` parameters in the server’s\n`Content-Type` header.\n\nA client **MAY** use the `ext` media type parameter in an `Accept` header to\nrequire that a server apply all the specified extensions to the response\ndocument.\n\nA client **MAY** use the `profile` media type parameter in an `Accept` header\nto request that the server apply one or more profiles to the response document.\n\n> Note: A client is allowed to send more than one acceptable media type in the\n> `Accept` header, including multiple instances of the JSON:API media type. This\n> allows clients to request different combinations of the `ext` and `profile`\n> media type parameters. A client can use [quality values](https://tools.ietf.org/html/rfc7231#section-5.3.2)\n> to indicate that some combinations are less preferable than others. Media types\n> specified without a qvalue are equally preferable to each other, regardless of\n> their order, and are always considered more preferable than a media type with a\n> qvalue less than 1.\n\n### Server Responsibilities\n\nIf a request specifies the `Content-Type` header with the JSON:API media type,\nservers **MUST** respond with a `415 Unsupported Media Type` status code if\nthat media type contains any media type parameters other than `ext` or\n`profile`.\n\nIf a request specifies the `Content-Type` header with an instance of\nthe JSON:API media type modified by the `ext` media type parameter and that\nparameter contains an unsupported extension URI, the server **MUST** respond\nwith a `415 Unsupported Media Type` status code.\n\n> Note: JSON:API servers that do not support version 1.1 of this specification\n> will respond with a `415 Unsupported Media Type` client error if the `ext` or\n> `profile` media type parameter is present.\n\nIf a request’s `Accept` header contains an instance of the JSON:API media type,\nservers **MUST** ignore instances of that media type which are modified by a\nmedia type parameter other than `ext` or `profile`. If all instances of that\nmedia type are modified with a media type parameter other than `ext` or `profile`,\nservers **MUST** respond with a `406 Not Acceptable` status code. If every\ninstance of that media type is modified by the `ext` parameter and each contains\nat least one unsupported extension URI, the server **MUST** also respond with a\n`406 Not Acceptable`.\n\nIf the `profile` parameter is received, a server **SHOULD** attempt to apply any\nrequested profile(s) to its response. A server **MUST** ignore any profiles\nthat it does not recognize.\n\n> Note: The above rules guarantee strict agreement on extensions between the\n> client and server, while the application of profiles is left to the discretion\n> of the server.\n\nServers that support the `ext` or `profile` media type parameters **SHOULD**\nspecify the `Vary` header with `Accept` as one of its values. This applies to\nresponses with and without any profiles or extensions applied.\n\n> Note: Some HTTP intermediaries (e.g. CDNs) may ignore the `Vary` header\n> unless specifically configured to respect it.\n\n## Document Structure\n\nThis section describes the structure of a JSON:API document, which is identified\nby the JSON:API media type. JSON:API documents are\ndefined in JavaScript Object Notation (JSON) [[RFC8259](http://tools.ietf.org/html/rfc8259)].\n\nAlthough the same media type is used for both request and response documents,\ncertain aspects are only applicable to one or the other. These differences are\ncalled out below.\n\nExtensions **MAY** define new members within the document structure. These\nmembers **MUST** comply with the naming requirements specified\nbelow.\n\nUnless otherwise noted, objects defined by this specification or any applied\nextensions **MUST NOT** contain any additional members. Client and server\nimplementations **MUST** ignore non-compliant members.\n\n> Note: These conditions allow this specification to evolve through additive\n> changes.\n\n### Top Level\n\nA JSON object **MUST** be at the root of every JSON:API request and response\ndocument containing data. This object defines a document’s “top level”.\n\nA document **MUST** contain at least one of the following top-level members:\n\n- `data` : the document’s “primary data”.\n- `errors` : an array of error objects .\n- `meta` : a meta object that contains non-standard\nmeta-information.\n- a member defined by an applied extension .\n\nThe members `data` and `errors` **MUST NOT** coexist in the same document.\n\nA document **MAY** contain any of these top-level members:\n\n- `jsonapi` : an object describing the server’s implementation.\n- `links` : a links object related to the document as a whole.\n- `included` : an array of resource objects that are related to the primary\ndata and/or each other (“included resources”).\n\nIf a document does not contain a top-level `data` key, the `included` member\n**MUST NOT** be present either.\n\nThe top-level links object **MAY** contain the following members:\n\n- `self` : the link that generated the current response document. If a\ndocument has extensions or profiles applied to it, this link **SHOULD** be\nrepresented by a link object with the `type` target attribute specifying the\nJSON:API media type with all applicable parameters.\n- `related` : a related resource link when the primary data represents a\nresource relationship.\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the current document.\n- pagination links for the primary data.\n\n> Note: The `self` link in the top-level `links` object allows a client to\n> refresh the data represented by the current response document. The client\n> should be able to use the provided link without applying any additional\n> information. Therefore the link must contain the query parameters provided\n> by the client to generate the response document. This includes but is not\n> limited to query parameters used for inclusion of related resources,\n> sparse fieldsets, sorting,\n> pagination and filtering.\n\nThe document’s “primary data” is a representation of the resource or collection\nof resources targeted by a request.\n\nPrimary data **MUST** be either:\n\n- a single resource object , a single resource identifier object , or `null` ,\nfor requests that target single resources\n- an array of resource objects , an array of resource identifier objects , or\nan empty array ( `[]` ), for requests that target resource collections\n\nFor example, the following primary data is a single resource object:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { // ... this article's attributes }, \"relationships\": { // ... this article's relationships } } } \n```\n\nThe following primary data is a single resource identifier object that\nreferences the same resource:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\" } } \n```\n\nA logical collection of resources **MUST** be represented as an array, even if\nit only contains one item or is empty.\n\n### Resource Objects\n\n“Resource objects” appear in a JSON:API document to represent resources.\n\nA resource object **MUST** contain at least the following top-level members:\n\n- `id`\n- `type`\n\nException: The `id` member is not required when the resource object originates\nat the client and represents a new resource to be created on the server. In that\ncase, a client **MAY** include a `lid` member to uniquely identify the resource\nby `type` *locally* within the document.\n\nIn addition, a resource object **MAY** contain any of these top-level members:\n\n- `attributes` : an attributes object representing some of the resource’s data.\n- `relationships` : a relationships object describing relationships between\n the resource and other JSON:API resources.\n- `links` : a links object containing links related to the resource.\n- `meta` : a meta object containing non-standard meta-information about a\nresource that can not be represented as an attribute or relationship.\n\nHere’s how an article (i.e. a resource of type “articles”) might appear in a document:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } // ... \n```\n\n#### Identification\n\nAs noted above, every resource object **MUST** contain a\n`type` member. Every resource object **MUST** also contain an `id` member,\nexcept when the resource object originates at the client and represents a new\nresource to be created on the server. If `id` is omitted due to this exception,\na `lid` member **MAY** be included to uniquely identify the resource by `type` *locally* within the document. The value of the `lid` member **MUST** be\nidentical for every representation of the resource in the document, including\nresource identifier objects.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nWithin a given API, each resource object’s `type` and `id` pair **MUST**\nidentify a single, unique resource. (The set of URIs controlled by a server,\nor multiple servers acting as one, constitute an API.)\n\nThe `type` member is used to describe resource objects that share common\nattributes and relationships.\n\nThe values of `type` members **MUST** adhere to the same constraints as\nmember names.\n\n> Note: This spec is agnostic about inflection rules, so the value of `type`\n> can be either plural or singular. However, the same value should be used\n> consistently throughout an implementation.\n\n#### Fields\n\nA resource object’s attributes and its relationships are collectively called\nits “fields”.\n\nFields for a resource object **MUST** share a common namespace with each\nother and with `type` and `id`. In other words, a resource can not have an\nattribute and relationship with the same name, nor can it have an attribute\nor relationship named `type` or `id`.\n\n##### Attributes\n\nThe value of the `attributes` key **MUST** be an object (an “attributes\nobject”). Members of the attributes object (“attributes”) represent information\nabout the resource object in which it’s defined.\n\nAttributes may contain any valid JSON value, including complex data structures\ninvolving JSON objects and arrays.\n\nKeys that reference related resources (e.g. `author_id`) **SHOULD NOT** appear\nas attributes. Instead, relationships **SHOULD** be used.\n\n> Note: See fields and member names for more restrictions on this container.\n\n##### Relationships\n\nThe value of the `relationships` key **MUST** be an object (a “relationships\nobject”). Each member of a relationships object represents\na “relationship” from the resource object\nin which it has been defined to other resource objects.\n\nRelationships may be to-one or to-many.\n\nA relationship’s name is given by its key. The value at that key **MUST** be an\nobject (“relationship object”).\n\nA “relationship object” **MUST** contain at least one of the following:\n\n- `links` : a links object containing at least one of the following:\n - `self` : a link for the relationship itself (a “relationship link”). This\n link allows the client to directly manipulate the relationship. For example,\n removing an `author` through an `article` ’s relationship URL would disconnect\n the person from the `article` without deleting the `people` resource itself.\n When fetched successfully, this link returns the linkage for the related resources as its primary data.\n (See Fetching Relationships .)\n - `related` : a related resource link\n - a member defined by an applied extension .\n- `data` : resource linkage\n- `meta` : a meta object that contains non-standard meta-information about the\nrelationship.\n- a member defined by an applied extension .\n\nA relationship object that represents a to-many relationship **MAY** also contain\npagination links under the `links` member, as described below. Any\npagination links in a relationship object **MUST** paginate the relationship\ndata, not the related resources.\n\n> Note: See fields and member names for more restrictions on this container.\n\nA “related resource link” provides access to resource objects linked\nin a relationship. When fetched, the related resource object(s)\nare returned as the response’s primary data.\n\nFor example, an `article`’s `comments` relationship could\nspecify a link that returns a collection of comment resource objects\nwhen retrieved through a `GET` request.\n\nIf present, a related resource link **MUST** reference a valid URL, even if the\nrelationship isn’t currently associated with any target resources. Additionally,\na related resource link **MUST NOT** change because its relationship’s content\nchanges.\n\n##### Resource Linkage\n\nResource linkage in a compound document allows a client to link together all\nof the included resource objects without having to `GET` any URLs via links.\n\nResource linkage **MUST** be represented as one of the following:\n\n- `null` for empty to-one relationships.\n- an empty array ( `[]` ) for empty to-many relationships.\n- a single resource identifier object for non-empty to-one relationships.\n- an array of resource identifier objects for non-empty to-many relationships.\n\n> Note: The spec does not impart meaning to order of resource identifier\n> objects in linkage arrays of to-many relationships, although implementations\n> may do that. Arrays of resource identifier objects may represent ordered\n> or unordered relationships, and both types can be mixed in one response\n> object.\n\nFor example, the following article is associated with an `author`:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nThe `author` relationship includes a link for the relationship itself (which\nallows the client to change the related author directly), a related resource\nlink to fetch the resource objects, and linkage information.\n\n#### Resource Links\n\nThe optional `links` member within each resource object contains links\nrelated to the resource.\n\nIf present, this links object **MAY** contain a `self` link that\nidentifies the resource represented by the resource object.\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nA server **MUST** respond to a `GET` request to the specified URL with a\nresponse that includes the resource as the primary data.\n\n### Resource Identifier Objects\n\nA “resource identifier object” is an object that identifies an individual\nresource.\n\nA “resource identifier object” **MUST** contain a `type` member. It **MUST**\nalso contain an `id` member, except when it represents a new resource to be\ncreated on the server. In this case, a `lid` member **MUST** be included that\nidentifies the new resource.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nA “resource identifier object” **MAY** also include a `meta` member, whose value is a meta object that\ncontains non-standard meta-information.\n\n### Compound Documents\n\nServers **MAY** allow responses that include related resources along with the\nrequested primary resources. Such responses are called “compound documents”.\n\nIn a compound document, all included resources **MUST** be represented as an\narray of resource objects in a top-level `included` member.\n\nEvery included resource object **MUST** be identified via a chain of\nrelationships originating in a document’s primary data. This means that\ncompound documents require “full linkage” and that no resource object can be\nincluded without a direct or indirect relationship to the document’s primary\ndata.\n\nThe only exception to the full linkage requirement is when relationship fields\nthat would otherwise contain linkage data are excluded due to\nsparse fieldsets requested by the client.\n\nA complete example document with multiple included relationships:\n\n```\n{ \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"links\": { \"self\": \"http://example.com/articles/1\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }, \"comments\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": \"http://example.com/articles/1/comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"5\" }, { \"type\": \"comments\", \"id\": \"12\" } ] } } }], \"included\": [{ \"type\": \"people\", \"id\": \"9\", \"attributes\": { \"firstName\": \"Dan\", \"lastName\": \"Gebhardt\", \"twitter\": \"dgeb\" }, \"links\": { \"self\": \"http://example.com/people/9\" } }, { \"type\": \"comments\", \"id\": \"5\", \"attributes\": { \"body\": \"First!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"2\" } } }, \"links\": { \"self\": \"http://example.com/comments/5\" } }, { \"type\": \"comments\", \"id\": \"12\", \"attributes\": { \"body\": \"I like XML better\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/comments/12\" } }] } \n```\n\nA compound document **MUST NOT** include more than one resource object for\neach `type` and `id` pair.\n\n> Note: In a single document, you can think of the `type` and `id` as a\n> composite key that uniquely references resource objects in another part of\n> the document.\n\n> Note: For resources that do not contain an `id` member but do contain a `lid`,\n> the `lid` is sufficient to establish resource identity and thus linkage between\n> resource objects and resource identifier objects throughout the document.\n\n> Note: This approach ensures that a single canonical resource object is\n> returned with each response, even when the same resource is referenced\n> multiple times.\n\n### Meta Information\n\nWhere specified, a `meta` member can be used to include non-standard\nmeta-information. The value of each `meta` member **MUST** be an object (a\n“meta object”).\n\nAny members **MAY** be specified within `meta` objects.\n\nFor example:\n\n```\n{ \"meta\": { \"copyright\": \"Copyright 2015 Example Corp.\", \"authors\": [ \"Yehuda Katz\", \"Steve Klabnik\", \"Dan Gebhardt\", \"Tyler Kellen\" ] }, \"data\": { // ... } } \n```\n\n### Links\n\nWhere specified, a `links` member can be used to represent links. The value\nof this member **MUST** be an object (a “links object”).\n\nWithin this object, a link **MUST** be represented as either:\n\n- a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target,\n- a link object or\n- `null` if the link does not exist.\n\nA link’s relation type **SHOULD** be inferred from the name of the link unless the\nlink is a link object and the link object has a `rel` member.\n\nA link’s context is the top-level object, resource\nobject, or relationship object in which it\nappears.\n\nIn the example below, the `self` link is a string whereas the `related` link is\na link object. The `related` link object provides additional information\nabout the targeted related resource collection as well as a schema that serves\nas a description document for that collection:\n\n```\n\"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": { \"href\": \"http://example.com/articles/1/comments\", \"title\": \"Comments\", \"describedby\": \"http://example.com/schemas/article-comments\", \"meta\": { \"count\": 10 } } } \n```\n\n#### Link objects\n\nA “link object” is an object that represents a [web link](https://tools.ietf.org/html/rfc8288).\n\nA link object **MUST** contain the following member:\n\n- `href` : a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target.\n\nA link object **MAY** also contain any of the following members:\n\n- `rel` : a string indicating the link’s relation type. The string **MUST** be a [valid link relation type](https://tools.ietf.org/html/rfc8288#section-2.1) .\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the link target.\n- `title` : a string which serves as a label for the destination of a link\nsuch that it can be used as a human-readable identifier (e.g., a menu\nentry).\n- `type` : a string indicating the media type of the link’s target.\n- `hreflang` : a string or an array of strings indicating the language(s) of the\nlink’s target. An array of strings indicates that the link’s target is\navailable in multiple languages. Each string **MUST** be a valid language tag\n[ [RFC5646](https://tools.ietf.org/html/rfc5646) ].\n- `meta` : a meta object containing non-standard meta-information about the\nlink.\n\n> Note: the `type` and `hreflang` members are only hints; the target resource\n> is not guaranteed to be available in the indicated media type or language\n> when the link is actually followed.\n\n### JSON:API Object\n\nA JSON:API document **MAY** include information about its implementation\nunder a top level `jsonapi` member. If present, the value of the `jsonapi`\nmember **MUST** be an object (a “jsonapi object”).\n\nThe jsonapi object **MAY** contain any of the following members:\n\n- `version` - whose value is a string indicating the highest JSON:API version\nsupported.\n- `ext` - an array of URIs for all applied extensions .\n- `profile` - an array of URIs for all applied profiles .\n- `meta` - a meta object that contains non-standard meta-information.\n\nClients and servers **MUST NOT** use an `ext` or `profile` member for content\nnegotiation. Content negotiation **MUST** only happen based on media type\nparameters in `Content-Type` header.\n\nA simple example appears below:\n\n```\n{ \"jsonapi\": { \"version\": \"1.1\", \"ext\": [ \"https://jsonapi.org/ext/atomic\" ], \"profile\": [ \"http://example.com/profiles/flexible-pagination\", \"http://example.com/profiles/resource-versioning\" ] } } \n```\n\nIf the `version` member is not present, clients should assume the server\nimplements at least version 1.0 of the specification.\n\n> Note: Because JSON:API is committed to making additive changes only, the\n> version string primarily indicates which new features a server may support.\n\n### Member Names\n\nImplementation and profile defined member names used in a JSON:API document\n**MUST** be treated as case sensitive by clients and servers, and they **MUST**\nmeet all of the following conditions:\n\n- Member names **MUST** contain at least one character.\n- Member names **MUST** contain only the allowed characters listed below.\n- Member names **MUST** start and end with a “globally allowed character”,\nas defined below.\n\nTo enable an easy mapping of member names to URLs, it is **RECOMMENDED** that\nmember names use only non-reserved, URL safe characters specified in [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).\n\n#### Allowed Characters\n\nThe following “globally allowed characters” **MAY** be used anywhere in a member name:\n\n- U+0061 to U+007A, “a-z”\n- U+0041 to U+005A, “A-Z”\n- U+0030 to U+0039, “0-9”\n- U+0080 and above (non-ASCII Unicode characters; *not recommended, not URL safe* )\n\nAdditionally, the following characters are allowed in member names, except as the\nfirst or last character:\n\n- U+002D HYPHEN-MINUS, “-“\n- U+005F LOW LINE, “_”\n- U+0020 SPACE, “ “ *(not recommended, not URL safe)*\n\n#### Reserved Characters\n\nThe following characters **MUST NOT** be used in implementation and\nprofile defined member names:\n\n- U+002B PLUS SIGN, “+” *(has overloaded meaning in URL query strings)*\n- U+002C COMMA, “,” *(used as a separator between relationship paths)*\n- U+002E PERIOD, “.” *(used as a separator within relationship paths)*\n- U+005B LEFT SQUARE BRACKET, “[” *(used in query parameter families)*\n- U+005D RIGHT SQUARE BRACKET, “]” *(used in query parameter families)*\n- U+0021 EXCLAMATION MARK, “!”\n- U+0022 QUOTATION MARK, â€�”’\n- U+0023 NUMBER SIGN, “#”\n- U+0024 DOLLAR SIGN, “$”\n- U+0025 PERCENT SIGN, “%”\n- U+0026 AMPERSAND, “&”\n- U+0027 APOSTROPHE, “’”\n- U+0028 LEFT PARENTHESIS, “(“\n- U+0029 RIGHT PARENTHESIS, “)”\n- U+002A ASTERISK, “*”\n- U+002F SOLIDUS, “/”\n- U+003A COLON, “:”\n- U+003B SEMICOLON, “;”\n- U+003C LESS-THAN SIGN, “<”\n- U+003D EQUALS SIGN, “=”\n- U+003E GREATER-THAN SIGN, “>”\n- U+003F QUESTION MARK, “?”\n- U+0040 COMMERCIAL AT, “@” (except as first character in @-Members )\n- U+005C REVERSE SOLIDUS, “\\”\n- U+005E CIRCUMFLEX ACCENT, “^”\n- U+0060 GRAVE ACCENT, “`”\n- U+007B LEFT CURLY BRACKET, “{“\n- U+007C VERTICAL LINE, “|”\n- U+007D RIGHT CURLY BRACKET, “}”\n- U+007E TILDE, “~”\n- U+007F DELETE\n- U+0000 to U+001F (C0 Controls)\n\n#### @-Members\n\nMember names **MAY** also begin with an at sign (U+0040 COMMERCIAL AT, “@”).\nMembers named this way are called “@-Members”. @-Members **MAY** appear\nanywhere in a document.\n\nThis specification provides no guidance on the meaning or usage of @-Members,\nwhich are considered to be implementation semantics. @-Members\n**MUST** be ignored when interpreting this specification’s definitions and\nprocessing instructions given outside of this subsection. For example, an\nattribute is defined above as any member of the attributes object.\nHowever, because @-Members must be ignored when interpreting that definition, an\n@-Member that occurs in an attributes object is not an attribute.\n\n> Note: Among other things, “@” members can be used to add JSON-LD data to a\n> JSON:API document. Such documents should be served with [an extra header](http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld)\n> to convey to JSON-LD clients that they contain JSON-LD data.\n\n#### Extension Members\n\nThe name of every new member introduced by an extension **MUST** be prefixed\nwith the extension’s namespace followed by a colon (`:`).\nThe remainder of the name **MUST** adhere to the rules for implementation\ndefined member names.\n\n## Fetching Data\n\nData, including resources and relationships, can be fetched by sending a\n`GET` request to an endpoint.\n\nResponses can be further refined with the optional features described below.\n\n### Fetching Resources\n\nA server **MUST** support fetching resource data for every URL provided as:\n\n- a `self` link as part of the top-level links object\n- a `self` link as part of a resource-level links object\n- a `related` link as part of a relationship-level links object\n\nFor example, the following request fetches a collection of articles:\n\n```\nGET /articles HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe following request fetches an article:\n\n```\nGET /articles/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches an article’s author:\n\n```\nGET /articles/1/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch an individual\nresource or resource collection with a `200 OK` response.\n\nA server **MUST** respond to a successful request to fetch a resource\ncollection with an array of resource objects or an empty array (`[]`) as\nthe response document’s primary data.\n\nFor example, a `GET` request to a collection of articles could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" } }, { \"type\": \"articles\", \"id\": \"2\", \"attributes\": { \"title\": \"Rails is Omakase\" } }] } \n```\n\nA similar response representing an empty collection would be:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [] } \n```\n\nA server **MUST** respond to a successful request to fetch an individual\nresource with a resource object or `null` provided as\nthe response document’s primary data.\n\n`null` is only an appropriate response when the requested URL is one that\nmight correspond to a single resource, but doesn’t currently.\n\n> Note: Consider, for example, a request to fetch a to-one related resource link.\n> This request would respond with `null` when the relationship is empty (such that\n> the link is corresponding to no resources) but with the single related resource’s\n> resource object otherwise.\n\nFor example, a `GET` request to an individual article could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1\" }, \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"related\": \"http://example.com/articles/1/author\" } } } } } \n```\n\nIf the above article’s author is missing, then a `GET` request to that related\nresource would return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1/author\" }, \"data\": null } \n```\n\n##### 404 Not Found\n\nA server **MUST** respond with `404 Not Found` when processing a request to\nfetch a single resource that does not exist, except when the request warrants a\n`200 OK` response with `null` as the primary data (as described above).\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Fetching Relationships\n\nA server **MUST** support fetching relationship data for every relationship URL\nprovided as a `self` link as part of a relationship’s `links` object.\n\nFor example, the following request fetches data about an article’s comments:\n\n```\nGET /articles/1/relationships/comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches data about an article’s author:\n\n```\nGET /articles/1/relationships/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch a relationship\nwith a `200 OK` response.\n\nThe primary data in the response document **MUST** match the appropriate\nvalue for resource linkage, as described above for\nrelationship objects.\n\nThe top-level links object **MAY** contain `self` and `related` links,\nas described above for relationship objects.\n\nFor example, a `GET` request to a URL from a to-one relationship link could\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": null } \n```\n\nA `GET` request to a URL from a to-many relationship link could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [] } \n```\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to fetch\na relationship link URL that does not exist.\n\n> Note: This can happen when the parent resource of the relationship\n> does not exist. For example, when `/articles/1` does not exist, request to\n> `/articles/1/relationships/tags` returns `404 Not Found`.\n\nIf a relationship link URL exists but the relationship is empty, then\n`200 OK` **MUST** be returned, as described above.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\nAn endpoint **MAY** return resources related to the primary data by default.\n\nAn endpoint **MAY** also support an `include` query parameter to allow the\nclient to customize which related resources should be returned.\n\nIf an endpoint does not support the `include` parameter, it **MUST** respond\nwith `400 Bad Request` to any requests that include it.\n\nIf an endpoint supports the `include` parameter and a client supplies it:\n\n- The server’s response **MUST** be a compound document with an `included` key — even if that `included` key holds an empty array (because the requested relationships are empty).\n- The server **MUST NOT** include unrequested resource objects in the `included` section of the compound document .\n\nThe value of the `include` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list of relationship paths. A relationship path is a dot-separated\n(U+002E FULL-STOP, “.”) list of relationship names. An empty\nvalue indicates that no related resources should be returned.\n\nIf a server is unable to identify a relationship path or does not support\ninclusion of resources from a path, it **MUST** respond with 400 Bad Request.\n\n> Note: For example, a relationship path could be `comments.author`, where\n> `comments` is a relationship listed under a `articles` resource object, and\n> `author` is a relationship listed under a `comments` resource object.\n\nFor instance, comments could be requested with an article:\n\n```\nGET /articles/1?include=comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn order to request resources related to other resources, a dot-separated path\nfor each relationship name can be specified:\n\n```\nGET /articles/1?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: Because compound documents require full linkage\n> (except when relationship linkage is excluded by sparse fieldsets), intermediate\n> resources in a multi-part path must be returned along with the leaf nodes. For\n> example, a response to a request for `comments.author` should include `comments`\n> as well as the `author` of each of those `comments`.\n\n> Note: A server may choose to expose a deeply nested relationship such as\n> `comments.author` as a direct relationship with an alternative name such as\n> `commentAuthors`. This would allow a client to request\n> `/articles/1?include=commentAuthors` instead of\n> `/articles/1?include=comments.author`. By exposing the nested relationship with\n> an alternative name, the server can still provide full linkage in compound\n> documents without including potentially unwanted intermediate resources.\n\nMultiple related resources can be requested in a comma-separated list:\n\n```\nGET /articles/1?include=comments.author,ratings HTTP/1.1 Accept: application/vnd.api+json \n```\n\nFurthermore, related resources can be requested from a relationship endpoint:\n\n```\nGET /articles/1/relationships/comments?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn this case, the primary data would be a collection of\nresource identifier objects that represent linkage to comments for an article,\nwhile the full comments and comment authors would be returned as included data.\n\n> Note: This section applies to any endpoint that responds with primary\n> data, regardless of the request type. For instance, a server could support\n> the inclusion of related resources along with a `POST` request to create a\n> resource or relationship.\n\n### Sparse Fieldsets\n\nA client **MAY** request that an endpoint return only specific fields in the\nresponse on a per-type basis by including a `fields[TYPE]` query parameter.\n\nThe value of any `fields[TYPE]` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list that refers to the name(s) of the fields to be returned.\nAn empty value indicates that no fields should be returned.\n\nIf a client requests a restricted set of fields for a given resource type,\nan endpoint **MUST NOT** include additional fields in resource objects of\nthat type in its response.\n\nIf a client does not specify the set of fields for a given resource type, the\nserver **MAY** send all fields, a subset of fields, or no fields for that\nresource type.\n\n```\nGET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply for\n> readability. In practice, these characters should be percent-encoded. See\n> “Square Brackets in Parameter Names”.\n\n> Note: This section applies to any endpoint that responds with resources as\n> primary or included data, regardless of the request type. For instance, a\n> server could support sparse fieldsets along with a `POST` request to create\n> a resource.\n\n### Sorting\n\nA server **MAY** choose to support requests to sort resource collections\naccording to one or more criteria (“sort fields”).\n\n> Note: Although recommended, sort fields do not necessarily need to\n> correspond to resource attribute and relationship names.\n\n> Note: It is recommended that dot-separated (U+002E FULL-STOP, “.”) sort\n> fields be used to request sorting based upon relationship attributes. For\n> example, a sort field of `author.name` could be used to request that the\n> primary data be sorted based upon the `name` attribute of the `author`\n> relationship.\n\nAn endpoint **MAY** support requests to sort the primary data with a `sort`\nquery parameter. The value for `sort` **MUST** represent sort fields.\n\n```\nGET /people?sort=age HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAn endpoint **MAY** support multiple sort fields by allowing comma-separated\n(U+002C COMMA, “,”) sort fields. Sort fields **SHOULD** be applied in the\norder specified.\n\n```\nGET /people?sort=age,name HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe sort order for each sort field **MUST** be ascending unless it is prefixed\nwith a minus (U+002D HYPHEN-MINUS, “-“), in which case it **MUST** be descending.\n\n```\nGET /articles?sort=-created,title HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe above example should return the newest articles first. Any articles\ncreated on the same date will then be sorted by their title in ascending\nalphabetical order.\n\nIf the server does not support sorting as specified in the query parameter\n`sort`, it **MUST** return `400 Bad Request`.\n\nIf sorting is supported by the server and requested by the client via query\nparameter `sort`, the server **MUST** return elements of the top-level\n`data` array of the response ordered according to the criteria specified.\nThe server **MAY** apply default sorting rules to top-level `data` if\nrequest parameter `sort` is not specified.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\nA server **MAY** choose to limit the number of resources returned in a response\nto a subset (“page”) of the whole set available.\n\nA server **MAY** provide links to traverse a paginated data set (“pagination\nlinks”).\n\nPagination links **MUST** appear in the links object that corresponds to a\ncollection. To paginate the primary data, supply pagination links in the\ntop-level `links` object. To paginate an included collection returned in\na compound document, supply pagination links in the corresponding links\nobject.\n\nThe following keys **MUST** be used for pagination links:\n\n- `first` : the first page of data\n- `last` : the last page of data\n- `prev` : the previous page of data\n- `next` : the next page of data\n\nKeys **MUST** either be omitted or have a `null` value to indicate that a\nparticular link is unavailable.\n\nConcepts of order, as expressed in the naming of pagination links, **MUST**\nremain consistent with JSON:API’s sorting rules.\n\nThe `page` query parameter family is reserved for pagination. Servers and\nclients **SHOULD** use these parameters for pagination operations.\n\n> Note: JSON API is agnostic about the pagination strategy used by a server, but\n> the `page` query parameter family can be used regardless of the strategy\n> employed. For example, a page-based strategy might use query parameters such\n> as `page[number]` and `page[size]`, while a cursor-based strategy might use\n> `page[cursor]`.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\n### Filtering\n\nThe `filter` query parameter family is reserved for filtering data. Servers\nand clients **SHOULD** use these parameters for filtering operations.\n\n> Note: JSON API is agnostic about the strategies supported by a server.\n\n## Creating, Updating and Deleting Resources\n\nA server **MAY** allow resources of a given type to be created. It **MAY**\nalso allow existing resources to be modified or deleted.\n\nA request **MUST** completely succeed or fail (in a single “transaction”). No\npartial updates are allowed.\n\n> Note: The `type` member is required in every resource object throughout requests and\n> responses in JSON:API. There are some cases, such as when `POST`ing to an\n> endpoint representing heterogeneous data, when the `type` could not be inferred\n> from the endpoint. However, picking and choosing when it is required would be\n> confusing; it would be hard to remember when it was required and when it was\n> not. Therefore, to improve consistency and minimize confusion, `type` is\n> always required.\n\n### Creating Resources\n\nA resource can be created by sending a `POST` request to a URL that represents\na collection of resources. The request **MUST** include a single resource object\nas primary data. The resource object **MUST** contain at least a `type` member.\n\nFor instance, a new photo might be created with the following request:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"relationships\": { \"photographer\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } } \n```\n\nIf a relationship is provided in the `relationships` member of the\nresource object, its value **MUST** be a relationship object with a `data`\nmember. The value of this key represents the linkage the new resource is to\nhave.\n\n#### Client-Generated IDs\n\nA server **MAY** accept a client-generated ID along with a request to create\na resource. An ID **MUST** be specified with an `id` key, the value of\nwhich **MUST** be a universally unique identifier. The client **SHOULD** use\na properly generated and formatted *UUID* as described in RFC 4122\n[[RFC4122](http://tools.ietf.org/html/rfc4122.html)].\n\n> NOTE: In some use-cases, such as importing data from another source, it\n> may be possible to use something other than a UUID that is still guaranteed\n> to be globally unique. Do not use anything other than a UUID unless you are\n> 100% confident that the strategy you are using indeed generates globally\n> unique identifiers.\n\nFor example:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" } } } \n```\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto create a resource with a client-generated ID.\n\n#### Responses\n\n##### 201 Created\n\nIf the requested resource has been created successfully and the server changes\nthe resource in any way (for example, by assigning an `id`), the server **MUST**\nreturn a `201 Created` response and a document that contains the resource as\nprimary data.\n\nThe response **SHOULD** include a `Location` header identifying the location\nof the newly created resource, in order to comply with [RFC\n7231](http://tools.ietf.org/html/rfc7231#section-6.3.2).\n\nIf the resource object returned by the response contains a `self` key in its\n`links` member and a `Location` header is provided, the value of the `self`\nmember **MUST** match the value of the `Location` header.\n\n```\nHTTP/1.1 201 Created Location: http://example.com/photos/550e8400-e29b-41d4-a716-446655440000 Content-Type: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"links\": { \"self\": \"http://example.com/photos/550e8400-e29b-41d4-a716-446655440000\" } } } \n```\n\nA server **MAY** return a `201 Created` response with a document that contains\nno primary data if the requested resource has been created successfully and the\nserver does not change the resource in any way (for example, by assigning an\n`id` or `createdAt` attribute). Other top-level members, such as meta, could\nbe included in the response document.\n\n> Note: Only servers that accept Client-Generated\n> IDs can avoid assigning an `id` to a new resource.\n\n##### 202 Accepted\n\nIf a request to create a resource has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf the requested resource has been created successfully and the server does not\nchange the resource in any way (for example, by assigning an `id` or `createdAt`\nattribute), the server **MUST** return either a `201 Created` status code and\nresponse document (as described above) or a `204 No Content` status code with no\nresponse document.\n\n##### 403 Forbidden\n\nA server **MAY** return `403 Forbidden` in response to an unsupported request\nto create a resource.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MUST** return `409 Conflict` when processing a `POST` request to\ncreate a resource with a client-generated ID that already exists.\n\nA server **MUST** return `409 Conflict` when processing a `POST` request in\nwhich the resource object’s `type` is not among the type(s) that constitute the\ncollection represented by the endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Resources\n\nA resource can be updated by sending a `PATCH` request to the URL that\nrepresents the resource.\n\nThe URL for a resource can be obtained in the `self` link of the resource\nobject. Alternatively, when a `GET` request returns a single resource object as\nprimary data, the same request URL can be used for updates.\n\nThe `PATCH` request **MUST** include a single resource object as primary data.\nThe resource object **MUST** contain `type` and `id` members.\n\nFor example:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\" } } } \n```\n\n#### Updating a Resource’s Attributes\n\nAny or all of a resource’s attributes **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the attributes for a resource, the server\n**MUST** interpret the missing attributes as if they were included with their\ncurrent values. The server **MUST NOT** interpret missing attributes as `null`\nvalues.\n\nFor example, the following `PATCH` request is interpreted as a request to\nupdate only the `title` and `text` attributes of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\", \"text\": \"TLDR; It's complicated... but check your test coverage regardless.\" } } } \n```\n\n#### Updating a Resource’s Relationships\n\nAny or all of a resource’s relationships **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the relationships for a resource, the server\n**MUST** interpret the missing relationships as if they were included with their\ncurrent values. It **MUST NOT** interpret them as `null` or empty values.\n\nIf a relationship is provided in the `relationships` member of a resource\nobject in a `PATCH` request, its value **MUST** be a relationship object\nwith a `data` member. The relationship’s value will be replaced with the\nvalue specified in this member.\n\nFor instance, the following `PATCH` request will update the `author` relationship of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"1\" } } } } } \n```\n\nLikewise, the following `PATCH` request performs a complete replacement of\nthe `tags` for an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"tags\": { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } } } } \n```\n\nA server **MAY** reject an attempt to do a full replacement of a to-many\nrelationship. In such a case, the server **MUST** reject the entire update,\nand return a `403 Forbidden` response.\n\n> Note: Since full replacement may be a very dangerous operation, a server\n> may choose to disallow it. For example, a server may reject full replacement if\n> it has not provided the client with the full list of associated objects, and\n> does not want to allow deletion of records the client has not seen.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted resource in ways\nother than those specified by the request (for example, updating the\n`updatedAt` attribute or a computed `sha`), it **MUST** return a `200 OK`\nresponse and a document that contains the updated resource as primary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted resource in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf an update request has been accepted for processing, but the processing\nhas not been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nresource in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a resource or relationship.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to modify\na resource that does not exist.\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MAY** return `409 Conflict` when processing a `PATCH` request to\nupdate a resource if that update would violate other server-enforced\nconstraints (such as a uniqueness constraint on a property other than `id`).\n\nA server **MUST** return `409 Conflict` when processing a `PATCH` request in\nwhich the resource object’s `type` or `id` do not match the server’s endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Relationships\n\nAlthough relationships can be modified along with resources (as described\nabove), JSON:API also supports updating of relationships independently at\nURLs from relationship links.\n\n> Note: Relationships are updated without exposing the underlying server\n> semantics, such as foreign keys. Furthermore, relationships can be updated\n> without necessarily affecting the related resources. For example, if an article\n> has many authors, it is possible to remove one of the authors from the article\n> without deleting the person itself. Similarly, if an article has many tags, it\n> is possible to add or remove tags. Under the hood on the server, the first\n> of these examples might be implemented with a foreign key, while the second\n> could be implemented with a join table, but the JSON:API protocol would be\n> the same in both cases.\n\n> Note: A server may choose to delete the underlying resource if a\n> relationship is deleted (as a garbage collection measure).\n\n#### Updating To-One Relationships\n\nA to-one relationship can be updated by sending a `PATCH` request to a URL\nfrom a to-one relationship link.\n\nThe `PATCH` request **MUST** include a top-level member named `data` containing\none of:\n\n- a resource identifier object corresponding to the new related resource.\n- `null` , to remove the relationship.\n\nFor example, the following request updates the author of an article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nAnd the following request clears the author of the same article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": null } \n```\n\nIf the relationship is updated successfully then the server **MUST** return\na successful response.\n\n#### Updating To-Many Relationships\n\nA to-many relationship can be updated by sending a `PATCH`, `POST`, or\n`DELETE` request to a URL from a to-many relationship link.\n\nFor all request types, the body **MUST** contain a `data` member whose value\nis an empty array or an array of resource identifier objects.\n\nIf a client makes a `PATCH` request to a URL from a to-many\nrelationship link, the server **MUST** either completely\nreplace every member of the relationship, return an appropriate error response\nif some resources cannot be found or accessed, or return a `403 Forbidden`\nresponse if complete replacement is not allowed by the server.\n\nFor example, the following request replaces every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nAnd the following request clears every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [] } \n```\n\nIf a client makes a `POST` request to a URL from a\nrelationship link, the server **MUST** add the specified\nmembers to the relationship unless they are already present. If a given `type`\nand `id` is already in the relationship, the server **MUST NOT** add it again.\n\n> Note: This matches the semantics of databases that use foreign keys for\n> has-many relationships. Document-based storage should check the has-many\n> relationship before appending to avoid duplicates.\n\nIf all of the specified resources can be added to, or are already present\nin, the relationship then the server **MUST** return a successful response.\n\n> Note: This approach ensures that a request is successful if the server’s\n> state matches the requested state, and helps avoid pointless race conditions\n> caused by multiple clients making the same changes to a relationship.\n\nIn the following example, the comment with ID `123` is added to the list of\ncomments for the article with ID `1`:\n\n```\nPOST /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"123\" } ] } \n```\n\nIf the client makes a `DELETE` request to a URL from a\nrelationship link the server **MUST** delete the specified\nmembers from the relationship or return a `403 Forbidden` response. If all of\nthe specified resources are able to be removed from, or are already missing\nfrom, the relationship then the server **MUST** return a successful response.\n\n> Note: As described above for `POST` requests, this approach helps avoid\n> pointless race conditions between multiple clients making the same changes.\n\nRelationship members are specified in the same way as in the `POST` request.\n\nIn the following example, comments with IDs of `12` and `13` are removed\nfrom the list of comments for the article with ID `1`:\n\n```\nDELETE /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"12\" }, { \"type\": \"comments\", \"id\": \"13\" } ] } \n```\n\n> Note: RFC 7231 specifies that a DELETE request may include a body, but\n> that a server may reject the request. This spec defines the semantics of a\n> server, and we are defining its semantics for JSON:API.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted relationship in\nother ways than those specified by the request, it **MUST** return a `200 OK`\nresponse and a document that includes the updated relationship data as its\nprimary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted relationship in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a relationship update request has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nrelationship in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n> Note: This is the appropriate response to a `POST` request sent to a URL\n> from a to-many relationship link when that relationship already\n> exists. It is also the appropriate response to a `DELETE` request sent to a URL\n> from a to-many relationship link when that relationship does\n> not exist.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a relationship.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Deleting Resources\n\nA resource can be deleted by sending a `DELETE` request to the URL\nthat represents the resource:\n\n```\nDELETE /photos/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if a deletion request is successful. Other top-level members, such\nas meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a deletion request has been accepted for processing, but the processing has\nnot been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf a deletion request is successful, the server **MUST** return either a `200\nOK` status code and response document (as described above) or a `204 No Content`\nstatus code with no response document.\n\n##### 404 NOT FOUND\n\nA server **SHOULD** return a `404 Not Found` status code if a deletion request fails\ndue to the resource not existing.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n## Query Parameters\n\n### Query Parameter Families\n\nAlthough “query parameter” is a common term in everyday web development, it is\nnot a well-standardized concept. Therefore, JSON:API provides its own\ndefinition of a query parameter.\n\nFor the most part, JSON:API’s definition coincides with colloquial usage, and its\ndetails can be safely ignored. However, one important consequence of this\ndefinition is that a URL like the following is considered to have two distinct\nquery parameters:\n\n```\n/?page[offset]=0&page[limit]=10\n```\n\nThe two parameters are named `page[offset]` and `page[limit]`; there is no\nsingle `page` parameter.\n\nIn practice, however, parameters like `page[offset]` and `page[limit]` are\nusually defined and processed together, and it’s convenient to refer to them\ncollectively. Therefore, JSON:API introduces the concept of a query parameter\nfamily.\n\nA “query parameter family” is the set of all query parameters whose name starts\nwith a “base name”, followed by zero or more instances of empty square brackets\n(i.e. `[]`), square-bracketed legal member names, or square-bracketed\ndot-separated lists of legal member names. The family is referred to\nby its base name.\n\nFor example, the `filter` query parameter family includes parameters named:\n`filter`, `filter[x]`, `filter[]`, `filter[x][]`, `filter[][]`, `filter[x][y]`,\n`filter[x.y]`, etc. However, `filter[_]` is not a valid parameter name in the\nfamily, because `_` is not a valid member name.\n\n> Note: Dot separated lists of legal member names are intended to be used for\n> relationship paths. For example, this allows filtering strategies using\n> relationship paths as defined for sorting in query parameters\n> such as `GET /posts?sort=author.name&filter[author.status]=active`.\n\n### Extension-Specific Query Parameters\n\nThe base name of every query parameter introduced by an extension **MUST** be\nprefixed with the extension’s namespace followed by a colon (`:`). The\nremainder of the base name **MUST** contain only the characters [a-z] (U+0061\nto U+007A, “a-z”).\n\n### Implementation-Specific Query Parameters\n\nImplementations **MAY** support custom query parameters. However, the names of\nthese query parameters **MUST** come from a family\nwhose base name is a legal member name and also contains at least\none non a-z character (i.e., outside U+0061 to U+007A).\n\nIt is **RECOMMENDED** that a capital letter (e.g. camelCasing) be used to\nsatisfy the above requirement.\n\nIf a server encounters a query parameter that does not follow the naming\nconventions above, or the server does not know how to process it as a query\nparameter from this specification, it **MUST** return `400 Bad Request`.\n\n> Note: By forbidding the use of query parameters that contain only the characters\n> [a-z], JSON:API is reserving the ability to standardize additional query\n> parameters later without conflicting with existing implementations.\n\n## Errors\n\n### Processing Errors\n\nA server **MAY** choose to stop processing as soon as a problem is encountered,\nor it **MAY** continue processing and encounter multiple problems. For instance,\na server might process multiple attributes and then return multiple validation\nproblems in a single response.\n\nWhen a server encounters multiple problems for a single request, the most\ngenerally applicable HTTP error code **SHOULD** be used in the response. For\ninstance, `400 Bad Request` might be appropriate for multiple 4xx errors\nor `500 Internal Server Error` might be appropriate for multiple 5xx errors.\n\n### Error Objects\n\nError objects provide additional information about problems encountered while\nperforming an operation. Error objects **MUST** be returned as an array\nkeyed by `errors` in the top level of a JSON:API document.\n\nAn error object **MAY** have the following members, and **MUST** contain at\nleast one of:\n\n- `id` : a unique identifier for this particular occurrence of the problem.\n- `links` : a links object that **MAY** contain the following members:\n - `about` : a link that leads to further details about this\n particular occurrence of the problem. When dereferenced, this URI **SHOULD** return a human-readable description of the error.\n - `type` : a link that identifies the type of error that this\n particular error is an instance of. This URI **SHOULD** be dereferenceable to\n a human-readable explanation of the general error.\n- `status` : the HTTP status code applicable to this problem, expressed as a\nstring value. This **SHOULD** be provided.\n- `code` : an application-specific error code, expressed as a string value.\n- `title` : a short, human-readable summary of the problem that **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of\nlocalization.\n- `detail` : a human-readable explanation specific to this occurrence of the\nproblem. Like `title` , this field’s value can be localized.\n- `source` : an object containing references to the primary source of the error.\nIt **SHOULD** include one of the following members or be omitted:\n - `pointer` : a JSON Pointer [ [RFC6901](https://tools.ietf.org/html/rfc6901) ]\n to the value in the request document that caused the error [e.g. `\"/data\"` for a primary data object, or `\"/data/attributes/title\"` for a specific\n attribute]. This **MUST** point to a value in the request document that\n exists; if it doesn’t, the client **SHOULD** simply ignore the pointer.\n - `parameter` : a string indicating which URI query parameter caused\n the error.\n - `header` : a string indicating the name of a single request header which\n caused the error.\n- `meta` : a meta object containing non-standard meta-information about the\nerror.\n\n## Appendix\n\n### Query Parameters Details\n\n#### Parsing/Serialization\n\nA query parameter is a name–value pair extracted from, or serialized into, a\nURI’s query string.\n\nTo extract the query parameters from a URI, an implementation **MUST** run the\nURI’s query string, excluding the leading question mark, through the\n[`application/x-www-form-urlencoded` parsing algorithm](https://url.spec.whatwg.org/#urlencoded-parsing),\nwith one exception: JSON:API allows the specification that defines a query\nparameter’s usage to provide its own rules for parsing the parameter’s value\nfrom the `value` bytes identified in steps 3.2 and and 3.3 of the `application/x-www-form-urlencoded`\nparsing algorithm. The resulting value might not be a string.\n\n> Note: In general, the query string parsing built in to servers and browsers\n> will match the process specified above, so most implementations do not need\n> to worry about this.\n> \n> The `application/x-www-form-urlencoded` format is referenced because it is\n> the basis for the `a=b&c=d` style that almost all query strings use today.\n> \n> However, `application/x-www-form-urlencoded` parsing contains the bizarre\n> historical artifact that `+` characters must be treated as spaces, and it\n> requires that all values be percent-decoded during parsing, which makes it\n> impossible to use [RFC 3986 delimiter characters](https://tools.ietf.org/html/rfc3986#section-2.2)\n> as delimiters. These issues motivate the exception that JSON:API defines above.\n\nSimilarly, to serialize a query parameter into a URI, an implementation **MUST**\nuse [the `application/x-www-form-urlencoded` serializer](https://url.spec.whatwg.org/#concept-urlencoded-serializer),\nwith the corresponding exception that a parameter’s value — but not its name —\nmay be serialized differently than that algorithm requires, provided the\nserialization does not interfere with the ability to parse back the resulting URI.\n\n#### Square Brackets in Parameter Names\n\nWith query parameter families, JSON:API allows for\nquery parameters whose names contain square brackets (i.e., U+005B “[” and\nU+005D “]”).\n\nAccording to the query parameter serialization rules above, a compliant\nimplementation will percent-encode these square brackets. However, some URI\nproducers — namely browsers — do not always encode them. Servers **SHOULD**\naccept requests in which these square brackets are left unencoded in a query\nparameter’s name. If a server does accept these requests, it **MUST** treat the\nrequest as equivalent to one in which the square brackets were percent-encoded.", "znaku_textu": 74500, "slov": 11324, "odkazu": 140, "kodovani": "windows-1250", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/format", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:46", "sha256": "0561c0d7471422779fc231901aba8e90338b40abb20851689dafaa471df6cb4c", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["http://discuss.jsonapi.org/", "https://github.com/json-api/json-api", "http://www.iana.org/assignments/media-types/application/vnd.api+json", "https://tools.ietf.org/html/bcp14", "https://tools.ietf.org/html/rfc2119", "https://tools.ietf.org/html/rfc8174", "https://tools.ietf.org/html/rfc3986", "https://tools.ietf.org/html/rfc6906", "https://tools.ietf.org/html/rfc3339", "https://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc8259", "https://tools.ietf.org/html/rfc8288", "https://tools.ietf.org/html/rfc5646", "https://datatracker.ietf.org/doc/html/rfc3986", "http://www.w3.org/TR/json-ld/", "http://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc4122.html", "https://tools.ietf.org/html/rfc6901", "https://url.spec.whatwg.org/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/format/", "titulek": "JSON:API — Latest Specification (v1.1)", "h1": "Latest Specification (v1.1)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Latest Specification (v1.1)"}, {"uroven": 2, "text": "Status"}, {"uroven": 2, "text": "Introduction"}, {"uroven": 2, "text": "Semantics"}, {"uroven": 2, "text": "Conventions"}, {"uroven": 2, "text": "The JSON:API Media Type"}, {"uroven": 3, "text": "Media Type Parameters"}, {"uroven": 3, "text": "Extensions"}, {"uroven": 3, "text": "Profiles"}, {"uroven": 3, "text": "Rules for Media Type Parameters"}, {"uroven": 4, "text": "Rules for Extensions"}, {"uroven": 4, "text": "Rules for Profiles"}, {"uroven": 2, "text": "Content Negotiation"}, {"uroven": 3, "text": "Universal Responsibilities"}, {"uroven": 3, "text": "Client Responsibilities"}, {"uroven": 3, "text": "Server Responsibilities"}, {"uroven": 2, "text": "Document Structure"}, {"uroven": 3, "text": "Top Level"}, {"uroven": 3, "text": "Resource Objects"}, {"uroven": 4, "text": "Identification"}, {"uroven": 4, "text": "Fields"}, {"uroven": 5, "text": "Attributes"}, {"uroven": 5, "text": "Relationships"}, {"uroven": 5, "text": "Resource Linkage"}, {"uroven": 4, "text": "Resource Links"}, {"uroven": 3, "text": "Resource Identifier Objects"}, {"uroven": 3, "text": "Compound Documents"}, {"uroven": 3, "text": "Meta Information"}, {"uroven": 3, "text": "Links"}, {"uroven": 4, "text": "Link objects"}, {"uroven": 3, "text": "JSON:API Object"}, {"uroven": 3, "text": "Member Names"}, {"uroven": 4, "text": "Allowed Characters"}, {"uroven": 4, "text": "Reserved Characters"}, {"uroven": 4, "text": "@-Members"}, {"uroven": 4, "text": "Extension Members"}, {"uroven": 2, "text": "Fetching Data"}, {"uroven": 3, "text": "Fetching Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Fetching Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Sparse Fieldsets"}, {"uroven": 3, "text": "Sorting"}, {"uroven": 3, "text": "Filtering"}, {"uroven": 2, "text": "Creating, Updating and Deleting Resources"}, {"uroven": 3, "text": "Creating Resources"}, {"uroven": 4, "text": "Client-Generated IDs"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "201 Created"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Resources"}, {"uroven": 4, "text": "Updating a Resource’s Attributes"}, {"uroven": 4, "text": "Updating a Resource’s Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Relationships"}, {"uroven": 4, "text": "Updating To-One Relationships"}, {"uroven": 4, "text": "Updating To-Many Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Deleting Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "404 NOT FOUND"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 2, "text": "Query Parameters"}, {"uroven": 3, "text": "Query Parameter Families"}, {"uroven": 3, "text": "Extension-Specific Query Parameters"}, {"uroven": 3, "text": "Implementation-Specific Query Parameters"}, {"uroven": 2, "text": "Errors"}, {"uroven": 3, "text": "Processing Errors"}, {"uroven": 3, "text": "Error Objects"}, {"uroven": 2, "text": "Appendix"}, {"uroven": 3, "text": "Query Parameters Details"}, {"uroven": 4, "text": "Parsing/Serialization"}, {"uroven": 4, "text": "Square Brackets in Parameter Names"}], "markdown": "# Latest Specification (v1.1)\n\n## Status\n\nThis page presents the latest published version of JSON:API, which is\n currently version 1.1. New versions of JSON:API **will\n always be backwards compatible** using a *never remove, only add* strategy.\n Additions can be proposed in our [discussion forum](http://discuss.jsonapi.org/).\n\nIf you catch an error in the specification’s text, or if you write an\n implementation, please let us know by opening an issue or pull request at our\n [GitHub repository](https://github.com/json-api/json-api).\n\n## Introduction\n\nJSON:API is a specification for how a client should request that resources be\nfetched or modified, and how a server should respond to those requests. JSON:API\ncan be easily extended with extensions and profiles.\n\nJSON:API is designed to minimize both the number of requests and the amount of\ndata transmitted between clients and servers. This efficiency is achieved\nwithout compromising readability, flexibility, or discoverability.\n\nJSON:API requires use of the JSON:API media type\n([`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json))\nfor exchanging data.\n\n## Semantics\n\nAll document members, query parameters, and processing rules defined by\nthis specification are collectively called “specification semantics”.\n\nCertain document members, query parameters, and processing rules are reserved\nfor implementors to define at their discretion. These are called “implementation\nsemantics”.\n\nAll other semantics are reserved for potential future use by this specification.\n\n## Conventions\n\nThe key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,\n“SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this\ndocument are to be interpreted as described in\n[BCP 14](https://tools.ietf.org/html/bcp14)\n[[RFC2119](https://tools.ietf.org/html/rfc2119)]\n[[RFC8174](https://tools.ietf.org/html/rfc8174)]\nwhen, and only when, they appear in all capitals, as shown here.\n\n## The JSON:API Media Type\n\nThe JSON:API media type is\n[`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).\n\n### Media Type Parameters\n\nThe JSON:API specification supports two media type parameters: `ext` and\n`profile`, which are used to specify extensions and profiles, respectively.\n\n> Note: A media type parameter is an extra piece of information that can\n> accompany a media type. For example, in the header\n> `Content-Type: text/html;charset=\"utf-8\"`, the media type is `text/html` and\n> `charset` is a parameter.\n\n### Extensions\n\nExtensions provide a means to “extend” the base specification by defining\nadditional specification semantics.\n\nExtensions cannot alter or remove specification semantics, nor can they specify\nimplementation semantics.\n\n### Profiles\n\nProfiles provide a means to share a particular usage of the specification among\nimplementations.\n\nProfiles can specify implementation semantics, but cannot alter,\nadd to, or remove specification semantics.\n\n### Rules for Media Type Parameters\n\nThe JSON:API media type **MUST NOT** be specified with any media type parameters\nother than `ext` and `profile`. The `ext` parameter is used to support\nextensions and the `profile` parameter is used to support profiles.\n\nExtensions and profiles are each uniquely identified by a\n[URI](https://tools.ietf.org/html/rfc3986). Visiting an extension’s or a\nprofile’s URI **SHOULD** return documentation that describes its usage. The\nvalues of the `ext` and `profile` parameters **MUST** equal a space-separated\n(U+0020 SPACE, “ “) list of extension or profile URIs, respectively.\n\n> Note: When serializing the `ext` or `profile` media type parameters, the HTTP\n> specification requires that parameter values be surrounded by quotation marks\n> (U+0022 QUOTATION MARK, “\"”).\n\n#### Rules for Extensions\n\nAn extension **MAY** impose additional processing rules or further restrictions\nand it **MAY** define new object members as described below.\n\nAn extension **MUST NOT** lessen or remove any processing rules, restrictions or\nobject member requirements defined in this specification or other extensions.\n\nAn extension **MAY** define new members within the document structure defined by\nthis specification. The rules for extension member names are covered\nbelow.\n\nAn extension **MAY** define new query parameters. The rules for extension-defined\nquery parameters are covered below.\n\nWhen an extension defines new query parameters or document members, the\nextension **MUST** define a namespace to guarantee that extensions will never\nconflict with current or future versions of this specification. A namespace\n**MUST** meet all of the following conditions:\n\n- A namespace **MUST** contain at least one character.\n- A namespace **MUST** contain only these characters:\n - U+0061 to U+007A, “a-z”\n - U+0041 to U+005A, “A-Z”\n - U+0030 to U+0039, “0-9”\n\nAn extension **MUST NOT** define more than one namespace. The namespace used for\nall query parameters and document members **MUST** be the same for any given\nextension.\n\nIn the following example, an extension with the namespace `version` has\nspecified a resource object member `version:id` to support per-resource\nversioning. This member might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/version\" // ... { \"type\": \"articles\", \"id\": \"1\", \"version:id\": \"42\", \"attributes\": { \"title\": \"Rails is Omakase\" } } // ... \n```\n\n#### Rules for Profiles\n\nThe rules for profile usage are dictated by [RFC\n6906](https://tools.ietf.org/html/rfc6906).\n\nA profile **MAY** define document members and processing rules that are reserved\nfor implementors.\n\nA profile **MUST NOT** define any query parameters except implementation-specific query parameters.\n\nA profile **MUST NOT** alter or remove processing rules that have been defined\nby this specification or by an extension. However, a profile\n**MAY** define processing rules for query parameters whose processing rules\nhave been reserved for implementors to define at their discretion.\n\nFor example, a profile could define rules for interpreting the `filter` query\nparameter, but it could not specify that relationship\nnames in the `include` query parameter are\nspace-separated instead of dot-separated.\n\nUnlike extensions, profiles do not need to define a namespace for document\nmembers because profiles cannot define specification semantics and thus cannot\nconflict with current or future versions of this specification. However, it is\npossible for profiles to conflict with other profiles. Therefore, it is the\nresponsibility of implementors to ensure that they do not support conflicting\nprofiles.\n\nIn the following example, a profile has defined a `timestamps` attribute. According to the profile, the attribute must be an\nobject containing a `created` member and a `modified` member and these members’\nvalues must use the [RFC 3339](https://tools.ietf.org/html/rfc3339) format.\nWith such a profile applied, a response might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;profile=\"https://example.com/resource-timestamps\" // ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\", \"timestamps\": { \"created\": \"2020-07-21T12:09:00Z\", \"modified\": \"2020-07-30T10:19:01Z\" } } } // ... \n```\n\n## Content Negotiation\n\n### Universal Responsibilities\n\nClients and servers **MUST** send all JSON:API payloads using the JSON:API media\ntype in the `Content-Type` header.\n\nClients and servers **MUST** specify the `ext` media type parameter in the\n`Content-Type` header when they have applied one or more extensions to a\nJSON:API document.\n\nClients and servers **MUST** specify the `profile` media type parameters in the\n`Content-Type` header when they have applied one or more profiles to a JSON:API\ndocument.\n\n### Client Responsibilities\n\nWhen processing a JSON:API response document, clients **MUST** ignore any\nparameters other than `ext` and `profile` parameters in the server’s\n`Content-Type` header.\n\nA client **MAY** use the `ext` media type parameter in an `Accept` header to\nrequire that a server apply all the specified extensions to the response\ndocument.\n\nA client **MAY** use the `profile` media type parameter in an `Accept` header\nto request that the server apply one or more profiles to the response document.\n\n> Note: A client is allowed to send more than one acceptable media type in the\n> `Accept` header, including multiple instances of the JSON:API media type. This\n> allows clients to request different combinations of the `ext` and `profile`\n> media type parameters. A client can use [quality values](https://tools.ietf.org/html/rfc7231#section-5.3.2)\n> to indicate that some combinations are less preferable than others. Media types\n> specified without a qvalue are equally preferable to each other, regardless of\n> their order, and are always considered more preferable than a media type with a\n> qvalue less than 1.\n\n### Server Responsibilities\n\nIf a request specifies the `Content-Type` header with the JSON:API media type,\nservers **MUST** respond with a `415 Unsupported Media Type` status code if\nthat media type contains any media type parameters other than `ext` or\n`profile`.\n\nIf a request specifies the `Content-Type` header with an instance of\nthe JSON:API media type modified by the `ext` media type parameter and that\nparameter contains an unsupported extension URI, the server **MUST** respond\nwith a `415 Unsupported Media Type` status code.\n\n> Note: JSON:API servers that do not support version 1.1 of this specification\n> will respond with a `415 Unsupported Media Type` client error if the `ext` or\n> `profile` media type parameter is present.\n\nIf a request’s `Accept` header contains an instance of the JSON:API media type,\nservers **MUST** ignore instances of that media type which are modified by a\nmedia type parameter other than `ext` or `profile`. If all instances of that\nmedia type are modified with a media type parameter other than `ext` or `profile`,\nservers **MUST** respond with a `406 Not Acceptable` status code. If every\ninstance of that media type is modified by the `ext` parameter and each contains\nat least one unsupported extension URI, the server **MUST** also respond with a\n`406 Not Acceptable`.\n\nIf the `profile` parameter is received, a server **SHOULD** attempt to apply any\nrequested profile(s) to its response. A server **MUST** ignore any profiles\nthat it does not recognize.\n\n> Note: The above rules guarantee strict agreement on extensions between the\n> client and server, while the application of profiles is left to the discretion\n> of the server.\n\nServers that support the `ext` or `profile` media type parameters **SHOULD**\nspecify the `Vary` header with `Accept` as one of its values. This applies to\nresponses with and without any profiles or extensions applied.\n\n> Note: Some HTTP intermediaries (e.g. CDNs) may ignore the `Vary` header\n> unless specifically configured to respect it.\n\n## Document Structure\n\nThis section describes the structure of a JSON:API document, which is identified\nby the JSON:API media type. JSON:API documents are\ndefined in JavaScript Object Notation (JSON) [[RFC8259](http://tools.ietf.org/html/rfc8259)].\n\nAlthough the same media type is used for both request and response documents,\ncertain aspects are only applicable to one or the other. These differences are\ncalled out below.\n\nExtensions **MAY** define new members within the document structure. These\nmembers **MUST** comply with the naming requirements specified\nbelow.\n\nUnless otherwise noted, objects defined by this specification or any applied\nextensions **MUST NOT** contain any additional members. Client and server\nimplementations **MUST** ignore non-compliant members.\n\n> Note: These conditions allow this specification to evolve through additive\n> changes.\n\n### Top Level\n\nA JSON object **MUST** be at the root of every JSON:API request and response\ndocument containing data. This object defines a document’s “top level”.\n\nA document **MUST** contain at least one of the following top-level members:\n\n- `data` : the document’s “primary data”.\n- `errors` : an array of error objects .\n- `meta` : a meta object that contains non-standard\nmeta-information.\n- a member defined by an applied extension .\n\nThe members `data` and `errors` **MUST NOT** coexist in the same document.\n\nA document **MAY** contain any of these top-level members:\n\n- `jsonapi` : an object describing the server’s implementation.\n- `links` : a links object related to the document as a whole.\n- `included` : an array of resource objects that are related to the primary\ndata and/or each other (“included resources”).\n\nIf a document does not contain a top-level `data` key, the `included` member\n**MUST NOT** be present either.\n\nThe top-level links object **MAY** contain the following members:\n\n- `self` : the link that generated the current response document. If a\ndocument has extensions or profiles applied to it, this link **SHOULD** be\nrepresented by a link object with the `type` target attribute specifying the\nJSON:API media type with all applicable parameters.\n- `related` : a related resource link when the primary data represents a\nresource relationship.\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the current document.\n- pagination links for the primary data.\n\n> Note: The `self` link in the top-level `links` object allows a client to\n> refresh the data represented by the current response document. The client\n> should be able to use the provided link without applying any additional\n> information. Therefore the link must contain the query parameters provided\n> by the client to generate the response document. This includes but is not\n> limited to query parameters used for inclusion of related resources,\n> sparse fieldsets, sorting,\n> pagination and filtering.\n\nThe document’s “primary data” is a representation of the resource or collection\nof resources targeted by a request.\n\nPrimary data **MUST** be either:\n\n- a single resource object , a single resource identifier object , or `null` ,\nfor requests that target single resources\n- an array of resource objects , an array of resource identifier objects , or\nan empty array ( `[]` ), for requests that target resource collections\n\nFor example, the following primary data is a single resource object:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { // ... this article's attributes }, \"relationships\": { // ... this article's relationships } } } \n```\n\nThe following primary data is a single resource identifier object that\nreferences the same resource:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\" } } \n```\n\nA logical collection of resources **MUST** be represented as an array, even if\nit only contains one item or is empty.\n\n### Resource Objects\n\n“Resource objects” appear in a JSON:API document to represent resources.\n\nA resource object **MUST** contain at least the following top-level members:\n\n- `id`\n- `type`\n\nException: The `id` member is not required when the resource object originates\nat the client and represents a new resource to be created on the server. In that\ncase, a client **MAY** include a `lid` member to uniquely identify the resource\nby `type` *locally* within the document.\n\nIn addition, a resource object **MAY** contain any of these top-level members:\n\n- `attributes` : an attributes object representing some of the resource’s data.\n- `relationships` : a relationships object describing relationships between\n the resource and other JSON:API resources.\n- `links` : a links object containing links related to the resource.\n- `meta` : a meta object containing non-standard meta-information about a\nresource that can not be represented as an attribute or relationship.\n\nHere’s how an article (i.e. a resource of type “articles”) might appear in a document:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } // ... \n```\n\n#### Identification\n\nAs noted above, every resource object **MUST** contain a\n`type` member. Every resource object **MUST** also contain an `id` member,\nexcept when the resource object originates at the client and represents a new\nresource to be created on the server. If `id` is omitted due to this exception,\na `lid` member **MAY** be included to uniquely identify the resource by `type` *locally* within the document. The value of the `lid` member **MUST** be\nidentical for every representation of the resource in the document, including\nresource identifier objects.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nWithin a given API, each resource object’s `type` and `id` pair **MUST**\nidentify a single, unique resource. (The set of URIs controlled by a server,\nor multiple servers acting as one, constitute an API.)\n\nThe `type` member is used to describe resource objects that share common\nattributes and relationships.\n\nThe values of `type` members **MUST** adhere to the same constraints as\nmember names.\n\n> Note: This spec is agnostic about inflection rules, so the value of `type`\n> can be either plural or singular. However, the same value should be used\n> consistently throughout an implementation.\n\n#### Fields\n\nA resource object’s attributes and its relationships are collectively called\nits “fields”.\n\nFields for a resource object **MUST** share a common namespace with each\nother and with `type` and `id`. In other words, a resource can not have an\nattribute and relationship with the same name, nor can it have an attribute\nor relationship named `type` or `id`.\n\n##### Attributes\n\nThe value of the `attributes` key **MUST** be an object (an “attributes\nobject”). Members of the attributes object (“attributes”) represent information\nabout the resource object in which it’s defined.\n\nAttributes may contain any valid JSON value, including complex data structures\ninvolving JSON objects and arrays.\n\nKeys that reference related resources (e.g. `author_id`) **SHOULD NOT** appear\nas attributes. Instead, relationships **SHOULD** be used.\n\n> Note: See fields and member names for more restrictions on this container.\n\n##### Relationships\n\nThe value of the `relationships` key **MUST** be an object (a “relationships\nobject”). Each member of a relationships object represents\na “relationship” from the resource object\nin which it has been defined to other resource objects.\n\nRelationships may be to-one or to-many.\n\nA relationship’s name is given by its key. The value at that key **MUST** be an\nobject (“relationship object”).\n\nA “relationship object” **MUST** contain at least one of the following:\n\n- `links` : a links object containing at least one of the following:\n - `self` : a link for the relationship itself (a “relationship link”). This\n link allows the client to directly manipulate the relationship. For example,\n removing an `author` through an `article` ’s relationship URL would disconnect\n the person from the `article` without deleting the `people` resource itself.\n When fetched successfully, this link returns the linkage for the related resources as its primary data.\n (See Fetching Relationships .)\n - `related` : a related resource link\n - a member defined by an applied extension .\n- `data` : resource linkage\n- `meta` : a meta object that contains non-standard meta-information about the\nrelationship.\n- a member defined by an applied extension .\n\nA relationship object that represents a to-many relationship **MAY** also contain\npagination links under the `links` member, as described below. Any\npagination links in a relationship object **MUST** paginate the relationship\ndata, not the related resources.\n\n> Note: See fields and member names for more restrictions on this container.\n\nA “related resource link” provides access to resource objects linked\nin a relationship. When fetched, the related resource object(s)\nare returned as the response’s primary data.\n\nFor example, an `article`’s `comments` relationship could\nspecify a link that returns a collection of comment resource objects\nwhen retrieved through a `GET` request.\n\nIf present, a related resource link **MUST** reference a valid URL, even if the\nrelationship isn’t currently associated with any target resources. Additionally,\na related resource link **MUST NOT** change because its relationship’s content\nchanges.\n\n##### Resource Linkage\n\nResource linkage in a compound document allows a client to link together all\nof the included resource objects without having to `GET` any URLs via links.\n\nResource linkage **MUST** be represented as one of the following:\n\n- `null` for empty to-one relationships.\n- an empty array ( `[]` ) for empty to-many relationships.\n- a single resource identifier object for non-empty to-one relationships.\n- an array of resource identifier objects for non-empty to-many relationships.\n\n> Note: The spec does not impart meaning to order of resource identifier\n> objects in linkage arrays of to-many relationships, although implementations\n> may do that. Arrays of resource identifier objects may represent ordered\n> or unordered relationships, and both types can be mixed in one response\n> object.\n\nFor example, the following article is associated with an `author`:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nThe `author` relationship includes a link for the relationship itself (which\nallows the client to change the related author directly), a related resource\nlink to fetch the resource objects, and linkage information.\n\n#### Resource Links\n\nThe optional `links` member within each resource object contains links\nrelated to the resource.\n\nIf present, this links object **MAY** contain a `self` link that\nidentifies the resource represented by the resource object.\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nA server **MUST** respond to a `GET` request to the specified URL with a\nresponse that includes the resource as the primary data.\n\n### Resource Identifier Objects\n\nA “resource identifier object” is an object that identifies an individual\nresource.\n\nA “resource identifier object” **MUST** contain a `type` member. It **MUST**\nalso contain an `id` member, except when it represents a new resource to be\ncreated on the server. In this case, a `lid` member **MUST** be included that\nidentifies the new resource.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nA “resource identifier object” **MAY** also include a `meta` member, whose value is a meta object that\ncontains non-standard meta-information.\n\n### Compound Documents\n\nServers **MAY** allow responses that include related resources along with the\nrequested primary resources. Such responses are called “compound documents”.\n\nIn a compound document, all included resources **MUST** be represented as an\narray of resource objects in a top-level `included` member.\n\nEvery included resource object **MUST** be identified via a chain of\nrelationships originating in a document’s primary data. This means that\ncompound documents require “full linkage” and that no resource object can be\nincluded without a direct or indirect relationship to the document’s primary\ndata.\n\nThe only exception to the full linkage requirement is when relationship fields\nthat would otherwise contain linkage data are excluded due to\nsparse fieldsets requested by the client.\n\nA complete example document with multiple included relationships:\n\n```\n{ \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"links\": { \"self\": \"http://example.com/articles/1\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }, \"comments\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": \"http://example.com/articles/1/comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"5\" }, { \"type\": \"comments\", \"id\": \"12\" } ] } } }], \"included\": [{ \"type\": \"people\", \"id\": \"9\", \"attributes\": { \"firstName\": \"Dan\", \"lastName\": \"Gebhardt\", \"twitter\": \"dgeb\" }, \"links\": { \"self\": \"http://example.com/people/9\" } }, { \"type\": \"comments\", \"id\": \"5\", \"attributes\": { \"body\": \"First!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"2\" } } }, \"links\": { \"self\": \"http://example.com/comments/5\" } }, { \"type\": \"comments\", \"id\": \"12\", \"attributes\": { \"body\": \"I like XML better\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/comments/12\" } }] } \n```\n\nA compound document **MUST NOT** include more than one resource object for\neach `type` and `id` pair.\n\n> Note: In a single document, you can think of the `type` and `id` as a\n> composite key that uniquely references resource objects in another part of\n> the document.\n\n> Note: For resources that do not contain an `id` member but do contain a `lid`,\n> the `lid` is sufficient to establish resource identity and thus linkage between\n> resource objects and resource identifier objects throughout the document.\n\n> Note: This approach ensures that a single canonical resource object is\n> returned with each response, even when the same resource is referenced\n> multiple times.\n\n### Meta Information\n\nWhere specified, a `meta` member can be used to include non-standard\nmeta-information. The value of each `meta` member **MUST** be an object (a\n“meta object”).\n\nAny members **MAY** be specified within `meta` objects.\n\nFor example:\n\n```\n{ \"meta\": { \"copyright\": \"Copyright 2015 Example Corp.\", \"authors\": [ \"Yehuda Katz\", \"Steve Klabnik\", \"Dan Gebhardt\", \"Tyler Kellen\" ] }, \"data\": { // ... } } \n```\n\n### Links\n\nWhere specified, a `links` member can be used to represent links. The value\nof this member **MUST** be an object (a “links object”).\n\nWithin this object, a link **MUST** be represented as either:\n\n- a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target,\n- a link object or\n- `null` if the link does not exist.\n\nA link’s relation type **SHOULD** be inferred from the name of the link unless the\nlink is a link object and the link object has a `rel` member.\n\nA link’s context is the top-level object, resource\nobject, or relationship object in which it\nappears.\n\nIn the example below, the `self` link is a string whereas the `related` link is\na link object. The `related` link object provides additional information\nabout the targeted related resource collection as well as a schema that serves\nas a description document for that collection:\n\n```\n\"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": { \"href\": \"http://example.com/articles/1/comments\", \"title\": \"Comments\", \"describedby\": \"http://example.com/schemas/article-comments\", \"meta\": { \"count\": 10 } } } \n```\n\n#### Link objects\n\nA “link object” is an object that represents a [web link](https://tools.ietf.org/html/rfc8288).\n\nA link object **MUST** contain the following member:\n\n- `href` : a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target.\n\nA link object **MAY** also contain any of the following members:\n\n- `rel` : a string indicating the link’s relation type. The string **MUST** be a [valid link relation type](https://tools.ietf.org/html/rfc8288#section-2.1) .\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the link target.\n- `title` : a string which serves as a label for the destination of a link\nsuch that it can be used as a human-readable identifier (e.g., a menu\nentry).\n- `type` : a string indicating the media type of the link’s target.\n- `hreflang` : a string or an array of strings indicating the language(s) of the\nlink’s target. An array of strings indicates that the link’s target is\navailable in multiple languages. Each string **MUST** be a valid language tag\n[ [RFC5646](https://tools.ietf.org/html/rfc5646) ].\n- `meta` : a meta object containing non-standard meta-information about the\nlink.\n\n> Note: the `type` and `hreflang` members are only hints; the target resource\n> is not guaranteed to be available in the indicated media type or language\n> when the link is actually followed.\n\n### JSON:API Object\n\nA JSON:API document **MAY** include information about its implementation\nunder a top level `jsonapi` member. If present, the value of the `jsonapi`\nmember **MUST** be an object (a “jsonapi object”).\n\nThe jsonapi object **MAY** contain any of the following members:\n\n- `version` - whose value is a string indicating the highest JSON:API version\nsupported.\n- `ext` - an array of URIs for all applied extensions .\n- `profile` - an array of URIs for all applied profiles .\n- `meta` - a meta object that contains non-standard meta-information.\n\nClients and servers **MUST NOT** use an `ext` or `profile` member for content\nnegotiation. Content negotiation **MUST** only happen based on media type\nparameters in `Content-Type` header.\n\nA simple example appears below:\n\n```\n{ \"jsonapi\": { \"version\": \"1.1\", \"ext\": [ \"https://jsonapi.org/ext/atomic\" ], \"profile\": [ \"http://example.com/profiles/flexible-pagination\", \"http://example.com/profiles/resource-versioning\" ] } } \n```\n\nIf the `version` member is not present, clients should assume the server\nimplements at least version 1.0 of the specification.\n\n> Note: Because JSON:API is committed to making additive changes only, the\n> version string primarily indicates which new features a server may support.\n\n### Member Names\n\nImplementation and profile defined member names used in a JSON:API document\n**MUST** be treated as case sensitive by clients and servers, and they **MUST**\nmeet all of the following conditions:\n\n- Member names **MUST** contain at least one character.\n- Member names **MUST** contain only the allowed characters listed below.\n- Member names **MUST** start and end with a “globally allowed character”,\nas defined below.\n\nTo enable an easy mapping of member names to URLs, it is **RECOMMENDED** that\nmember names use only non-reserved, URL safe characters specified in [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).\n\n#### Allowed Characters\n\nThe following “globally allowed characters” **MAY** be used anywhere in a member name:\n\n- U+0061 to U+007A, “a-z”\n- U+0041 to U+005A, “A-Z”\n- U+0030 to U+0039, “0-9”\n- U+0080 and above (non-ASCII Unicode characters; *not recommended, not URL safe* )\n\nAdditionally, the following characters are allowed in member names, except as the\nfirst or last character:\n\n- U+002D HYPHEN-MINUS, “-“\n- U+005F LOW LINE, “_”\n- U+0020 SPACE, “ “ *(not recommended, not URL safe)*\n\n#### Reserved Characters\n\nThe following characters **MUST NOT** be used in implementation and\nprofile defined member names:\n\n- U+002B PLUS SIGN, “+” *(has overloaded meaning in URL query strings)*\n- U+002C COMMA, “,” *(used as a separator between relationship paths)*\n- U+002E PERIOD, “.” *(used as a separator within relationship paths)*\n- U+005B LEFT SQUARE BRACKET, “[” *(used in query parameter families)*\n- U+005D RIGHT SQUARE BRACKET, “]” *(used in query parameter families)*\n- U+0021 EXCLAMATION MARK, “!”\n- U+0022 QUOTATION MARK, â€�”’\n- U+0023 NUMBER SIGN, “#”\n- U+0024 DOLLAR SIGN, “$”\n- U+0025 PERCENT SIGN, “%”\n- U+0026 AMPERSAND, “&”\n- U+0027 APOSTROPHE, “’”\n- U+0028 LEFT PARENTHESIS, “(“\n- U+0029 RIGHT PARENTHESIS, “)”\n- U+002A ASTERISK, “*”\n- U+002F SOLIDUS, “/”\n- U+003A COLON, “:”\n- U+003B SEMICOLON, “;”\n- U+003C LESS-THAN SIGN, “<”\n- U+003D EQUALS SIGN, “=”\n- U+003E GREATER-THAN SIGN, “>”\n- U+003F QUESTION MARK, “?”\n- U+0040 COMMERCIAL AT, “@” (except as first character in @-Members )\n- U+005C REVERSE SOLIDUS, “\\”\n- U+005E CIRCUMFLEX ACCENT, “^”\n- U+0060 GRAVE ACCENT, “`”\n- U+007B LEFT CURLY BRACKET, “{“\n- U+007C VERTICAL LINE, “|”\n- U+007D RIGHT CURLY BRACKET, “}”\n- U+007E TILDE, “~”\n- U+007F DELETE\n- U+0000 to U+001F (C0 Controls)\n\n#### @-Members\n\nMember names **MAY** also begin with an at sign (U+0040 COMMERCIAL AT, “@”).\nMembers named this way are called “@-Members”. @-Members **MAY** appear\nanywhere in a document.\n\nThis specification provides no guidance on the meaning or usage of @-Members,\nwhich are considered to be implementation semantics. @-Members\n**MUST** be ignored when interpreting this specification’s definitions and\nprocessing instructions given outside of this subsection. For example, an\nattribute is defined above as any member of the attributes object.\nHowever, because @-Members must be ignored when interpreting that definition, an\n@-Member that occurs in an attributes object is not an attribute.\n\n> Note: Among other things, “@” members can be used to add JSON-LD data to a\n> JSON:API document. Such documents should be served with [an extra header](http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld)\n> to convey to JSON-LD clients that they contain JSON-LD data.\n\n#### Extension Members\n\nThe name of every new member introduced by an extension **MUST** be prefixed\nwith the extension’s namespace followed by a colon (`:`).\nThe remainder of the name **MUST** adhere to the rules for implementation\ndefined member names.\n\n## Fetching Data\n\nData, including resources and relationships, can be fetched by sending a\n`GET` request to an endpoint.\n\nResponses can be further refined with the optional features described below.\n\n### Fetching Resources\n\nA server **MUST** support fetching resource data for every URL provided as:\n\n- a `self` link as part of the top-level links object\n- a `self` link as part of a resource-level links object\n- a `related` link as part of a relationship-level links object\n\nFor example, the following request fetches a collection of articles:\n\n```\nGET /articles HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe following request fetches an article:\n\n```\nGET /articles/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches an article’s author:\n\n```\nGET /articles/1/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch an individual\nresource or resource collection with a `200 OK` response.\n\nA server **MUST** respond to a successful request to fetch a resource\ncollection with an array of resource objects or an empty array (`[]`) as\nthe response document’s primary data.\n\nFor example, a `GET` request to a collection of articles could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" } }, { \"type\": \"articles\", \"id\": \"2\", \"attributes\": { \"title\": \"Rails is Omakase\" } }] } \n```\n\nA similar response representing an empty collection would be:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [] } \n```\n\nA server **MUST** respond to a successful request to fetch an individual\nresource with a resource object or `null` provided as\nthe response document’s primary data.\n\n`null` is only an appropriate response when the requested URL is one that\nmight correspond to a single resource, but doesn’t currently.\n\n> Note: Consider, for example, a request to fetch a to-one related resource link.\n> This request would respond with `null` when the relationship is empty (such that\n> the link is corresponding to no resources) but with the single related resource’s\n> resource object otherwise.\n\nFor example, a `GET` request to an individual article could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1\" }, \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"related\": \"http://example.com/articles/1/author\" } } } } } \n```\n\nIf the above article’s author is missing, then a `GET` request to that related\nresource would return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1/author\" }, \"data\": null } \n```\n\n##### 404 Not Found\n\nA server **MUST** respond with `404 Not Found` when processing a request to\nfetch a single resource that does not exist, except when the request warrants a\n`200 OK` response with `null` as the primary data (as described above).\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Fetching Relationships\n\nA server **MUST** support fetching relationship data for every relationship URL\nprovided as a `self` link as part of a relationship’s `links` object.\n\nFor example, the following request fetches data about an article’s comments:\n\n```\nGET /articles/1/relationships/comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches data about an article’s author:\n\n```\nGET /articles/1/relationships/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch a relationship\nwith a `200 OK` response.\n\nThe primary data in the response document **MUST** match the appropriate\nvalue for resource linkage, as described above for\nrelationship objects.\n\nThe top-level links object **MAY** contain `self` and `related` links,\nas described above for relationship objects.\n\nFor example, a `GET` request to a URL from a to-one relationship link could\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": null } \n```\n\nA `GET` request to a URL from a to-many relationship link could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [] } \n```\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to fetch\na relationship link URL that does not exist.\n\n> Note: This can happen when the parent resource of the relationship\n> does not exist. For example, when `/articles/1` does not exist, request to\n> `/articles/1/relationships/tags` returns `404 Not Found`.\n\nIf a relationship link URL exists but the relationship is empty, then\n`200 OK` **MUST** be returned, as described above.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\nAn endpoint **MAY** return resources related to the primary data by default.\n\nAn endpoint **MAY** also support an `include` query parameter to allow the\nclient to customize which related resources should be returned.\n\nIf an endpoint does not support the `include` parameter, it **MUST** respond\nwith `400 Bad Request` to any requests that include it.\n\nIf an endpoint supports the `include` parameter and a client supplies it:\n\n- The server’s response **MUST** be a compound document with an `included` key — even if that `included` key holds an empty array (because the requested relationships are empty).\n- The server **MUST NOT** include unrequested resource objects in the `included` section of the compound document .\n\nThe value of the `include` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list of relationship paths. A relationship path is a dot-separated\n(U+002E FULL-STOP, “.”) list of relationship names. An empty\nvalue indicates that no related resources should be returned.\n\nIf a server is unable to identify a relationship path or does not support\ninclusion of resources from a path, it **MUST** respond with 400 Bad Request.\n\n> Note: For example, a relationship path could be `comments.author`, where\n> `comments` is a relationship listed under a `articles` resource object, and\n> `author` is a relationship listed under a `comments` resource object.\n\nFor instance, comments could be requested with an article:\n\n```\nGET /articles/1?include=comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn order to request resources related to other resources, a dot-separated path\nfor each relationship name can be specified:\n\n```\nGET /articles/1?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: Because compound documents require full linkage\n> (except when relationship linkage is excluded by sparse fieldsets), intermediate\n> resources in a multi-part path must be returned along with the leaf nodes. For\n> example, a response to a request for `comments.author` should include `comments`\n> as well as the `author` of each of those `comments`.\n\n> Note: A server may choose to expose a deeply nested relationship such as\n> `comments.author` as a direct relationship with an alternative name such as\n> `commentAuthors`. This would allow a client to request\n> `/articles/1?include=commentAuthors` instead of\n> `/articles/1?include=comments.author`. By exposing the nested relationship with\n> an alternative name, the server can still provide full linkage in compound\n> documents without including potentially unwanted intermediate resources.\n\nMultiple related resources can be requested in a comma-separated list:\n\n```\nGET /articles/1?include=comments.author,ratings HTTP/1.1 Accept: application/vnd.api+json \n```\n\nFurthermore, related resources can be requested from a relationship endpoint:\n\n```\nGET /articles/1/relationships/comments?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn this case, the primary data would be a collection of\nresource identifier objects that represent linkage to comments for an article,\nwhile the full comments and comment authors would be returned as included data.\n\n> Note: This section applies to any endpoint that responds with primary\n> data, regardless of the request type. For instance, a server could support\n> the inclusion of related resources along with a `POST` request to create a\n> resource or relationship.\n\n### Sparse Fieldsets\n\nA client **MAY** request that an endpoint return only specific fields in the\nresponse on a per-type basis by including a `fields[TYPE]` query parameter.\n\nThe value of any `fields[TYPE]` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list that refers to the name(s) of the fields to be returned.\nAn empty value indicates that no fields should be returned.\n\nIf a client requests a restricted set of fields for a given resource type,\nan endpoint **MUST NOT** include additional fields in resource objects of\nthat type in its response.\n\nIf a client does not specify the set of fields for a given resource type, the\nserver **MAY** send all fields, a subset of fields, or no fields for that\nresource type.\n\n```\nGET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply for\n> readability. In practice, these characters should be percent-encoded. See\n> “Square Brackets in Parameter Names”.\n\n> Note: This section applies to any endpoint that responds with resources as\n> primary or included data, regardless of the request type. For instance, a\n> server could support sparse fieldsets along with a `POST` request to create\n> a resource.\n\n### Sorting\n\nA server **MAY** choose to support requests to sort resource collections\naccording to one or more criteria (“sort fields”).\n\n> Note: Although recommended, sort fields do not necessarily need to\n> correspond to resource attribute and relationship names.\n\n> Note: It is recommended that dot-separated (U+002E FULL-STOP, “.”) sort\n> fields be used to request sorting based upon relationship attributes. For\n> example, a sort field of `author.name` could be used to request that the\n> primary data be sorted based upon the `name` attribute of the `author`\n> relationship.\n\nAn endpoint **MAY** support requests to sort the primary data with a `sort`\nquery parameter. The value for `sort` **MUST** represent sort fields.\n\n```\nGET /people?sort=age HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAn endpoint **MAY** support multiple sort fields by allowing comma-separated\n(U+002C COMMA, “,”) sort fields. Sort fields **SHOULD** be applied in the\norder specified.\n\n```\nGET /people?sort=age,name HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe sort order for each sort field **MUST** be ascending unless it is prefixed\nwith a minus (U+002D HYPHEN-MINUS, “-“), in which case it **MUST** be descending.\n\n```\nGET /articles?sort=-created,title HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe above example should return the newest articles first. Any articles\ncreated on the same date will then be sorted by their title in ascending\nalphabetical order.\n\nIf the server does not support sorting as specified in the query parameter\n`sort`, it **MUST** return `400 Bad Request`.\n\nIf sorting is supported by the server and requested by the client via query\nparameter `sort`, the server **MUST** return elements of the top-level\n`data` array of the response ordered according to the criteria specified.\nThe server **MAY** apply default sorting rules to top-level `data` if\nrequest parameter `sort` is not specified.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\nA server **MAY** choose to limit the number of resources returned in a response\nto a subset (“page”) of the whole set available.\n\nA server **MAY** provide links to traverse a paginated data set (“pagination\nlinks”).\n\nPagination links **MUST** appear in the links object that corresponds to a\ncollection. To paginate the primary data, supply pagination links in the\ntop-level `links` object. To paginate an included collection returned in\na compound document, supply pagination links in the corresponding links\nobject.\n\nThe following keys **MUST** be used for pagination links:\n\n- `first` : the first page of data\n- `last` : the last page of data\n- `prev` : the previous page of data\n- `next` : the next page of data\n\nKeys **MUST** either be omitted or have a `null` value to indicate that a\nparticular link is unavailable.\n\nConcepts of order, as expressed in the naming of pagination links, **MUST**\nremain consistent with JSON:API’s sorting rules.\n\nThe `page` query parameter family is reserved for pagination. Servers and\nclients **SHOULD** use these parameters for pagination operations.\n\n> Note: JSON API is agnostic about the pagination strategy used by a server, but\n> the `page` query parameter family can be used regardless of the strategy\n> employed. For example, a page-based strategy might use query parameters such\n> as `page[number]` and `page[size]`, while a cursor-based strategy might use\n> `page[cursor]`.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\n### Filtering\n\nThe `filter` query parameter family is reserved for filtering data. Servers\nand clients **SHOULD** use these parameters for filtering operations.\n\n> Note: JSON API is agnostic about the strategies supported by a server.\n\n## Creating, Updating and Deleting Resources\n\nA server **MAY** allow resources of a given type to be created. It **MAY**\nalso allow existing resources to be modified or deleted.\n\nA request **MUST** completely succeed or fail (in a single “transaction”). No\npartial updates are allowed.\n\n> Note: The `type` member is required in every resource object throughout requests and\n> responses in JSON:API. There are some cases, such as when `POST`ing to an\n> endpoint representing heterogeneous data, when the `type` could not be inferred\n> from the endpoint. However, picking and choosing when it is required would be\n> confusing; it would be hard to remember when it was required and when it was\n> not. Therefore, to improve consistency and minimize confusion, `type` is\n> always required.\n\n### Creating Resources\n\nA resource can be created by sending a `POST` request to a URL that represents\na collection of resources. The request **MUST** include a single resource object\nas primary data. The resource object **MUST** contain at least a `type` member.\n\nFor instance, a new photo might be created with the following request:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"relationships\": { \"photographer\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } } \n```\n\nIf a relationship is provided in the `relationships` member of the\nresource object, its value **MUST** be a relationship object with a `data`\nmember. The value of this key represents the linkage the new resource is to\nhave.\n\n#### Client-Generated IDs\n\nA server **MAY** accept a client-generated ID along with a request to create\na resource. An ID **MUST** be specified with an `id` key, the value of\nwhich **MUST** be a universally unique identifier. The client **SHOULD** use\na properly generated and formatted *UUID* as described in RFC 4122\n[[RFC4122](http://tools.ietf.org/html/rfc4122.html)].\n\n> NOTE: In some use-cases, such as importing data from another source, it\n> may be possible to use something other than a UUID that is still guaranteed\n> to be globally unique. Do not use anything other than a UUID unless you are\n> 100% confident that the strategy you are using indeed generates globally\n> unique identifiers.\n\nFor example:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" } } } \n```\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto create a resource with a client-generated ID.\n\n#### Responses\n\n##### 201 Created\n\nIf the requested resource has been created successfully and the server changes\nthe resource in any way (for example, by assigning an `id`), the server **MUST**\nreturn a `201 Created` response and a document that contains the resource as\nprimary data.\n\nThe response **SHOULD** include a `Location` header identifying the location\nof the newly created resource, in order to comply with [RFC\n7231](http://tools.ietf.org/html/rfc7231#section-6.3.2).\n\nIf the resource object returned by the response contains a `self` key in its\n`links` member and a `Location` header is provided, the value of the `self`\nmember **MUST** match the value of the `Location` header.\n\n```\nHTTP/1.1 201 Created Location: http://example.com/photos/550e8400-e29b-41d4-a716-446655440000 Content-Type: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"links\": { \"self\": \"http://example.com/photos/550e8400-e29b-41d4-a716-446655440000\" } } } \n```\n\nA server **MAY** return a `201 Created` response with a document that contains\nno primary data if the requested resource has been created successfully and the\nserver does not change the resource in any way (for example, by assigning an\n`id` or `createdAt` attribute). Other top-level members, such as meta, could\nbe included in the response document.\n\n> Note: Only servers that accept Client-Generated\n> IDs can avoid assigning an `id` to a new resource.\n\n##### 202 Accepted\n\nIf a request to create a resource has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf the requested resource has been created successfully and the server does not\nchange the resource in any way (for example, by assigning an `id` or `createdAt`\nattribute), the server **MUST** return either a `201 Created` status code and\nresponse document (as described above) or a `204 No Content` status code with no\nresponse document.\n\n##### 403 Forbidden\n\nA server **MAY** return `403 Forbidden` in response to an unsupported request\nto create a resource.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MUST** return `409 Conflict` when processing a `POST` request to\ncreate a resource with a client-generated ID that already exists.\n\nA server **MUST** return `409 Conflict` when processing a `POST` request in\nwhich the resource object’s `type` is not among the type(s) that constitute the\ncollection represented by the endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Resources\n\nA resource can be updated by sending a `PATCH` request to the URL that\nrepresents the resource.\n\nThe URL for a resource can be obtained in the `self` link of the resource\nobject. Alternatively, when a `GET` request returns a single resource object as\nprimary data, the same request URL can be used for updates.\n\nThe `PATCH` request **MUST** include a single resource object as primary data.\nThe resource object **MUST** contain `type` and `id` members.\n\nFor example:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\" } } } \n```\n\n#### Updating a Resource’s Attributes\n\nAny or all of a resource’s attributes **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the attributes for a resource, the server\n**MUST** interpret the missing attributes as if they were included with their\ncurrent values. The server **MUST NOT** interpret missing attributes as `null`\nvalues.\n\nFor example, the following `PATCH` request is interpreted as a request to\nupdate only the `title` and `text` attributes of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\", \"text\": \"TLDR; It's complicated... but check your test coverage regardless.\" } } } \n```\n\n#### Updating a Resource’s Relationships\n\nAny or all of a resource’s relationships **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the relationships for a resource, the server\n**MUST** interpret the missing relationships as if they were included with their\ncurrent values. It **MUST NOT** interpret them as `null` or empty values.\n\nIf a relationship is provided in the `relationships` member of a resource\nobject in a `PATCH` request, its value **MUST** be a relationship object\nwith a `data` member. The relationship’s value will be replaced with the\nvalue specified in this member.\n\nFor instance, the following `PATCH` request will update the `author` relationship of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"1\" } } } } } \n```\n\nLikewise, the following `PATCH` request performs a complete replacement of\nthe `tags` for an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"tags\": { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } } } } \n```\n\nA server **MAY** reject an attempt to do a full replacement of a to-many\nrelationship. In such a case, the server **MUST** reject the entire update,\nand return a `403 Forbidden` response.\n\n> Note: Since full replacement may be a very dangerous operation, a server\n> may choose to disallow it. For example, a server may reject full replacement if\n> it has not provided the client with the full list of associated objects, and\n> does not want to allow deletion of records the client has not seen.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted resource in ways\nother than those specified by the request (for example, updating the\n`updatedAt` attribute or a computed `sha`), it **MUST** return a `200 OK`\nresponse and a document that contains the updated resource as primary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted resource in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf an update request has been accepted for processing, but the processing\nhas not been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nresource in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a resource or relationship.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to modify\na resource that does not exist.\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MAY** return `409 Conflict` when processing a `PATCH` request to\nupdate a resource if that update would violate other server-enforced\nconstraints (such as a uniqueness constraint on a property other than `id`).\n\nA server **MUST** return `409 Conflict` when processing a `PATCH` request in\nwhich the resource object’s `type` or `id` do not match the server’s endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Relationships\n\nAlthough relationships can be modified along with resources (as described\nabove), JSON:API also supports updating of relationships independently at\nURLs from relationship links.\n\n> Note: Relationships are updated without exposing the underlying server\n> semantics, such as foreign keys. Furthermore, relationships can be updated\n> without necessarily affecting the related resources. For example, if an article\n> has many authors, it is possible to remove one of the authors from the article\n> without deleting the person itself. Similarly, if an article has many tags, it\n> is possible to add or remove tags. Under the hood on the server, the first\n> of these examples might be implemented with a foreign key, while the second\n> could be implemented with a join table, but the JSON:API protocol would be\n> the same in both cases.\n\n> Note: A server may choose to delete the underlying resource if a\n> relationship is deleted (as a garbage collection measure).\n\n#### Updating To-One Relationships\n\nA to-one relationship can be updated by sending a `PATCH` request to a URL\nfrom a to-one relationship link.\n\nThe `PATCH` request **MUST** include a top-level member named `data` containing\none of:\n\n- a resource identifier object corresponding to the new related resource.\n- `null` , to remove the relationship.\n\nFor example, the following request updates the author of an article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nAnd the following request clears the author of the same article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": null } \n```\n\nIf the relationship is updated successfully then the server **MUST** return\na successful response.\n\n#### Updating To-Many Relationships\n\nA to-many relationship can be updated by sending a `PATCH`, `POST`, or\n`DELETE` request to a URL from a to-many relationship link.\n\nFor all request types, the body **MUST** contain a `data` member whose value\nis an empty array or an array of resource identifier objects.\n\nIf a client makes a `PATCH` request to a URL from a to-many\nrelationship link, the server **MUST** either completely\nreplace every member of the relationship, return an appropriate error response\nif some resources cannot be found or accessed, or return a `403 Forbidden`\nresponse if complete replacement is not allowed by the server.\n\nFor example, the following request replaces every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nAnd the following request clears every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [] } \n```\n\nIf a client makes a `POST` request to a URL from a\nrelationship link, the server **MUST** add the specified\nmembers to the relationship unless they are already present. If a given `type`\nand `id` is already in the relationship, the server **MUST NOT** add it again.\n\n> Note: This matches the semantics of databases that use foreign keys for\n> has-many relationships. Document-based storage should check the has-many\n> relationship before appending to avoid duplicates.\n\nIf all of the specified resources can be added to, or are already present\nin, the relationship then the server **MUST** return a successful response.\n\n> Note: This approach ensures that a request is successful if the server’s\n> state matches the requested state, and helps avoid pointless race conditions\n> caused by multiple clients making the same changes to a relationship.\n\nIn the following example, the comment with ID `123` is added to the list of\ncomments for the article with ID `1`:\n\n```\nPOST /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"123\" } ] } \n```\n\nIf the client makes a `DELETE` request to a URL from a\nrelationship link the server **MUST** delete the specified\nmembers from the relationship or return a `403 Forbidden` response. If all of\nthe specified resources are able to be removed from, or are already missing\nfrom, the relationship then the server **MUST** return a successful response.\n\n> Note: As described above for `POST` requests, this approach helps avoid\n> pointless race conditions between multiple clients making the same changes.\n\nRelationship members are specified in the same way as in the `POST` request.\n\nIn the following example, comments with IDs of `12` and `13` are removed\nfrom the list of comments for the article with ID `1`:\n\n```\nDELETE /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"12\" }, { \"type\": \"comments\", \"id\": \"13\" } ] } \n```\n\n> Note: RFC 7231 specifies that a DELETE request may include a body, but\n> that a server may reject the request. This spec defines the semantics of a\n> server, and we are defining its semantics for JSON:API.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted relationship in\nother ways than those specified by the request, it **MUST** return a `200 OK`\nresponse and a document that includes the updated relationship data as its\nprimary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted relationship in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a relationship update request has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nrelationship in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n> Note: This is the appropriate response to a `POST` request sent to a URL\n> from a to-many relationship link when that relationship already\n> exists. It is also the appropriate response to a `DELETE` request sent to a URL\n> from a to-many relationship link when that relationship does\n> not exist.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a relationship.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Deleting Resources\n\nA resource can be deleted by sending a `DELETE` request to the URL\nthat represents the resource:\n\n```\nDELETE /photos/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if a deletion request is successful. Other top-level members, such\nas meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a deletion request has been accepted for processing, but the processing has\nnot been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf a deletion request is successful, the server **MUST** return either a `200\nOK` status code and response document (as described above) or a `204 No Content`\nstatus code with no response document.\n\n##### 404 NOT FOUND\n\nA server **SHOULD** return a `404 Not Found` status code if a deletion request fails\ndue to the resource not existing.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n## Query Parameters\n\n### Query Parameter Families\n\nAlthough “query parameter” is a common term in everyday web development, it is\nnot a well-standardized concept. Therefore, JSON:API provides its own\ndefinition of a query parameter.\n\nFor the most part, JSON:API’s definition coincides with colloquial usage, and its\ndetails can be safely ignored. However, one important consequence of this\ndefinition is that a URL like the following is considered to have two distinct\nquery parameters:\n\n```\n/?page[offset]=0&page[limit]=10\n```\n\nThe two parameters are named `page[offset]` and `page[limit]`; there is no\nsingle `page` parameter.\n\nIn practice, however, parameters like `page[offset]` and `page[limit]` are\nusually defined and processed together, and it’s convenient to refer to them\ncollectively. Therefore, JSON:API introduces the concept of a query parameter\nfamily.\n\nA “query parameter family” is the set of all query parameters whose name starts\nwith a “base name”, followed by zero or more instances of empty square brackets\n(i.e. `[]`), square-bracketed legal member names, or square-bracketed\ndot-separated lists of legal member names. The family is referred to\nby its base name.\n\nFor example, the `filter` query parameter family includes parameters named:\n`filter`, `filter[x]`, `filter[]`, `filter[x][]`, `filter[][]`, `filter[x][y]`,\n`filter[x.y]`, etc. However, `filter[_]` is not a valid parameter name in the\nfamily, because `_` is not a valid member name.\n\n> Note: Dot separated lists of legal member names are intended to be used for\n> relationship paths. For example, this allows filtering strategies using\n> relationship paths as defined for sorting in query parameters\n> such as `GET /posts?sort=author.name&filter[author.status]=active`.\n\n### Extension-Specific Query Parameters\n\nThe base name of every query parameter introduced by an extension **MUST** be\nprefixed with the extension’s namespace followed by a colon (`:`). The\nremainder of the base name **MUST** contain only the characters [a-z] (U+0061\nto U+007A, “a-z”).\n\n### Implementation-Specific Query Parameters\n\nImplementations **MAY** support custom query parameters. However, the names of\nthese query parameters **MUST** come from a family\nwhose base name is a legal member name and also contains at least\none non a-z character (i.e., outside U+0061 to U+007A).\n\nIt is **RECOMMENDED** that a capital letter (e.g. camelCasing) be used to\nsatisfy the above requirement.\n\nIf a server encounters a query parameter that does not follow the naming\nconventions above, or the server does not know how to process it as a query\nparameter from this specification, it **MUST** return `400 Bad Request`.\n\n> Note: By forbidding the use of query parameters that contain only the characters\n> [a-z], JSON:API is reserving the ability to standardize additional query\n> parameters later without conflicting with existing implementations.\n\n## Errors\n\n### Processing Errors\n\nA server **MAY** choose to stop processing as soon as a problem is encountered,\nor it **MAY** continue processing and encounter multiple problems. For instance,\na server might process multiple attributes and then return multiple validation\nproblems in a single response.\n\nWhen a server encounters multiple problems for a single request, the most\ngenerally applicable HTTP error code **SHOULD** be used in the response. For\ninstance, `400 Bad Request` might be appropriate for multiple 4xx errors\nor `500 Internal Server Error` might be appropriate for multiple 5xx errors.\n\n### Error Objects\n\nError objects provide additional information about problems encountered while\nperforming an operation. Error objects **MUST** be returned as an array\nkeyed by `errors` in the top level of a JSON:API document.\n\nAn error object **MAY** have the following members, and **MUST** contain at\nleast one of:\n\n- `id` : a unique identifier for this particular occurrence of the problem.\n- `links` : a links object that **MAY** contain the following members:\n - `about` : a link that leads to further details about this\n particular occurrence of the problem. When dereferenced, this URI **SHOULD** return a human-readable description of the error.\n - `type` : a link that identifies the type of error that this\n particular error is an instance of. This URI **SHOULD** be dereferenceable to\n a human-readable explanation of the general error.\n- `status` : the HTTP status code applicable to this problem, expressed as a\nstring value. This **SHOULD** be provided.\n- `code` : an application-specific error code, expressed as a string value.\n- `title` : a short, human-readable summary of the problem that **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of\nlocalization.\n- `detail` : a human-readable explanation specific to this occurrence of the\nproblem. Like `title` , this field’s value can be localized.\n- `source` : an object containing references to the primary source of the error.\nIt **SHOULD** include one of the following members or be omitted:\n - `pointer` : a JSON Pointer [ [RFC6901](https://tools.ietf.org/html/rfc6901) ]\n to the value in the request document that caused the error [e.g. `\"/data\"` for a primary data object, or `\"/data/attributes/title\"` for a specific\n attribute]. This **MUST** point to a value in the request document that\n exists; if it doesn’t, the client **SHOULD** simply ignore the pointer.\n - `parameter` : a string indicating which URI query parameter caused\n the error.\n - `header` : a string indicating the name of a single request header which\n caused the error.\n- `meta` : a meta object containing non-standard meta-information about the\nerror.\n\n## Appendix\n\n### Query Parameters Details\n\n#### Parsing/Serialization\n\nA query parameter is a name–value pair extracted from, or serialized into, a\nURI’s query string.\n\nTo extract the query parameters from a URI, an implementation **MUST** run the\nURI’s query string, excluding the leading question mark, through the\n[`application/x-www-form-urlencoded` parsing algorithm](https://url.spec.whatwg.org/#urlencoded-parsing),\nwith one exception: JSON:API allows the specification that defines a query\nparameter’s usage to provide its own rules for parsing the parameter’s value\nfrom the `value` bytes identified in steps 3.2 and and 3.3 of the `application/x-www-form-urlencoded`\nparsing algorithm. The resulting value might not be a string.\n\n> Note: In general, the query string parsing built in to servers and browsers\n> will match the process specified above, so most implementations do not need\n> to worry about this.\n> \n> The `application/x-www-form-urlencoded` format is referenced because it is\n> the basis for the `a=b&c=d` style that almost all query strings use today.\n> \n> However, `application/x-www-form-urlencoded` parsing contains the bizarre\n> historical artifact that `+` characters must be treated as spaces, and it\n> requires that all values be percent-decoded during parsing, which makes it\n> impossible to use [RFC 3986 delimiter characters](https://tools.ietf.org/html/rfc3986#section-2.2)\n> as delimiters. These issues motivate the exception that JSON:API defines above.\n\nSimilarly, to serialize a query parameter into a URI, an implementation **MUST**\nuse [the `application/x-www-form-urlencoded` serializer](https://url.spec.whatwg.org/#concept-urlencoded-serializer),\nwith the corresponding exception that a parameter’s value — but not its name —\nmay be serialized differently than that algorithm requires, provided the\nserialization does not interfere with the ability to parse back the resulting URI.\n\n#### Square Brackets in Parameter Names\n\nWith query parameter families, JSON:API allows for\nquery parameters whose names contain square brackets (i.e., U+005B “[” and\nU+005D “]”).\n\nAccording to the query parameter serialization rules above, a compliant\nimplementation will percent-encode these square brackets. However, some URI\nproducers — namely browsers — do not always encode them. Servers **SHOULD**\naccept requests in which these square brackets are left unencoded in a query\nparameter’s name. If a server does accept these requests, it **MUST** treat the\nrequest as equivalent to one in which the square brackets were percent-encoded.", "znaku_textu": 74500, "slov": 11324, "odkazu": 140, "kodovani": "windows-1250", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/format", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:39", "sha256": "0561c0d7471422779fc231901aba8e90338b40abb20851689dafaa471df6cb4c", "hloubka": 0, "zdroj_objevu": "seed", "ze_seznamu": true, "mime": "text/html", "odkazy_externi": ["http://discuss.jsonapi.org/", "https://github.com/json-api/json-api", "http://www.iana.org/assignments/media-types/application/vnd.api+json", "https://tools.ietf.org/html/bcp14", "https://tools.ietf.org/html/rfc2119", "https://tools.ietf.org/html/rfc8174", "https://tools.ietf.org/html/rfc3986", "https://tools.ietf.org/html/rfc6906", "https://tools.ietf.org/html/rfc3339", "https://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc8259", "https://tools.ietf.org/html/rfc8288", "https://tools.ietf.org/html/rfc5646", "https://datatracker.ietf.org/doc/html/rfc3986", "http://www.w3.org/TR/json-ld/", "http://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc4122.html", "https://tools.ietf.org/html/rfc6901", "https://url.spec.whatwg.org/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/format/1.1/", "titulek": "JSON:API — Specification v1.1 (Archived Copy)", "h1": "Specification v1.1 (Archived Copy)", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Specification v1.1 (Archived Copy)"}, {"uroven": 2, "text": "Status"}, {"uroven": 2, "text": "Introduction"}, {"uroven": 2, "text": "Semantics"}, {"uroven": 2, "text": "Conventions"}, {"uroven": 2, "text": "The JSON:API Media Type"}, {"uroven": 3, "text": "Media Type Parameters"}, {"uroven": 3, "text": "Extensions"}, {"uroven": 3, "text": "Profiles"}, {"uroven": 3, "text": "Rules for Media Type Parameters"}, {"uroven": 4, "text": "Rules for Extensions"}, {"uroven": 4, "text": "Rules for Profiles"}, {"uroven": 2, "text": "Content Negotiation"}, {"uroven": 3, "text": "Universal Responsibilities"}, {"uroven": 3, "text": "Client Responsibilities"}, {"uroven": 3, "text": "Server Responsibilities"}, {"uroven": 2, "text": "Document Structure"}, {"uroven": 3, "text": "Top Level"}, {"uroven": 3, "text": "Resource Objects"}, {"uroven": 4, "text": "Identification"}, {"uroven": 4, "text": "Fields"}, {"uroven": 5, "text": "Attributes"}, {"uroven": 5, "text": "Relationships"}, {"uroven": 5, "text": "Resource Linkage"}, {"uroven": 4, "text": "Resource Links"}, {"uroven": 3, "text": "Resource Identifier Objects"}, {"uroven": 3, "text": "Compound Documents"}, {"uroven": 3, "text": "Meta Information"}, {"uroven": 3, "text": "Links"}, {"uroven": 4, "text": "Link objects"}, {"uroven": 3, "text": "JSON:API Object"}, {"uroven": 3, "text": "Member Names"}, {"uroven": 4, "text": "Allowed Characters"}, {"uroven": 4, "text": "Reserved Characters"}, {"uroven": 4, "text": "@-Members"}, {"uroven": 4, "text": "Extension Members"}, {"uroven": 2, "text": "Fetching Data"}, {"uroven": 3, "text": "Fetching Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Fetching Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Sparse Fieldsets"}, {"uroven": 3, "text": "Sorting"}, {"uroven": 3, "text": "Filtering"}, {"uroven": 2, "text": "Creating, Updating and Deleting Resources"}, {"uroven": 3, "text": "Creating Resources"}, {"uroven": 4, "text": "Client-Generated IDs"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "201 Created"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Resources"}, {"uroven": 4, "text": "Updating a Resource’s Attributes"}, {"uroven": 4, "text": "Updating a Resource’s Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "404 Not Found"}, {"uroven": 5, "text": "409 Conflict"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Updating Relationships"}, {"uroven": 4, "text": "Updating To-One Relationships"}, {"uroven": 4, "text": "Updating To-Many Relationships"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "403 Forbidden"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 3, "text": "Deleting Resources"}, {"uroven": 4, "text": "Responses"}, {"uroven": 5, "text": "200 OK"}, {"uroven": 5, "text": "202 Accepted"}, {"uroven": 5, "text": "204 No Content"}, {"uroven": 5, "text": "404 NOT FOUND"}, {"uroven": 5, "text": "Other Responses"}, {"uroven": 2, "text": "Query Parameters"}, {"uroven": 3, "text": "Query Parameter Families"}, {"uroven": 3, "text": "Extension-Specific Query Parameters"}, {"uroven": 3, "text": "Implementation-Specific Query Parameters"}, {"uroven": 2, "text": "Errors"}, {"uroven": 3, "text": "Processing Errors"}, {"uroven": 3, "text": "Error Objects"}, {"uroven": 2, "text": "Appendix"}, {"uroven": 3, "text": "Query Parameters Details"}, {"uroven": 4, "text": "Parsing/Serialization"}, {"uroven": 4, "text": "Square Brackets in Parameter Names"}], "markdown": "# Specification v1.1 (Archived Copy)\n\n## Status\n\nThis page presents an archived copy of JSON:API version 1.1. None\n of the normative text on this page will change. **Subsequent versions of\n JSON:API will remain compatible with this one**, as JSON:API uses a *never\n remove, only add* strategy.\n\nIf you catch an error in the specification’s text, or if you write an\n implementation, please let us know by opening an issue or pull request at our\n [GitHub repository](https://github.com/json-api/json-api).\n\n## Introduction\n\nJSON:API is a specification for how a client should request that resources be\nfetched or modified, and how a server should respond to those requests. JSON:API\ncan be easily extended with extensions and profiles.\n\nJSON:API is designed to minimize both the number of requests and the amount of\ndata transmitted between clients and servers. This efficiency is achieved\nwithout compromising readability, flexibility, or discoverability.\n\nJSON:API requires use of the JSON:API media type\n([`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json))\nfor exchanging data.\n\n## Semantics\n\nAll document members, query parameters, and processing rules defined by\nthis specification are collectively called “specification semantics”.\n\nCertain document members, query parameters, and processing rules are reserved\nfor implementors to define at their discretion. These are called “implementation\nsemantics”.\n\nAll other semantics are reserved for potential future use by this specification.\n\n## Conventions\n\nThe key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,\n“SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this\ndocument are to be interpreted as described in\n[BCP 14](https://tools.ietf.org/html/bcp14)\n[[RFC2119](https://tools.ietf.org/html/rfc2119)]\n[[RFC8174](https://tools.ietf.org/html/rfc8174)]\nwhen, and only when, they appear in all capitals, as shown here.\n\n## The JSON:API Media Type\n\nThe JSON:API media type is\n[`application/vnd.api+json`](http://www.iana.org/assignments/media-types/application/vnd.api+json).\n\n### Media Type Parameters\n\nThe JSON:API specification supports two media type parameters: `ext` and\n`profile`, which are used to specify extensions and profiles, respectively.\n\n> Note: A media type parameter is an extra piece of information that can\n> accompany a media type. For example, in the header\n> `Content-Type: text/html;charset=\"utf-8\"`, the media type is `text/html` and\n> `charset` is a parameter.\n\n### Extensions\n\nExtensions provide a means to “extend” the base specification by defining\nadditional specification semantics.\n\nExtensions cannot alter or remove specification semantics, nor can they specify\nimplementation semantics.\n\n### Profiles\n\nProfiles provide a means to share a particular usage of the specification among\nimplementations.\n\nProfiles can specify implementation semantics, but cannot alter,\nadd to, or remove specification semantics.\n\n### Rules for Media Type Parameters\n\nThe JSON:API media type **MUST NOT** be specified with any media type parameters\nother than `ext` and `profile`. The `ext` parameter is used to support\nextensions and the `profile` parameter is used to support profiles.\n\nExtensions and profiles are each uniquely identified by a\n[URI](https://tools.ietf.org/html/rfc3986). Visiting an extension’s or a\nprofile’s URI **SHOULD** return documentation that describes its usage. The\nvalues of the `ext` and `profile` parameters **MUST** equal a space-separated\n(U+0020 SPACE, “ “) list of extension or profile URIs, respectively.\n\n> Note: When serializing the `ext` or `profile` media type parameters, the HTTP\n> specification requires that parameter values be surrounded by quotation marks\n> (U+0022 QUOTATION MARK, “\"”).\n\n#### Rules for Extensions\n\nAn extension **MAY** impose additional processing rules or further restrictions\nand it **MAY** define new object members as described below.\n\nAn extension **MUST NOT** lessen or remove any processing rules, restrictions or\nobject member requirements defined in this specification or other extensions.\n\nAn extension **MAY** define new members within the document structure defined by\nthis specification. The rules for extension member names are covered\nbelow.\n\nAn extension **MAY** define new query parameters. The rules for extension-defined\nquery parameters are covered below.\n\nWhen an extension defines new query parameters or document members, the\nextension **MUST** define a namespace to guarantee that extensions will never\nconflict with current or future versions of this specification. A namespace\n**MUST** meet all of the following conditions:\n\n- A namespace **MUST** contain at least one character.\n- A namespace **MUST** contain only these characters:\n - U+0061 to U+007A, “a-z”\n - U+0041 to U+005A, “A-Z”\n - U+0030 to U+0039, “0-9”\n\nAn extension **MUST NOT** define more than one namespace. The namespace used for\nall query parameters and document members **MUST** be the same for any given\nextension.\n\nIn the following example, an extension with the namespace `version` has\nspecified a resource object member `version:id` to support per-resource\nversioning. This member might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;ext=\"https://jsonapi.org/ext/version\" // ... { \"type\": \"articles\", \"id\": \"1\", \"version:id\": \"42\", \"attributes\": { \"title\": \"Rails is Omakase\" } } // ... \n```\n\n#### Rules for Profiles\n\nThe rules for profile usage are dictated by [RFC\n6906](https://tools.ietf.org/html/rfc6906).\n\nA profile **MAY** define document members and processing rules that are reserved\nfor implementors.\n\nA profile **MUST NOT** define any query parameters except implementation-specific query parameters.\n\nA profile **MUST NOT** alter or remove processing rules that have been defined\nby this specification or by an extension. However, a profile\n**MAY** define processing rules for query parameters whose processing rules\nhave been reserved for implementors to define at their discretion.\n\nFor example, a profile could define rules for interpreting the `filter` query\nparameter, but it could not specify that relationship\nnames in the `include` query parameter are\nspace-separated instead of dot-separated.\n\nUnlike extensions, profiles do not need to define a namespace for document\nmembers because profiles cannot define specification semantics and thus cannot\nconflict with current or future versions of this specification. However, it is\npossible for profiles to conflict with other profiles. Therefore, it is the\nresponsibility of implementors to ensure that they do not support conflicting\nprofiles.\n\nIn the following example, a profile has defined a `timestamps` attribute. According to the profile, the attribute must be an\nobject containing a `created` member and a `modified` member and these members’\nvalues must use the [RFC 3339](https://tools.ietf.org/html/rfc3339) format.\nWith such a profile applied, a response might appear as follows:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json;profile=\"https://example.com/resource-timestamps\" // ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\", \"timestamps\": { \"created\": \"2020-07-21T12:09:00Z\", \"modified\": \"2020-07-30T10:19:01Z\" } } } // ... \n```\n\n## Content Negotiation\n\n### Universal Responsibilities\n\nClients and servers **MUST** send all JSON:API payloads using the JSON:API media\ntype in the `Content-Type` header.\n\nClients and servers **MUST** specify the `ext` media type parameter in the\n`Content-Type` header when they have applied one or more extensions to a\nJSON:API document.\n\nClients and servers **MUST** specify the `profile` media type parameters in the\n`Content-Type` header when they have applied one or more profiles to a JSON:API\ndocument.\n\n### Client Responsibilities\n\nWhen processing a JSON:API response document, clients **MUST** ignore any\nparameters other than `ext` and `profile` parameters in the server’s\n`Content-Type` header.\n\nA client **MAY** use the `ext` media type parameter in an `Accept` header to\nrequire that a server apply all the specified extensions to the response\ndocument.\n\nA client **MAY** use the `profile` media type parameter in an `Accept` header\nto request that the server apply one or more profiles to the response document.\n\n> Note: A client is allowed to send more than one acceptable media type in the\n> `Accept` header, including multiple instances of the JSON:API media type. This\n> allows clients to request different combinations of the `ext` and `profile`\n> media type parameters. A client can use [quality values](https://tools.ietf.org/html/rfc7231#section-5.3.2)\n> to indicate that some combinations are less preferable than others. Media types\n> specified without a qvalue are equally preferable to each other, regardless of\n> their order, and are always considered more preferable than a media type with a\n> qvalue less than 1.\n\n### Server Responsibilities\n\nIf a request specifies the `Content-Type` header with the JSON:API media type,\nservers **MUST** respond with a `415 Unsupported Media Type` status code if\nthat media type contains any media type parameters other than `ext` or\n`profile`.\n\nIf a request specifies the `Content-Type` header with an instance of\nthe JSON:API media type modified by the `ext` media type parameter and that\nparameter contains an unsupported extension URI, the server **MUST** respond\nwith a `415 Unsupported Media Type` status code.\n\n> Note: JSON:API servers that do not support version 1.1 of this specification\n> will respond with a `415 Unsupported Media Type` client error if the `ext` or\n> `profile` media type parameter is present.\n\nIf a request’s `Accept` header contains an instance of the JSON:API media type,\nservers **MUST** ignore instances of that media type which are modified by a\nmedia type parameter other than `ext` or `profile`. If all instances of that\nmedia type are modified with a media type parameter other than `ext` or `profile`,\nservers **MUST** respond with a `406 Not Acceptable` status code. If every\ninstance of that media type is modified by the `ext` parameter and each contains\nat least one unsupported extension URI, the server **MUST** also respond with a\n`406 Not Acceptable`.\n\nIf the `profile` parameter is received, a server **SHOULD** attempt to apply any\nrequested profile(s) to its response. A server **MUST** ignore any profiles\nthat it does not recognize.\n\n> Note: The above rules guarantee strict agreement on extensions between the\n> client and server, while the application of profiles is left to the discretion\n> of the server.\n\nServers that support the `ext` or `profile` media type parameters **SHOULD**\nspecify the `Vary` header with `Accept` as one of its values. This applies to\nresponses with and without any profiles or extensions applied.\n\n> Note: Some HTTP intermediaries (e.g. CDNs) may ignore the `Vary` header\n> unless specifically configured to respect it.\n\n## Document Structure\n\nThis section describes the structure of a JSON:API document, which is identified\nby the JSON:API media type. JSON:API documents are\ndefined in JavaScript Object Notation (JSON) [[RFC8259](http://tools.ietf.org/html/rfc8259)].\n\nAlthough the same media type is used for both request and response documents,\ncertain aspects are only applicable to one or the other. These differences are\ncalled out below.\n\nExtensions **MAY** define new members within the document structure. These\nmembers **MUST** comply with the naming requirements specified\nbelow.\n\nUnless otherwise noted, objects defined by this specification or any applied\nextensions **MUST NOT** contain any additional members. Client and server\nimplementations **MUST** ignore non-compliant members.\n\n> Note: These conditions allow this specification to evolve through additive\n> changes.\n\n### Top Level\n\nA JSON object **MUST** be at the root of every JSON:API request and response\ndocument containing data. This object defines a document’s “top level”.\n\nA document **MUST** contain at least one of the following top-level members:\n\n- `data` : the document’s “primary data”.\n- `errors` : an array of error objects .\n- `meta` : a meta object that contains non-standard\nmeta-information.\n- a member defined by an applied extension .\n\nThe members `data` and `errors` **MUST NOT** coexist in the same document.\n\nA document **MAY** contain any of these top-level members:\n\n- `jsonapi` : an object describing the server’s implementation.\n- `links` : a links object related to the document as a whole.\n- `included` : an array of resource objects that are related to the primary\ndata and/or each other (“included resources”).\n\nIf a document does not contain a top-level `data` key, the `included` member\n**MUST NOT** be present either.\n\nThe top-level links object **MAY** contain the following members:\n\n- `self` : the link that generated the current response document. If a\ndocument has extensions or profiles applied to it, this link **SHOULD** be\nrepresented by a link object with the `type` target attribute specifying the\nJSON:API media type with all applicable parameters.\n- `related` : a related resource link when the primary data represents a\nresource relationship.\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the current document.\n- pagination links for the primary data.\n\n> Note: The `self` link in the top-level `links` object allows a client to\n> refresh the data represented by the current response document. The client\n> should be able to use the provided link without applying any additional\n> information. Therefore the link must contain the query parameters provided\n> by the client to generate the response document. This includes but is not\n> limited to query parameters used for inclusion of related resources,\n> sparse fieldsets, sorting,\n> pagination and filtering.\n\nThe document’s “primary data” is a representation of the resource or collection\nof resources targeted by a request.\n\nPrimary data **MUST** be either:\n\n- a single resource object , a single resource identifier object , or `null` ,\nfor requests that target single resources\n- an array of resource objects , an array of resource identifier objects , or\nan empty array ( `[]` ), for requests that target resource collections\n\nFor example, the following primary data is a single resource object:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { // ... this article's attributes }, \"relationships\": { // ... this article's relationships } } } \n```\n\nThe following primary data is a single resource identifier object that\nreferences the same resource:\n\n```\n{ \"data\": { \"type\": \"articles\", \"id\": \"1\" } } \n```\n\nA logical collection of resources **MUST** be represented as an array, even if\nit only contains one item or is empty.\n\n### Resource Objects\n\n“Resource objects” appear in a JSON:API document to represent resources.\n\nA resource object **MUST** contain at least the following top-level members:\n\n- `id`\n- `type`\n\nException: The `id` member is not required when the resource object originates\nat the client and represents a new resource to be created on the server. In that\ncase, a client **MAY** include a `lid` member to uniquely identify the resource\nby `type` *locally* within the document.\n\nIn addition, a resource object **MAY** contain any of these top-level members:\n\n- `attributes` : an attributes object representing some of the resource’s data.\n- `relationships` : a relationships object describing relationships between\n the resource and other JSON:API resources.\n- `links` : a links object containing links related to the resource.\n- `meta` : a meta object containing non-standard meta-information about a\nresource that can not be represented as an attribute or relationship.\n\nHere’s how an article (i.e. a resource of type “articles”) might appear in a document:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } // ... \n```\n\n#### Identification\n\nAs noted above, every resource object **MUST** contain a\n`type` member. Every resource object **MUST** also contain an `id` member,\nexcept when the resource object originates at the client and represents a new\nresource to be created on the server. If `id` is omitted due to this exception,\na `lid` member **MAY** be included to uniquely identify the resource by `type` *locally* within the document. The value of the `lid` member **MUST** be\nidentical for every representation of the resource in the document, including\nresource identifier objects.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nWithin a given API, each resource object’s `type` and `id` pair **MUST**\nidentify a single, unique resource. (The set of URIs controlled by a server,\nor multiple servers acting as one, constitute an API.)\n\nThe `type` member is used to describe resource objects that share common\nattributes and relationships.\n\nThe values of `type` members **MUST** adhere to the same constraints as\nmember names.\n\n> Note: This spec is agnostic about inflection rules, so the value of `type`\n> can be either plural or singular. However, the same value should be used\n> consistently throughout an implementation.\n\n#### Fields\n\nA resource object’s attributes and its relationships are collectively called\nits “fields”.\n\nFields for a resource object **MUST** share a common namespace with each\nother and with `type` and `id`. In other words, a resource can not have an\nattribute and relationship with the same name, nor can it have an attribute\nor relationship named `type` or `id`.\n\n##### Attributes\n\nThe value of the `attributes` key **MUST** be an object (an “attributes\nobject”). Members of the attributes object (“attributes”) represent information\nabout the resource object in which it’s defined.\n\nAttributes may contain any valid JSON value, including complex data structures\ninvolving JSON objects and arrays.\n\nKeys that reference related resources (e.g. `author_id`) **SHOULD NOT** appear\nas attributes. Instead, relationships **SHOULD** be used.\n\n> Note: See fields and member names for more restrictions on this container.\n\n##### Relationships\n\nThe value of the `relationships` key **MUST** be an object (a “relationships\nobject”). Each member of a relationships object represents\na “relationship” from the resource object\nin which it has been defined to other resource objects.\n\nRelationships may be to-one or to-many.\n\nA relationship’s name is given by its key. The value at that key **MUST** be an\nobject (“relationship object”).\n\nA “relationship object” **MUST** contain at least one of the following:\n\n- `links` : a links object containing at least one of the following:\n - `self` : a link for the relationship itself (a “relationship link”). This\n link allows the client to directly manipulate the relationship. For example,\n removing an `author` through an `article` ’s relationship URL would disconnect\n the person from the `article` without deleting the `people` resource itself.\n When fetched successfully, this link returns the linkage for the related resources as its primary data.\n (See Fetching Relationships .)\n - `related` : a related resource link\n - a member defined by an applied extension .\n- `data` : resource linkage\n- `meta` : a meta object that contains non-standard meta-information about the\nrelationship.\n- a member defined by an applied extension .\n\nA relationship object that represents a to-many relationship **MAY** also contain\npagination links under the `links` member, as described below. Any\npagination links in a relationship object **MUST** paginate the relationship\ndata, not the related resources.\n\n> Note: See fields and member names for more restrictions on this container.\n\nA “related resource link” provides access to resource objects linked\nin a relationship. When fetched, the related resource object(s)\nare returned as the response’s primary data.\n\nFor example, an `article`’s `comments` relationship could\nspecify a link that returns a collection of comment resource objects\nwhen retrieved through a `GET` request.\n\nIf present, a related resource link **MUST** reference a valid URL, even if the\nrelationship isn’t currently associated with any target resources. Additionally,\na related resource link **MUST NOT** change because its relationship’s content\nchanges.\n\n##### Resource Linkage\n\nResource linkage in a compound document allows a client to link together all\nof the included resource objects without having to `GET` any URLs via links.\n\nResource linkage **MUST** be represented as one of the following:\n\n- `null` for empty to-one relationships.\n- an empty array ( `[]` ) for empty to-many relationships.\n- a single resource identifier object for non-empty to-one relationships.\n- an array of resource identifier objects for non-empty to-many relationships.\n\n> Note: The spec does not impart meaning to order of resource identifier\n> objects in linkage arrays of to-many relationships, although implementations\n> may do that. Arrays of resource identifier objects may represent ordered\n> or unordered relationships, and both types can be mixed in one response\n> object.\n\nFor example, the following article is associated with an `author`:\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nThe `author` relationship includes a link for the relationship itself (which\nallows the client to change the related author directly), a related resource\nlink to fetch the resource objects, and linkage information.\n\n#### Resource Links\n\nThe optional `links` member within each resource object contains links\nrelated to the resource.\n\nIf present, this links object **MAY** contain a `self` link that\nidentifies the resource represented by the resource object.\n\n```\n// ... { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"Rails is Omakase\" }, \"links\": { \"self\": \"http://example.com/articles/1\" } } // ... \n```\n\nA server **MUST** respond to a `GET` request to the specified URL with a\nresponse that includes the resource as the primary data.\n\n### Resource Identifier Objects\n\nA “resource identifier object” is an object that identifies an individual\nresource.\n\nA “resource identifier object” **MUST** contain a `type` member. It **MUST**\nalso contain an `id` member, except when it represents a new resource to be\ncreated on the server. In this case, a `lid` member **MUST** be included that\nidentifies the new resource.\n\nThe values of the `id`, `type`, and `lid` members **MUST** be strings.\n\nA “resource identifier object” **MAY** also include a `meta` member, whose value is a meta object that\ncontains non-standard meta-information.\n\n### Compound Documents\n\nServers **MAY** allow responses that include related resources along with the\nrequested primary resources. Such responses are called “compound documents”.\n\nIn a compound document, all included resources **MUST** be represented as an\narray of resource objects in a top-level `included` member.\n\nEvery included resource object **MUST** be identified via a chain of\nrelationships originating in a document’s primary data. This means that\ncompound documents require “full linkage” and that no resource object can be\nincluded without a direct or indirect relationship to the document’s primary\ndata.\n\nThe only exception to the full linkage requirement is when relationship fields\nthat would otherwise contain linkage data are excluded due to\nsparse fieldsets requested by the client.\n\nA complete example document with multiple included relationships:\n\n```\n{ \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"links\": { \"self\": \"http://example.com/articles/1\" }, \"relationships\": { \"author\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/author\", \"related\": \"http://example.com/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"9\" } }, \"comments\": { \"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": \"http://example.com/articles/1/comments\" }, \"data\": [ { \"type\": \"comments\", \"id\": \"5\" }, { \"type\": \"comments\", \"id\": \"12\" } ] } } }], \"included\": [{ \"type\": \"people\", \"id\": \"9\", \"attributes\": { \"firstName\": \"Dan\", \"lastName\": \"Gebhardt\", \"twitter\": \"dgeb\" }, \"links\": { \"self\": \"http://example.com/people/9\" } }, { \"type\": \"comments\", \"id\": \"5\", \"attributes\": { \"body\": \"First!\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"2\" } } }, \"links\": { \"self\": \"http://example.com/comments/5\" } }, { \"type\": \"comments\", \"id\": \"12\", \"attributes\": { \"body\": \"I like XML better\" }, \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } }, \"links\": { \"self\": \"http://example.com/comments/12\" } }] } \n```\n\nA compound document **MUST NOT** include more than one resource object for\neach `type` and `id` pair.\n\n> Note: In a single document, you can think of the `type` and `id` as a\n> composite key that uniquely references resource objects in another part of\n> the document.\n\n> Note: For resources that do not contain an `id` member but do contain a `lid`,\n> the `lid` is sufficient to establish resource identity and thus linkage between\n> resource objects and resource identifier objects throughout the document.\n\n> Note: This approach ensures that a single canonical resource object is\n> returned with each response, even when the same resource is referenced\n> multiple times.\n\n### Meta Information\n\nWhere specified, a `meta` member can be used to include non-standard\nmeta-information. The value of each `meta` member **MUST** be an object (a\n“meta object”).\n\nAny members **MAY** be specified within `meta` objects.\n\nFor example:\n\n```\n{ \"meta\": { \"copyright\": \"Copyright 2015 Example Corp.\", \"authors\": [ \"Yehuda Katz\", \"Steve Klabnik\", \"Dan Gebhardt\", \"Tyler Kellen\" ] }, \"data\": { // ... } } \n```\n\n### Links\n\nWhere specified, a `links` member can be used to represent links. The value\nof this member **MUST** be an object (a “links object”).\n\nWithin this object, a link **MUST** be represented as either:\n\n- a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target,\n- a link object or\n- `null` if the link does not exist.\n\nA link’s relation type **SHOULD** be inferred from the name of the link unless the\nlink is a link object and the link object has a `rel` member.\n\nA link’s context is the top-level object, resource\nobject, or relationship object in which it\nappears.\n\nIn the example below, the `self` link is a string whereas the `related` link is\na link object. The `related` link object provides additional information\nabout the targeted related resource collection as well as a schema that serves\nas a description document for that collection:\n\n```\n\"links\": { \"self\": \"http://example.com/articles/1/relationships/comments\", \"related\": { \"href\": \"http://example.com/articles/1/comments\", \"title\": \"Comments\", \"describedby\": \"http://example.com/schemas/article-comments\", \"meta\": { \"count\": 10 } } } \n```\n\n#### Link objects\n\nA “link object” is an object that represents a [web link](https://tools.ietf.org/html/rfc8288).\n\nA link object **MUST** contain the following member:\n\n- `href` : a string whose value is a URI-reference [ [RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1) ]\npointing to the link’s target.\n\nA link object **MAY** also contain any of the following members:\n\n- `rel` : a string indicating the link’s relation type. The string **MUST** be a [valid link relation type](https://tools.ietf.org/html/rfc8288#section-2.1) .\n- `describedby` : a link to a description document (e.g. OpenAPI or JSON\nSchema) for the link target.\n- `title` : a string which serves as a label for the destination of a link\nsuch that it can be used as a human-readable identifier (e.g., a menu\nentry).\n- `type` : a string indicating the media type of the link’s target.\n- `hreflang` : a string or an array of strings indicating the language(s) of the\nlink’s target. An array of strings indicates that the link’s target is\navailable in multiple languages. Each string **MUST** be a valid language tag\n[ [RFC5646](https://tools.ietf.org/html/rfc5646) ].\n- `meta` : a meta object containing non-standard meta-information about the\nlink.\n\n> Note: the `type` and `hreflang` members are only hints; the target resource\n> is not guaranteed to be available in the indicated media type or language\n> when the link is actually followed.\n\n### JSON:API Object\n\nA JSON:API document **MAY** include information about its implementation\nunder a top level `jsonapi` member. If present, the value of the `jsonapi`\nmember **MUST** be an object (a “jsonapi object”).\n\nThe jsonapi object **MAY** contain any of the following members:\n\n- `version` - whose value is a string indicating the highest JSON:API version\nsupported.\n- `ext` - an array of URIs for all applied extensions .\n- `profile` - an array of URIs for all applied profiles .\n- `meta` - a meta object that contains non-standard meta-information.\n\nClients and servers **MUST NOT** use an `ext` or `profile` member for content\nnegotiation. Content negotiation **MUST** only happen based on media type\nparameters in `Content-Type` header.\n\nA simple example appears below:\n\n```\n{ \"jsonapi\": { \"version\": \"1.1\", \"ext\": [ \"https://jsonapi.org/ext/atomic\" ], \"profile\": [ \"http://example.com/profiles/flexible-pagination\", \"http://example.com/profiles/resource-versioning\" ] } } \n```\n\nIf the `version` member is not present, clients should assume the server\nimplements at least version 1.0 of the specification.\n\n> Note: Because JSON:API is committed to making additive changes only, the\n> version string primarily indicates which new features a server may support.\n\n### Member Names\n\nImplementation and profile defined member names used in a JSON:API document\n**MUST** be treated as case sensitive by clients and servers, and they **MUST**\nmeet all of the following conditions:\n\n- Member names **MUST** contain at least one character.\n- Member names **MUST** contain only the allowed characters listed below.\n- Member names **MUST** start and end with a “globally allowed character”,\nas defined below.\n\nTo enable an easy mapping of member names to URLs, it is **RECOMMENDED** that\nmember names use only non-reserved, URL safe characters specified in [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).\n\n#### Allowed Characters\n\nThe following “globally allowed characters” **MAY** be used anywhere in a member name:\n\n- U+0061 to U+007A, “a-z”\n- U+0041 to U+005A, “A-Z”\n- U+0030 to U+0039, “0-9”\n- U+0080 and above (non-ASCII Unicode characters; *not recommended, not URL safe* )\n\nAdditionally, the following characters are allowed in member names, except as the\nfirst or last character:\n\n- U+002D HYPHEN-MINUS, “-“\n- U+005F LOW LINE, “_”\n- U+0020 SPACE, “ “ *(not recommended, not URL safe)*\n\n#### Reserved Characters\n\nThe following characters **MUST NOT** be used in implementation and\nprofile defined member names:\n\n- U+002B PLUS SIGN, “+” *(has overloaded meaning in URL query strings)*\n- U+002C COMMA, “,” *(used as a separator between relationship paths)*\n- U+002E PERIOD, “.” *(used as a separator within relationship paths)*\n- U+005B LEFT SQUARE BRACKET, “[” *(used in query parameter families)*\n- U+005D RIGHT SQUARE BRACKET, “]” *(used in query parameter families)*\n- U+0021 EXCLAMATION MARK, “!”\n- U+0022 QUOTATION MARK, â€�”’\n- U+0023 NUMBER SIGN, “#”\n- U+0024 DOLLAR SIGN, “$”\n- U+0025 PERCENT SIGN, “%”\n- U+0026 AMPERSAND, “&”\n- U+0027 APOSTROPHE, “’”\n- U+0028 LEFT PARENTHESIS, “(“\n- U+0029 RIGHT PARENTHESIS, “)”\n- U+002A ASTERISK, “*”\n- U+002F SOLIDUS, “/”\n- U+003A COLON, “:”\n- U+003B SEMICOLON, “;”\n- U+003C LESS-THAN SIGN, “<”\n- U+003D EQUALS SIGN, “=”\n- U+003E GREATER-THAN SIGN, “>”\n- U+003F QUESTION MARK, “?”\n- U+0040 COMMERCIAL AT, “@” (except as first character in @-Members )\n- U+005C REVERSE SOLIDUS, “\\”\n- U+005E CIRCUMFLEX ACCENT, “^”\n- U+0060 GRAVE ACCENT, “`”\n- U+007B LEFT CURLY BRACKET, “{“\n- U+007C VERTICAL LINE, “|”\n- U+007D RIGHT CURLY BRACKET, “}”\n- U+007E TILDE, “~”\n- U+007F DELETE\n- U+0000 to U+001F (C0 Controls)\n\n#### @-Members\n\nMember names **MAY** also begin with an at sign (U+0040 COMMERCIAL AT, “@”).\nMembers named this way are called “@-Members”. @-Members **MAY** appear\nanywhere in a document.\n\nThis specification provides no guidance on the meaning or usage of @-Members,\nwhich are considered to be implementation semantics. @-Members\n**MUST** be ignored when interpreting this specification’s definitions and\nprocessing instructions given outside of this subsection. For example, an\nattribute is defined above as any member of the attributes object.\nHowever, because @-Members must be ignored when interpreting that definition, an\n@-Member that occurs in an attributes object is not an attribute.\n\n> Note: Among other things, “@” members can be used to add JSON-LD data to a\n> JSON:API document. Such documents should be served with [an extra header](http://www.w3.org/TR/json-ld/#interpreting-json-as-json-ld)\n> to convey to JSON-LD clients that they contain JSON-LD data.\n\n#### Extension Members\n\nThe name of every new member introduced by an extension **MUST** be prefixed\nwith the extension’s namespace followed by a colon (`:`).\nThe remainder of the name **MUST** adhere to the rules for implementation\ndefined member names.\n\n## Fetching Data\n\nData, including resources and relationships, can be fetched by sending a\n`GET` request to an endpoint.\n\nResponses can be further refined with the optional features described below.\n\n### Fetching Resources\n\nA server **MUST** support fetching resource data for every URL provided as:\n\n- a `self` link as part of the top-level links object\n- a `self` link as part of a resource-level links object\n- a `related` link as part of a relationship-level links object\n\nFor example, the following request fetches a collection of articles:\n\n```\nGET /articles HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe following request fetches an article:\n\n```\nGET /articles/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches an article’s author:\n\n```\nGET /articles/1/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch an individual\nresource or resource collection with a `200 OK` response.\n\nA server **MUST** respond to a successful request to fetch a resource\ncollection with an array of resource objects or an empty array (`[]`) as\nthe response document’s primary data.\n\nFor example, a `GET` request to a collection of articles could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [{ \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" } }, { \"type\": \"articles\", \"id\": \"2\", \"attributes\": { \"title\": \"Rails is Omakase\" } }] } \n```\n\nA similar response representing an empty collection would be:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles\" }, \"data\": [] } \n```\n\nA server **MUST** respond to a successful request to fetch an individual\nresource with a resource object or `null` provided as\nthe response document’s primary data.\n\n`null` is only an appropriate response when the requested URL is one that\nmight correspond to a single resource, but doesn’t currently.\n\n> Note: Consider, for example, a request to fetch a to-one related resource link.\n> This request would respond with `null` when the relationship is empty (such that\n> the link is corresponding to no resources) but with the single related resource’s\n> resource object otherwise.\n\nFor example, a `GET` request to an individual article could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1\" }, \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"JSON:API paints my bikeshed!\" }, \"relationships\": { \"author\": { \"links\": { \"related\": \"http://example.com/articles/1/author\" } } } } } \n```\n\nIf the above article’s author is missing, then a `GET` request to that related\nresource would return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"http://example.com/articles/1/author\" }, \"data\": null } \n```\n\n##### 404 Not Found\n\nA server **MUST** respond with `404 Not Found` when processing a request to\nfetch a single resource that does not exist, except when the request warrants a\n`200 OK` response with `null` as the primary data (as described above).\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Fetching Relationships\n\nA server **MUST** support fetching relationship data for every relationship URL\nprovided as a `self` link as part of a relationship’s `links` object.\n\nFor example, the following request fetches data about an article’s comments:\n\n```\nGET /articles/1/relationships/comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAnd the following request fetches data about an article’s author:\n\n```\nGET /articles/1/relationships/author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MUST** respond to a successful request to fetch a relationship\nwith a `200 OK` response.\n\nThe primary data in the response document **MUST** match the appropriate\nvalue for resource linkage, as described above for\nrelationship objects.\n\nThe top-level links object **MAY** contain `self` and `related` links,\nas described above for relationship objects.\n\nFor example, a `GET` request to a URL from a to-one relationship link could\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/author\", \"related\": \"/articles/1/author\" }, \"data\": null } \n```\n\nA `GET` request to a URL from a to-many relationship link could return:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nIf the above relationship is empty, then a `GET` request to the same URL would\nreturn:\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json { \"links\": { \"self\": \"/articles/1/relationships/tags\", \"related\": \"/articles/1/tags\" }, \"data\": [] } \n```\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to fetch\na relationship link URL that does not exist.\n\n> Note: This can happen when the parent resource of the relationship\n> does not exist. For example, when `/articles/1` does not exist, request to\n> `/articles/1/relationships/tags` returns `404 Not Found`.\n\nIf a relationship link URL exists but the relationship is empty, then\n`200 OK` **MUST** be returned, as described above.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\nAn endpoint **MAY** return resources related to the primary data by default.\n\nAn endpoint **MAY** also support an `include` query parameter to allow the\nclient to customize which related resources should be returned.\n\nIf an endpoint does not support the `include` parameter, it **MUST** respond\nwith `400 Bad Request` to any requests that include it.\n\nIf an endpoint supports the `include` parameter and a client supplies it:\n\n- The server’s response **MUST** be a compound document with an `included` key — even if that `included` key holds an empty array (because the requested relationships are empty).\n- The server **MUST NOT** include unrequested resource objects in the `included` section of the compound document .\n\nThe value of the `include` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list of relationship paths. A relationship path is a dot-separated\n(U+002E FULL-STOP, “.”) list of relationship names. An empty\nvalue indicates that no related resources should be returned.\n\nIf a server is unable to identify a relationship path or does not support\ninclusion of resources from a path, it **MUST** respond with 400 Bad Request.\n\n> Note: For example, a relationship path could be `comments.author`, where\n> `comments` is a relationship listed under a `articles` resource object, and\n> `author` is a relationship listed under a `comments` resource object.\n\nFor instance, comments could be requested with an article:\n\n```\nGET /articles/1?include=comments HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn order to request resources related to other resources, a dot-separated path\nfor each relationship name can be specified:\n\n```\nGET /articles/1?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: Because compound documents require full linkage\n> (except when relationship linkage is excluded by sparse fieldsets), intermediate\n> resources in a multi-part path must be returned along with the leaf nodes. For\n> example, a response to a request for `comments.author` should include `comments`\n> as well as the `author` of each of those `comments`.\n\n> Note: A server may choose to expose a deeply nested relationship such as\n> `comments.author` as a direct relationship with an alternative name such as\n> `commentAuthors`. This would allow a client to request\n> `/articles/1?include=commentAuthors` instead of\n> `/articles/1?include=comments.author`. By exposing the nested relationship with\n> an alternative name, the server can still provide full linkage in compound\n> documents without including potentially unwanted intermediate resources.\n\nMultiple related resources can be requested in a comma-separated list:\n\n```\nGET /articles/1?include=comments.author,ratings HTTP/1.1 Accept: application/vnd.api+json \n```\n\nFurthermore, related resources can be requested from a relationship endpoint:\n\n```\nGET /articles/1/relationships/comments?include=comments.author HTTP/1.1 Accept: application/vnd.api+json \n```\n\nIn this case, the primary data would be a collection of\nresource identifier objects that represent linkage to comments for an article,\nwhile the full comments and comment authors would be returned as included data.\n\n> Note: This section applies to any endpoint that responds with primary\n> data, regardless of the request type. For instance, a server could support\n> the inclusion of related resources along with a `POST` request to create a\n> resource or relationship.\n\n### Sparse Fieldsets\n\nA client **MAY** request that an endpoint return only specific fields in the\nresponse on a per-type basis by including a `fields[TYPE]` query parameter.\n\nThe value of any `fields[TYPE]` parameter **MUST** be a comma-separated (U+002C\nCOMMA, “,”) list that refers to the name(s) of the fields to be returned.\nAn empty value indicates that no fields should be returned.\n\nIf a client requests a restricted set of fields for a given resource type,\nan endpoint **MUST NOT** include additional fields in resource objects of\nthat type in its response.\n\nIf a client does not specify the set of fields for a given resource type, the\nserver **MAY** send all fields, a subset of fields, or no fields for that\nresource type.\n\n```\nGET /articles?include=author&fields[articles]=title,body&fields[people]=name HTTP/1.1 Accept: application/vnd.api+json \n```\n\n> Note: The above example URI shows unencoded `[` and `]` characters simply for\n> readability. In practice, these characters should be percent-encoded. See\n> “Square Brackets in Parameter Names”.\n\n> Note: This section applies to any endpoint that responds with resources as\n> primary or included data, regardless of the request type. For instance, a\n> server could support sparse fieldsets along with a `POST` request to create\n> a resource.\n\n### Sorting\n\nA server **MAY** choose to support requests to sort resource collections\naccording to one or more criteria (“sort fields”).\n\n> Note: Although recommended, sort fields do not necessarily need to\n> correspond to resource attribute and relationship names.\n\n> Note: It is recommended that dot-separated (U+002E FULL-STOP, “.”) sort\n> fields be used to request sorting based upon relationship attributes. For\n> example, a sort field of `author.name` could be used to request that the\n> primary data be sorted based upon the `name` attribute of the `author`\n> relationship.\n\nAn endpoint **MAY** support requests to sort the primary data with a `sort`\nquery parameter. The value for `sort` **MUST** represent sort fields.\n\n```\nGET /people?sort=age HTTP/1.1 Accept: application/vnd.api+json \n```\n\nAn endpoint **MAY** support multiple sort fields by allowing comma-separated\n(U+002C COMMA, “,”) sort fields. Sort fields **SHOULD** be applied in the\norder specified.\n\n```\nGET /people?sort=age,name HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe sort order for each sort field **MUST** be ascending unless it is prefixed\nwith a minus (U+002D HYPHEN-MINUS, “-“), in which case it **MUST** be descending.\n\n```\nGET /articles?sort=-created,title HTTP/1.1 Accept: application/vnd.api+json \n```\n\nThe above example should return the newest articles first. Any articles\ncreated on the same date will then be sorted by their title in ascending\nalphabetical order.\n\nIf the server does not support sorting as specified in the query parameter\n`sort`, it **MUST** return `400 Bad Request`.\n\nIf sorting is supported by the server and requested by the client via query\nparameter `sort`, the server **MUST** return elements of the top-level\n`data` array of the response ordered according to the criteria specified.\nThe server **MAY** apply default sorting rules to top-level `data` if\nrequest parameter `sort` is not specified.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\nA server **MAY** choose to limit the number of resources returned in a response\nto a subset (“page”) of the whole set available.\n\nA server **MAY** provide links to traverse a paginated data set (“pagination\nlinks”).\n\nPagination links **MUST** appear in the links object that corresponds to a\ncollection. To paginate the primary data, supply pagination links in the\ntop-level `links` object. To paginate an included collection returned in\na compound document, supply pagination links in the corresponding links\nobject.\n\nThe following keys **MUST** be used for pagination links:\n\n- `first` : the first page of data\n- `last` : the last page of data\n- `prev` : the previous page of data\n- `next` : the next page of data\n\nKeys **MUST** either be omitted or have a `null` value to indicate that a\nparticular link is unavailable.\n\nConcepts of order, as expressed in the naming of pagination links, **MUST**\nremain consistent with JSON:API’s sorting rules.\n\nThe `page` query parameter family is reserved for pagination. Servers and\nclients **SHOULD** use these parameters for pagination operations.\n\n> Note: JSON API is agnostic about the pagination strategy used by a server, but\n> the `page` query parameter family can be used regardless of the strategy\n> employed. For example, a page-based strategy might use query parameters such\n> as `page[number]` and `page[size]`, while a cursor-based strategy might use\n> `page[cursor]`.\n\n> Note: This section applies to any endpoint that responds with a resource\n> collection as primary data, regardless of the request type.\n\n### Filtering\n\nThe `filter` query parameter family is reserved for filtering data. Servers\nand clients **SHOULD** use these parameters for filtering operations.\n\n> Note: JSON API is agnostic about the strategies supported by a server.\n\n## Creating, Updating and Deleting Resources\n\nA server **MAY** allow resources of a given type to be created. It **MAY**\nalso allow existing resources to be modified or deleted.\n\nA request **MUST** completely succeed or fail (in a single “transaction”). No\npartial updates are allowed.\n\n> Note: The `type` member is required in every resource object throughout requests and\n> responses in JSON:API. There are some cases, such as when `POST`ing to an\n> endpoint representing heterogeneous data, when the `type` could not be inferred\n> from the endpoint. However, picking and choosing when it is required would be\n> confusing; it would be hard to remember when it was required and when it was\n> not. Therefore, to improve consistency and minimize confusion, `type` is\n> always required.\n\n### Creating Resources\n\nA resource can be created by sending a `POST` request to a URL that represents\na collection of resources. The request **MUST** include a single resource object\nas primary data. The resource object **MUST** contain at least a `type` member.\n\nFor instance, a new photo might be created with the following request:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"relationships\": { \"photographer\": { \"data\": { \"type\": \"people\", \"id\": \"9\" } } } } } \n```\n\nIf a relationship is provided in the `relationships` member of the\nresource object, its value **MUST** be a relationship object with a `data`\nmember. The value of this key represents the linkage the new resource is to\nhave.\n\n#### Client-Generated IDs\n\nA server **MAY** accept a client-generated ID along with a request to create\na resource. An ID **MUST** be specified with an `id` key, the value of\nwhich **MUST** be a universally unique identifier. The client **SHOULD** use\na properly generated and formatted *UUID* as described in RFC 4122\n[[RFC4122](http://tools.ietf.org/html/rfc4122.html)].\n\n> NOTE: In some use-cases, such as importing data from another source, it\n> may be possible to use something other than a UUID that is still guaranteed\n> to be globally unique. Do not use anything other than a UUID unless you are\n> 100% confident that the strategy you are using indeed generates globally\n> unique identifiers.\n\nFor example:\n\n```\nPOST /photos HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" } } } \n```\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto create a resource with a client-generated ID.\n\n#### Responses\n\n##### 201 Created\n\nIf the requested resource has been created successfully and the server changes\nthe resource in any way (for example, by assigning an `id`), the server **MUST**\nreturn a `201 Created` response and a document that contains the resource as\nprimary data.\n\nThe response **SHOULD** include a `Location` header identifying the location\nof the newly created resource, in order to comply with [RFC\n7231](http://tools.ietf.org/html/rfc7231#section-6.3.2).\n\nIf the resource object returned by the response contains a `self` key in its\n`links` member and a `Location` header is provided, the value of the `self`\nmember **MUST** match the value of the `Location` header.\n\n```\nHTTP/1.1 201 Created Location: http://example.com/photos/550e8400-e29b-41d4-a716-446655440000 Content-Type: application/vnd.api+json { \"data\": { \"type\": \"photos\", \"id\": \"550e8400-e29b-41d4-a716-446655440000\", \"attributes\": { \"title\": \"Ember Hamster\", \"src\": \"http://example.com/images/productivity.png\" }, \"links\": { \"self\": \"http://example.com/photos/550e8400-e29b-41d4-a716-446655440000\" } } } \n```\n\nA server **MAY** return a `201 Created` response with a document that contains\nno primary data if the requested resource has been created successfully and the\nserver does not change the resource in any way (for example, by assigning an\n`id` or `createdAt` attribute). Other top-level members, such as meta, could\nbe included in the response document.\n\n> Note: Only servers that accept Client-Generated\n> IDs can avoid assigning an `id` to a new resource.\n\n##### 202 Accepted\n\nIf a request to create a resource has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf the requested resource has been created successfully and the server does not\nchange the resource in any way (for example, by assigning an `id` or `createdAt`\nattribute), the server **MUST** return either a `201 Created` status code and\nresponse document (as described above) or a `204 No Content` status code with no\nresponse document.\n\n##### 403 Forbidden\n\nA server **MAY** return `403 Forbidden` in response to an unsupported request\nto create a resource.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MUST** return `409 Conflict` when processing a `POST` request to\ncreate a resource with a client-generated ID that already exists.\n\nA server **MUST** return `409 Conflict` when processing a `POST` request in\nwhich the resource object’s `type` is not among the type(s) that constitute the\ncollection represented by the endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Resources\n\nA resource can be updated by sending a `PATCH` request to the URL that\nrepresents the resource.\n\nThe URL for a resource can be obtained in the `self` link of the resource\nobject. Alternatively, when a `GET` request returns a single resource object as\nprimary data, the same request URL can be used for updates.\n\nThe `PATCH` request **MUST** include a single resource object as primary data.\nThe resource object **MUST** contain `type` and `id` members.\n\nFor example:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\" } } } \n```\n\n#### Updating a Resource’s Attributes\n\nAny or all of a resource’s attributes **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the attributes for a resource, the server\n**MUST** interpret the missing attributes as if they were included with their\ncurrent values. The server **MUST NOT** interpret missing attributes as `null`\nvalues.\n\nFor example, the following `PATCH` request is interpreted as a request to\nupdate only the `title` and `text` attributes of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"attributes\": { \"title\": \"To TDD or Not\", \"text\": \"TLDR; It's complicated... but check your test coverage regardless.\" } } } \n```\n\n#### Updating a Resource’s Relationships\n\nAny or all of a resource’s relationships **MAY** be included in the resource\nobject included in a `PATCH` request.\n\nIf a request does not include all of the relationships for a resource, the server\n**MUST** interpret the missing relationships as if they were included with their\ncurrent values. It **MUST NOT** interpret them as `null` or empty values.\n\nIf a relationship is provided in the `relationships` member of a resource\nobject in a `PATCH` request, its value **MUST** be a relationship object\nwith a `data` member. The relationship’s value will be replaced with the\nvalue specified in this member.\n\nFor instance, the following `PATCH` request will update the `author` relationship of an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"author\": { \"data\": { \"type\": \"people\", \"id\": \"1\" } } } } } \n```\n\nLikewise, the following `PATCH` request performs a complete replacement of\nthe `tags` for an article:\n\n```\nPATCH /articles/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"articles\", \"id\": \"1\", \"relationships\": { \"tags\": { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } } } } \n```\n\nA server **MAY** reject an attempt to do a full replacement of a to-many\nrelationship. In such a case, the server **MUST** reject the entire update,\nand return a `403 Forbidden` response.\n\n> Note: Since full replacement may be a very dangerous operation, a server\n> may choose to disallow it. For example, a server may reject full replacement if\n> it has not provided the client with the full list of associated objects, and\n> does not want to allow deletion of records the client has not seen.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted resource in ways\nother than those specified by the request (for example, updating the\n`updatedAt` attribute or a computed `sha`), it **MUST** return a `200 OK`\nresponse and a document that contains the updated resource as primary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted resource in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf an update request has been accepted for processing, but the processing\nhas not been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nresource in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a resource or relationship.\n\n##### 404 Not Found\n\nA server **MUST** return `404 Not Found` when processing a request to modify\na resource that does not exist.\n\nA server **MUST** return `404 Not Found` when processing a request that\nreferences a related resource that does not exist.\n\n##### 409 Conflict\n\nA server **MAY** return `409 Conflict` when processing a `PATCH` request to\nupdate a resource if that update would violate other server-enforced\nconstraints (such as a uniqueness constraint on a property other than `id`).\n\nA server **MUST** return `409 Conflict` when processing a `PATCH` request in\nwhich the resource object’s `type` or `id` do not match the server’s endpoint.\n\nA server **SHOULD** include error details and provide enough information to\nrecognize the source of the conflict.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Updating Relationships\n\nAlthough relationships can be modified along with resources (as described\nabove), JSON:API also supports updating of relationships independently at\nURLs from relationship links.\n\n> Note: Relationships are updated without exposing the underlying server\n> semantics, such as foreign keys. Furthermore, relationships can be updated\n> without necessarily affecting the related resources. For example, if an article\n> has many authors, it is possible to remove one of the authors from the article\n> without deleting the person itself. Similarly, if an article has many tags, it\n> is possible to add or remove tags. Under the hood on the server, the first\n> of these examples might be implemented with a foreign key, while the second\n> could be implemented with a join table, but the JSON:API protocol would be\n> the same in both cases.\n\n> Note: A server may choose to delete the underlying resource if a\n> relationship is deleted (as a garbage collection measure).\n\n#### Updating To-One Relationships\n\nA to-one relationship can be updated by sending a `PATCH` request to a URL\nfrom a to-one relationship link.\n\nThe `PATCH` request **MUST** include a top-level member named `data` containing\none of:\n\n- a resource identifier object corresponding to the new related resource.\n- `null` , to remove the relationship.\n\nFor example, the following request updates the author of an article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": { \"type\": \"people\", \"id\": \"12\" } } \n```\n\nAnd the following request clears the author of the same article:\n\n```\nPATCH /articles/1/relationships/author HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": null } \n```\n\nIf the relationship is updated successfully then the server **MUST** return\na successful response.\n\n#### Updating To-Many Relationships\n\nA to-many relationship can be updated by sending a `PATCH`, `POST`, or\n`DELETE` request to a URL from a to-many relationship link.\n\nFor all request types, the body **MUST** contain a `data` member whose value\nis an empty array or an array of resource identifier objects.\n\nIf a client makes a `PATCH` request to a URL from a to-many\nrelationship link, the server **MUST** either completely\nreplace every member of the relationship, return an appropriate error response\nif some resources cannot be found or accessed, or return a `403 Forbidden`\nresponse if complete replacement is not allowed by the server.\n\nFor example, the following request replaces every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"tags\", \"id\": \"2\" }, { \"type\": \"tags\", \"id\": \"3\" } ] } \n```\n\nAnd the following request clears every tag for an article:\n\n```\nPATCH /articles/1/relationships/tags HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [] } \n```\n\nIf a client makes a `POST` request to a URL from a\nrelationship link, the server **MUST** add the specified\nmembers to the relationship unless they are already present. If a given `type`\nand `id` is already in the relationship, the server **MUST NOT** add it again.\n\n> Note: This matches the semantics of databases that use foreign keys for\n> has-many relationships. Document-based storage should check the has-many\n> relationship before appending to avoid duplicates.\n\nIf all of the specified resources can be added to, or are already present\nin, the relationship then the server **MUST** return a successful response.\n\n> Note: This approach ensures that a request is successful if the server’s\n> state matches the requested state, and helps avoid pointless race conditions\n> caused by multiple clients making the same changes to a relationship.\n\nIn the following example, the comment with ID `123` is added to the list of\ncomments for the article with ID `1`:\n\n```\nPOST /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"123\" } ] } \n```\n\nIf the client makes a `DELETE` request to a URL from a\nrelationship link the server **MUST** delete the specified\nmembers from the relationship or return a `403 Forbidden` response. If all of\nthe specified resources are able to be removed from, or are already missing\nfrom, the relationship then the server **MUST** return a successful response.\n\n> Note: As described above for `POST` requests, this approach helps avoid\n> pointless race conditions between multiple clients making the same changes.\n\nRelationship members are specified in the same way as in the `POST` request.\n\nIn the following example, comments with IDs of `12` and `13` are removed\nfrom the list of comments for the article with ID `1`:\n\n```\nDELETE /articles/1/relationships/comments HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { \"data\": [ { \"type\": \"comments\", \"id\": \"12\" }, { \"type\": \"comments\", \"id\": \"13\" } ] } \n```\n\n> Note: RFC 7231 specifies that a DELETE request may include a body, but\n> that a server may reject the request. This spec defines the semantics of a\n> server, and we are defining its semantics for JSON:API.\n\n#### Responses\n\n##### 200 OK\n\nIf a server accepts an update but also changes the targeted relationship in\nother ways than those specified by the request, it **MUST** return a `200 OK`\nresponse and a document that includes the updated relationship data as its\nprimary data.\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if an update is successful and the server does not change the\ntargeted relationship in ways other than those specified by the request. Other\ntop-level members, such as meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a relationship update request has been accepted for processing, but the\nprocessing has not been completed by the time the server responds, the\nserver **MUST** return a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf an update is successful and the server doesn’t change the targeted\nrelationship in ways other than those specified by the request, the server\n**MUST** return either a `200 OK` status code and response document (as\ndescribed above) or a `204 No Content` status code with no response document.\n\n> Note: This is the appropriate response to a `POST` request sent to a URL\n> from a to-many relationship link when that relationship already\n> exists. It is also the appropriate response to a `DELETE` request sent to a URL\n> from a to-many relationship link when that relationship does\n> not exist.\n\n##### 403 Forbidden\n\nA server **MUST** return `403 Forbidden` in response to an unsupported request\nto update a relationship.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n### Deleting Resources\n\nA resource can be deleted by sending a `DELETE` request to the URL\nthat represents the resource:\n\n```\nDELETE /photos/1 HTTP/1.1 Accept: application/vnd.api+json \n```\n\n#### Responses\n\n##### 200 OK\n\nA server **MAY** return a `200 OK` response with a document that contains no\nprimary data if a deletion request is successful. Other top-level members, such\nas meta, could be included in the response document.\n\n##### 202 Accepted\n\nIf a deletion request has been accepted for processing, but the processing has\nnot been completed by the time the server responds, the server **MUST**\nreturn a `202 Accepted` status code.\n\n##### 204 No Content\n\nIf a deletion request is successful, the server **MUST** return either a `200\nOK` status code and response document (as described above) or a `204 No Content`\nstatus code with no response document.\n\n##### 404 NOT FOUND\n\nA server **SHOULD** return a `404 Not Found` status code if a deletion request fails\ndue to the resource not existing.\n\n##### Other Responses\n\nA server **MAY** respond with other HTTP status codes.\n\nA server **MAY** include error details with error responses.\n\nA server **MUST** prepare responses, and a client **MUST** interpret\nresponses, in accordance with\n[`HTTP semantics`](http://tools.ietf.org/html/rfc7231).\n\n## Query Parameters\n\n### Query Parameter Families\n\nAlthough “query parameter” is a common term in everyday web development, it is\nnot a well-standardized concept. Therefore, JSON:API provides its own\ndefinition of a query parameter.\n\nFor the most part, JSON:API’s definition coincides with colloquial usage, and its\ndetails can be safely ignored. However, one important consequence of this\ndefinition is that a URL like the following is considered to have two distinct\nquery parameters:\n\n```\n/?page[offset]=0&page[limit]=10\n```\n\nThe two parameters are named `page[offset]` and `page[limit]`; there is no\nsingle `page` parameter.\n\nIn practice, however, parameters like `page[offset]` and `page[limit]` are\nusually defined and processed together, and it’s convenient to refer to them\ncollectively. Therefore, JSON:API introduces the concept of a query parameter\nfamily.\n\nA “query parameter family” is the set of all query parameters whose name starts\nwith a “base name”, followed by zero or more instances of empty square brackets\n(i.e. `[]`), square-bracketed legal member names, or square-bracketed\ndot-separated lists of legal member names. The family is referred to\nby its base name.\n\nFor example, the `filter` query parameter family includes parameters named:\n`filter`, `filter[x]`, `filter[]`, `filter[x][]`, `filter[][]`, `filter[x][y]`,\n`filter[x.y]`, etc. However, `filter[_]` is not a valid parameter name in the\nfamily, because `_` is not a valid member name.\n\n> Note: Dot separated lists of legal member names are intended to be used for\n> relationship paths. For example, this allows filtering strategies using\n> relationship paths as defined for sorting in query parameters\n> such as `GET /posts?sort=author.name&filter[author.status]=active`.\n\n### Extension-Specific Query Parameters\n\nThe base name of every query parameter introduced by an extension **MUST** be\nprefixed with the extension’s namespace followed by a colon (`:`). The\nremainder of the base name **MUST** contain only the characters [a-z] (U+0061\nto U+007A, “a-z”).\n\n### Implementation-Specific Query Parameters\n\nImplementations **MAY** support custom query parameters. However, the names of\nthese query parameters **MUST** come from a family\nwhose base name is a legal member name and also contains at least\none non a-z character (i.e., outside U+0061 to U+007A).\n\nIt is **RECOMMENDED** that a capital letter (e.g. camelCasing) be used to\nsatisfy the above requirement.\n\nIf a server encounters a query parameter that does not follow the naming\nconventions above, or the server does not know how to process it as a query\nparameter from this specification, it **MUST** return `400 Bad Request`.\n\n> Note: By forbidding the use of query parameters that contain only the characters\n> [a-z], JSON:API is reserving the ability to standardize additional query\n> parameters later without conflicting with existing implementations.\n\n## Errors\n\n### Processing Errors\n\nA server **MAY** choose to stop processing as soon as a problem is encountered,\nor it **MAY** continue processing and encounter multiple problems. For instance,\na server might process multiple attributes and then return multiple validation\nproblems in a single response.\n\nWhen a server encounters multiple problems for a single request, the most\ngenerally applicable HTTP error code **SHOULD** be used in the response. For\ninstance, `400 Bad Request` might be appropriate for multiple 4xx errors\nor `500 Internal Server Error` might be appropriate for multiple 5xx errors.\n\n### Error Objects\n\nError objects provide additional information about problems encountered while\nperforming an operation. Error objects **MUST** be returned as an array\nkeyed by `errors` in the top level of a JSON:API document.\n\nAn error object **MAY** have the following members, and **MUST** contain at\nleast one of:\n\n- `id` : a unique identifier for this particular occurrence of the problem.\n- `links` : a links object that **MAY** contain the following members:\n - `about` : a link that leads to further details about this\n particular occurrence of the problem. When dereferenced, this URI **SHOULD** return a human-readable description of the error.\n - `type` : a link that identifies the type of error that this\n particular error is an instance of. This URI **SHOULD** be dereferenceable to\n a human-readable explanation of the general error.\n- `status` : the HTTP status code applicable to this problem, expressed as a\nstring value. This **SHOULD** be provided.\n- `code` : an application-specific error code, expressed as a string value.\n- `title` : a short, human-readable summary of the problem that **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of\nlocalization.\n- `detail` : a human-readable explanation specific to this occurrence of the\nproblem. Like `title` , this field’s value can be localized.\n- `source` : an object containing references to the primary source of the error.\nIt **SHOULD** include one of the following members or be omitted:\n - `pointer` : a JSON Pointer [ [RFC6901](https://tools.ietf.org/html/rfc6901) ]\n to the value in the request document that caused the error [e.g. `\"/data\"` for a primary data object, or `\"/data/attributes/title\"` for a specific\n attribute]. This **MUST** point to a value in the request document that\n exists; if it doesn’t, the client **SHOULD** simply ignore the pointer.\n - `parameter` : a string indicating which URI query parameter caused\n the error.\n - `header` : a string indicating the name of a single request header which\n caused the error.\n- `meta` : a meta object containing non-standard meta-information about the\nerror.\n\n## Appendix\n\n### Query Parameters Details\n\n#### Parsing/Serialization\n\nA query parameter is a name–value pair extracted from, or serialized into, a\nURI’s query string.\n\nTo extract the query parameters from a URI, an implementation **MUST** run the\nURI’s query string, excluding the leading question mark, through the\n[`application/x-www-form-urlencoded` parsing algorithm](https://url.spec.whatwg.org/#urlencoded-parsing),\nwith one exception: JSON:API allows the specification that defines a query\nparameter’s usage to provide its own rules for parsing the parameter’s value\nfrom the `value` bytes identified in steps 3.2 and and 3.3 of the `application/x-www-form-urlencoded`\nparsing algorithm. The resulting value might not be a string.\n\n> Note: In general, the query string parsing built in to servers and browsers\n> will match the process specified above, so most implementations do not need\n> to worry about this.\n> \n> The `application/x-www-form-urlencoded` format is referenced because it is\n> the basis for the `a=b&c=d` style that almost all query strings use today.\n> \n> However, `application/x-www-form-urlencoded` parsing contains the bizarre\n> historical artifact that `+` characters must be treated as spaces, and it\n> requires that all values be percent-decoded during parsing, which makes it\n> impossible to use [RFC 3986 delimiter characters](https://tools.ietf.org/html/rfc3986#section-2.2)\n> as delimiters. These issues motivate the exception that JSON:API defines above.\n\nSimilarly, to serialize a query parameter into a URI, an implementation **MUST**\nuse [the `application/x-www-form-urlencoded` serializer](https://url.spec.whatwg.org/#concept-urlencoded-serializer),\nwith the corresponding exception that a parameter’s value — but not its name —\nmay be serialized differently than that algorithm requires, provided the\nserialization does not interfere with the ability to parse back the resulting URI.\n\n#### Square Brackets in Parameter Names\n\nWith query parameter families, JSON:API allows for\nquery parameters whose names contain square brackets (i.e., U+005B “[” and\nU+005D “]”).\n\nAccording to the query parameter serialization rules above, a compliant\nimplementation will percent-encode these square brackets. However, some URI\nproducers — namely browsers — do not always encode them. Servers **SHOULD**\naccept requests in which these square brackets are left unencoded in a query\nparameter’s name. If a server does accept these requests, it **MUST** treat the\nrequest as equivalent to one in which the square brackets were percent-encoded.", "znaku_textu": 74467, "slov": 11327, "odkazu": 139, "kodovani": "windows-1250", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/format/1.1/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:50", "sha256": "0619dfb37f2b46f10960c393ec8fff157f4eca04fe21b278b23f39056b863050", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://github.com/json-api/json-api", "http://www.iana.org/assignments/media-types/application/vnd.api+json", "https://tools.ietf.org/html/bcp14", "https://tools.ietf.org/html/rfc2119", "https://tools.ietf.org/html/rfc8174", "https://tools.ietf.org/html/rfc3986", "https://tools.ietf.org/html/rfc6906", "https://tools.ietf.org/html/rfc3339", "https://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc8259", "https://tools.ietf.org/html/rfc8288", "https://tools.ietf.org/html/rfc5646", "https://datatracker.ietf.org/doc/html/rfc3986", "http://www.w3.org/TR/json-ld/", "http://tools.ietf.org/html/rfc7231", "http://tools.ietf.org/html/rfc4122.html", "https://tools.ietf.org/html/rfc6901", "https://url.spec.whatwg.org/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/implementations/", "titulek": "JSON:API — Implementations", "h1": "Implementations", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Implementations"}, {"uroven": 2, "text": "Client libraries"}, {"uroven": 3, "text": "JavaScript"}, {"uroven": 3, "text": "Typescript"}, {"uroven": 3, "text": "iOS"}, {"uroven": 3, "text": "Ruby"}, {"uroven": 3, "text": "PHP"}, {"uroven": 3, "text": "Dart"}, {"uroven": 3, "text": "Perl"}, {"uroven": 3, "text": "Java"}, {"uroven": 3, "text": "Android"}, {"uroven": 3, "text": "R"}, {"uroven": 3, "text": "Elm"}, {"uroven": 3, "text": ".NET"}, {"uroven": 3, "text": "Python"}, {"uroven": 2, "text": "Server libraries"}, {"uroven": 3, "text": "Swift"}, {"uroven": 3, "text": "PHP"}, {"uroven": 3, "text": "Node.js"}, {"uroven": 3, "text": "Ruby"}, {"uroven": 3, "text": "Python"}, {"uroven": 3, "text": "Go"}, {"uroven": 3, "text": ".NET"}, {"uroven": 3, "text": "Java"}, {"uroven": 3, "text": "Scala"}, {"uroven": 3, "text": "Elixir"}, {"uroven": 3, "text": "Haskell"}, {"uroven": 3, "text": "Perl"}, {"uroven": 3, "text": "Vala"}, {"uroven": 3, "text": "Rust"}, {"uroven": 3, "text": "Dart"}, {"uroven": 3, "text": "Crystal"}, {"uroven": 2, "text": "Examples"}, {"uroven": 3, "text": "Playground"}, {"uroven": 3, "text": "Ruby"}, {"uroven": 3, "text": "JavaScript"}, {"uroven": 3, "text": "Python"}], "markdown": "# Implementations\n\nThe following are projects implementing JSON:API. If you’d like your project listed, [send a\npull request](https://github.com/json-api/json-api).\n\n> Note: This specification marked 1.0 on May 29th, 2015. The implementations\n> below have not been verified for compliance, but a test suite is now being\n> assembled to vet them.\n\n## Client libraries\n\n### JavaScript\n\n- [ember-data](https://github.com/emberjs/data) is one of the original exemplar implementations. There is now an [official adapter](https://emberjs.com/api/ember-data/release/classes/DS.JSONAPIAdapter) to support json-api.\n- [backbone-relational-jsonapi](https://github.com/xbill82/backbone-relational-jsonapi) is a parsing layer for Backbone.Relational. Entities specified in JSON:API are automatically parsed to be injected into Backbone.Relational relations.\n- [orbit.js](https://github.com/orbitjs/orbit.js) is a standalone library for\ncoordinating access to data sources and keeping their contents synchronized.\nOrbit’s Common Library includes [JSONAPISource](https://github.com/orbitjs/orbit.js/blob/master/lib/orbit-common/jsonapi-source.js) for accessing JSON:API servers. Orbit can be used\nindependently or with Ember.js through the [ember-orbit](https://github.com/orbitjs/ember-orbit) integration library.\n- [YAYSON](https://github.com/confetti/yayson) is an isomorphic library for serializing and reading JSON:API data. Extend it to fit your models or just use it with plain objects.\n- [Ember JSON API Resources](https://github.com/pixelhandler/ember-jsonapi-resources) is an [Ember CLI](http://www.ember-cli.com) Addon for a lightweight solution for data persistence in an [Ember.js](http://emberjs.com) application.\n- [hapi-json-api](https://github.com/wraithgar/hapi-json-api) Plugin for the hapi framework; enforces Accept/Content-type rules and rewrites Boom errors to be spec compliant.\n- [jsonapi-datastore](https://github.com/beauby/jsonapi-datastore) is a lightweight standalone library for reading, serializing, and synchronizing relational JSON:API data.\n- [superagent-jsonapify](https://github.com/alex94puchades/superagent-jsonapify) A really lightweight (50 lines) JSON-API client addon for [superagent](https://github.com/visionmedia/superagent) , the isomorphic ajax client.\n- [angular-jsonapi](https://github.com/jakubrohleder/angular-jsonapi) An AngularJS JSON:API client\n- [redux-json-api](https://github.com/dixieio/redux-json-api) A library which integrated JSON:APIs with Redux store\n- [devour-client](https://github.com/twg/devour) A lightweight, framework agnostic, highly flexible JSON:API client\n- [json-api-normalizer](https://github.com/yury-dymov/json-api-normalizer) Normalizes JSON:API documents for state management solutions like Redux and Mobx\n- [jsona](https://github.com/olosegres/jsona) Data formatter that creates customizable, simplified objects from JSON or stored reduxObject (result object of [json-api-normalizer](https://github.com/yury-dymov/json-api-normalizer) ), and creates correct JSON from the same simplified objects.\n- [active-resource](https://github.com/nicklandgrebe/activeresource.js) A standalone, convention-driven JavaScript ORM that maps to your JSON:API server and allows for advanced queries and relational management through a smooth interface.\n- [redux-bees](https://github.com/cantierecreativo/redux-bees) A nice, short and declarative way to interact with JSON:APIs in React+Redux\n- [Coloquent](https://github.com/DavidDuwaer/Coloquent) Javascript/Typescript library mapping objects and their interrelations to JSON:API, with a clean, fluent ActiveRecord-like (e.g. similar to Laravel’s Eloquent) syntax for creating, retrieving, updating and deleting model objects.\n- [kitsu](https://github.com/wopian/kitsu) A simple, lightweight & framework agnostic JSON:API client\n- [Sarala JSON API data formatter](https://github.com/milroyfraser/sarala-json-api-data-formatter) is a simple and fluent framework agnostic javascript library to transform standard JSON:API responses to simple JSON objects and vice versa.\n- [Sarala](https://github.com/milroyfraser/sarala) is a javascript package which gives you a [Laravel Eloquent](https://laravel.com/docs/5.6/eloquent) like syntax to perform CRUD operations against an JSON:API built according to [JSON:API specification](http://jsonapi.org/format/) .\n- [jsonapi-client](https://github.com/itsfadnis/jsonapi-client) A convenient module to consume a jsonapi service\n- [JSORM](https://github.com/jsonapi-suite/jsorm) is an\nisomorphic ActiveRecord clone that issues JSON:API requests instead of SQL and is part of the larger [JSONAPI Suite](https://github.com/jsonapi-suite/) .\n- [jsonapi-vuex](https://github.com/mrichar1/jsonapi-vuex) A module for interacting with a jsonapi service using a Vuex store, restructuring/normalizing records to make life easier.\n- [heather-js](https://github.com/bitex-la/heather-js) A library for parsing JSONAPI into objects from ES6 classes.\n- [@hyral/core](https://github.com/SyneticNL/Hyral) - An advanced, documented, easily extendable and lightweight (JSON:)API abstraction library with ORM-like CRUD support, automatic relationships handling and support for multiple (different) backends.\n- [@hyral/vue](https://github.com/SyneticNL/Hyral/tree/master/packages/vue) - Vue(x) integration for [@hyral/core](https://github.com/SyneticNL/Hyral) for Store-module creation and mixins\n- [jsonapi-redux-data](https://github.com/wednesday-solutions/jsonapi-redux-data) - a library that makes integration of jsonapi with react + redux effortless and easy.\n- [jsonapi-fractal](https://github.com/andersondanilo/jsonapi-fractal) JSON:API Serializer inspired by Fractal (PHP)\n- [ts-japi](https://github.com/jun-sheaf/ts-japi) - A zero-dependency, highly-modular, js/ts-friendly, recursible, framework-agnostic library for serializing data to the JSON:API specification. Serializes the entire specification.\n- [mobx-async-store](https://github.com/artemis-ag/mobx-async-store) - A Mobx-based store for async data fetching and state management for the JSON:API specification.\n- [spraypaint](https://github.com/graphiti-api/spraypaint.js) - JS Client for Graphiti similar to ActiveRecord. Written in Typescript but works in plain old ES5 as well. This library is isomorphic - use it from the browser, or from the server with NodeJS.\n- [json-api-models](https://github.com/tobyzerner/json-api-models) - A lightweight layer for working with JSON:API data.\n- [fetchja](https://github.com/caiotarifa/fetchja) - A super simple, modern, and lightweight library for dealing with JSON:API (Kitsu-like, but using Fetch API instead of Axios).\n\n### Typescript\n\n- [ts-angular-jsonapi](https://github.com/reyesoft/ts-angular-jsonapi) A JSON:API library developed for AngularJS in Typescript\n- [ngrx-json-api](https://github.com/abdulhaq-e/ngrx-json-api) A JSON:API client for Angular 2 ngrx toolset\n- [ts-jsonapi](https://github.com/mohuk/ts-jsonapi) JSON:API (De)Serializer in Typescript\n- [ngx-jsonapi](https://github.com/reyesoft/ngx-jsonapi) A JSON:API fast client library for Angular with storage+memory cache.\n- [@crnk/angular-ngrx](https://www.npmjs.com/package/@crnk/angular-ngrx) Angular helper library for ngrx-json-api and (optionally) crnk. Facilitates the binding of UI components to ngrx-json-api, most notably tables and forms.\n- [Grivet](https://github.com/muellerbbm-vas/grivet) A JSON:API client library written in TypeScript with emphasis on RESTful traversal of resources according to HATEOAS principles.\n- [DatX](https://github.com/infinum/datx) is an opinionated data store for use with the MobX state management library that adds JSON:API support with [datx-jsonapi](https://github.com/infinum/datx/tree/master/packages/datx-jsonapi) mixin.\n- [jsonapi-fractal](https://github.com/andersondanilo/jsonapi-fractal) JSON:API Serializer inspired by Fractal (PHP)\n- [ts-japi](https://github.com/jun-sheaf/ts-japi) - A zero-dependency, highly-modular, js/ts-friendly, recursible, framework-agnostic library for serializing data to the JSON:API specification. Serializes the entire specification.\n- [drupal-jsonapi-params](https://github.com/d34dman/drupal-jsonapi-params) A library for building query parameters when connecting with Drupal CMS’s JSON:API.\n- [EntityStore.TS](https://github.com/dipscope/EntityStore.TS) - ORM like abstraction layer for TypeScript which includes extensible [provider](https://github.com/dipscope/JsonApiEntityProvider.TS) for accessing JSON:API servers.\n\n### iOS\n\n- [jsonapi-ios](https://github.com/joshdholtz/jsonapi-ios) is a library for loading data from a JSON:API datasource. Parses JSON:API data into models with support for auto-linking of resources and custom model classes.\n- [Spine](https://github.com/wvteijlingen/spine) is a Swift library for working with JSON:API APIs. It supports mapping to custom model classes, fetching, advanced querying, linking and persisting.\n- [Vox](https://github.com/aronbalog/Vox) is a Swift JSON:API client framework with custom model classes support and nice networking interface.\n- [Japx](https://github.com/infinum/Japx) is lightweight JSON:API parser that flattens complex JSON:API structure and turns it into simple JSON and vice versa. It works by transferring Dictionary to Dictionary, so you can use Codable, Unbox, Wrap, ObjectMapper or any other object mapping tool that you prefer. It supports Objective-C as well.\n- [mattpolzin / JSONAPI](https://github.com/mattpolzin/JSONAPI) is a Swift Codable library with heavy emphasis on type-safety. It is platform agnostic so it can be used client- and server-side.\n- [IzzyParser](https://github.com/undabot/izzyparser-ios) is a lightweight library for serializing and deserializing JSON:API objects.\n- [Datadog/swift-jsonapi](https://github.com/Datadog/swift-jsonapi) is a Swift library that provides macros to simplify the encoding and decoding of JSON:API responses.\n\n### Ruby\n\n- [jsonapi-consumer](https://github.com/jsmestad/jsonapi-consumer) a ruby library for consuming JSONAPI payloads.\n- [JsonApiClient](https://github.com/chingor13/json_api_client) attempts to give you a query building framework that is easy to understand (similar to ActiveRecord scopes).\n- [Munson](https://github.com/coryodaniel/munson) is a ruby JSONAPI client that can act as an ORM or integrate with your models via fine-grained agnosticism. Easy to configure and customize. Includes a chainable/customizable query builder, attributes API and dirty tracking.\n- [json-api-vanilla](https://github.com/trainline/json-api-vanilla) a reference-aware ruby library for JSONAPI deserialization that doesn’t require setting up classes.\n- [SimpleJSONAPIClient](https://github.com/amcaplan/simple_jsonapi_client) gives you lower-level control for API operations, while your models and their relationships maintain a neat, ActiveRecord-inspired interface.\n- [jsonapi-unwrapper](https://github.com/Sonberg/jsonapi-unwrapper) a simple and lightweight library to deserialize JSON:API payloads.\n\n### PHP\n\n- [Art4 / json-api-client](https://github.com/Art4/json-api-client) is a library for validating and handling the response body in a simple OOP way.\n- [woohoolabs / yang](https://github.com/woohoolabs/yang) is a PSR-7 compatible library that is able to build and send requests, and handle responses.\n- [enm/json-api-client](https://eosnewmedia.github.io/JSON-API-Client/) is an abstract client-side PHP implementation of the json:api specification which is based on [enm/json-api-common](https://eosnewmedia.github.io/JSON-API-Common/) . It allows you to send json:api requests via your own http client implementation or via a buzz or guzzle client.\n- [floor9design-ltd/json-api-formatter](https://github.com/floor9design-ltd/json-api-formatter) An open source library designed to be used for generating and interacting with (making and receiving) JSON API requests. 100% unit tested and actively maintained by the author. Easy to use with frameworks such as Laravel/Symfony.\n- [swisnl/json-api-client](https://github.com/swisnl/json-api-client) Is a package for mapping remote {json:api} resources to Eloquent like models and collections.\n\n### Dart\n\n- [json_api](https://pub.dev/packages/json_api) is a full-fledged client for Flutter/Web/VM.\n- [rest_data](https://pub.dev/packages/rest_data) is a REST API client based on `ember-data` concepts which includes a JSON:API adapter.\n- [jsonapi_client](https://pub.dev/packages/jsonapi_client) is a simple JSON:API v1.0 client written in Dart.\n- [japx](https://pub.dev/packages/japx) is a lightweight JSON:API parser that flattens complex JSON:API structure and turns it into simple JSON and vice versa\n\n### Perl\n\n- [PONAPI::Client](https://metacpan.org/pod/PONAPI::Client) is a simple/extensible JSON:API v1.0 client.\n\n### Java\n\n- [jsonapi-converter](https://github.com/jasminb/jsonapi-converter) is a Java JSON:API v1.0 client. Besides providing means for serialisation/deserialisation, client comes with Retrofit plugin.\n- [crnk.io](http://www.crnk.io) is a JSON:API framework for clients and servers. On the client-side it targets\nboth Java and Android development. As for the backend side a rich set of modules helps with the integration of various\nJava frameworks.\n- [jsonapi](https://github.com/MarkoMilos/jsonapi) Library for streamlined use of JSON:API using Kotlin and Java built on top of Moshi from Square. It is built with a powerful api and supports JVM (Java/Kotlin) and Android. Supporting deserialization and serialization it is meant to be used on both client and server side.\n\n### Android\n\n- [faogustavo/JSONApi](https://github.com/faogustavo/JSONApi) library for deserializing automatic. It can be integrated with retrofit. It has some ideas from Morpheus and jsonapi-converter but has some aditionals.\n- [moshi-jsonapi](https://github.com/kamikat/moshi-jsonapi) serialize/deserialize JSON:API v1.0 using fantistic Moshi API! With friendly Java interface and easy integration with Retrofit.\n- [Morpheus](https://github.com/xamoom/Morpheus) library for deserializing your resources with automatic mapping for relationships. Uses gson to map objects in attributes.\n- [Izzy JSONAPI parser](https://github.com/undabot/izzy-json-api-android) library for deserializing and serializing resources with support both for Gson and Jackson parsers. It also has simple Retrofit integration.\n- [JsonApiX](https://github.com/infinum/kotlin-jsonapix) annotation processor library for serializing and deserializing Kotlin classes. It’s easy to use - setup only requires annotating classes. Retrofit integration is included.\n\n### R\n\n- [rjsonapi](https://github.com/sckott/rjsonapi) is an R client to consume JSONAPI’s.\n\n### Elm\n\n- [elm-jsonapi](https://github.com/noahzgordon/elm-jsonapi) provides decoders and helper functions for clients receiving JSON:API payloads.\n- [elm-jsonapi-http](https://github.com/noahzgordon/elm-jsonapi-http) wraps `elm-jsonapi` and handles the details of content negotiation with JSON:API-compliant servers, providing a smoother interface for consumers.\n\n### .NET\n\n- [Hypermedia.JsonApi.Client](https://github.com/cosullivan/Hypermedia/) is a set of extension methods to the HttpClient which allow for reading\nand writing of JSON:API documents.\n- [JsonApiSerializer](https://github.com/codecutout/JsonApiSerializer) is a configurationless JSON:API serialization and deserialization library implemented as a Json.NET `JsonSerializerSetting` . It leverages the existing power and flexibility of Json.NET while providing a sensible default mapping between JSON:API and CLR objects.\n- [JsonApiFramework.Client](https://github.com/scott-mcdonald/JsonApiFramework) is a *portable* .NET Standard/Core client-side framework where developers define the domain model of the resources of a hypermedia API server either through configuration and/or conventions called a *service model* . With a *service model* developers can use a *document context* that represents a session with a JSON:API compound *document* for reading or writing of various JSON:API abstractions such as resources, resource identifiers, relationships, links, meta information, error objects, and version information all serialized/deserialized as high level CLR objects.\n- [FSharp.JsonApi](https://github.com/cmeeren/FSharp.JsonApi/) is a library that allows you to use F# to easily create and consume flexible, strongly typed web APIs following the JSON:API specification.\n- [jsonapi-consumer](https://github.com/OKTAYKIR/jsonapi-consumer/) is a simple client-side .NET Standard wrapper framework for consuming JSON:API based APIs.\n\n### Python\n\n- [jsonapi-requests](https://github.com/socialwifi/jsonapi-requests/) Simple and fun high-level JSONAPI client for Python. Contains ORM which makes consuming the API even easier, in a DRY manner. It has a low-level API similar to requests as well, which gives you all the flexibility that you may need.\n- [jsonapi-client](https://github.com/qvantel/jsonapi-client) Comprehensive yet easy-to-use, pythonic, ORM-like access to JSON:API services\n- [json-api-doc](https://github.com/noplay/json-api-doc) JSON:API parser returning a simple Python dictionary\n- [json-api-smart](https://github.com/NilssonPL/json-api-smart) JSON:API with an ORM interface\n\n## Server libraries\n\n### Swift\n\n- [aonawale / JSONAPISerializer](https://github.com/aonawale/JSONAPISerializer) is a server side swift framework agnostic library that implements JSON:API v1.0.\n- [mattpolzin / JSONAPI](https://github.com/mattpolzin/JSONAPI) is a Swift Codable library with heavy emphasis on type-safety. It is platform agnostic so it can be used client- and server-side.\n- [Datadog/swift-jsonapi](https://github.com/Datadog/swift-jsonapi) is a Swift library that provides macros to simplify the encoding and decoding of JSON:API responses.\n\n### PHP\n\n- [tobyz / json-api-server](https://github.com/tobyzerner/json-api-server) is a framework-agnostic declarative JSON:API server implementation.\n- [neomerx / json-api](https://github.com/neomerx/json-api) is a framework agnostic library that fully implements JSON:API v1.0.\n- [limoncello-php / app](https://github.com/limoncello-php/app) is a JSON:API v1.0 quick start server application for [neomerx / json-api](https://github.com/neomerx/json-api) .\n- [lode / jsonapi](https://github.com/lode/jsonapi) is a human-friendly library to implement JSON:API v1.1 without needing to know the specification.\n- [woohoolabs / yin](https://github.com/woohoolabs/yin) is a library for advanced users aiming for efficiency and elegance.\n- [nilportugues / json-api](https://github.com/nilportugues/json-api) Serializer transformers outputting valid API responses in JSON and JSON:API formats.\n- [nilportugues / symfony2-jsonapi-transformer](https://github.com/nilportugues/symfony2-jsonapi-transformer) Symfony 2 JSON:API Transformer Bundle outputting valid API responses in JSON and JSON:API formats.\n- [nilportugues / laravel5-jsonapi-transformer](https://github.com/nilportugues/laravel5-jsonapi-transformer) Laravel 5 JSON:API Transformer Package outputting valid API responses in JSON and JSON:API formats.\n- [tuyakhov / yii2-json-api](https://github.com/tuyakhov/yii2-json-api) Implementation of JSON:API specification for the Yii framework.\n- [json-api-php/json-api](https://github.com/json-api-php/json-api) An attempt to translate the JSON:API specification into a set of high quality unit/functional tests and implement it in PHP 7 strictly following TDD and SOLID OOP principles.\n- [laravel-json-api/laravel](https://github.com/laravel-json-api/laravel) Laravel implementation of the JSON:API specification, with full feature support and extensive documentation.\n- [FriendsOfCake/crud-json-api](https://github.com/FriendsOfCake/crud-json-api) CakePHP Crud Listener for building maintainable JSON:API compliant APIs.\n- [thephpleague/fractal](http://fractal.thephpleague.com/) A partial implementation of the JSON:API spec allowing for an easy drop in JSON rendering solution.\n- [oligus/jad](https://github.com/oligus/jad) A library that turns doctrine entities into json:api resource, or collection of resources, automagically.\n- [enm/json-api-server](https://eosnewmedia.github.io/JSON-API-Server/) is an abstract server-side PHP (>= 7.2) implementation of the json:api specification, based on [enm/json-api-common](https://eosnewmedia.github.io/JSON-API-Common/) . It handles json:api requests via request handlers through a centralized handle-method. It can be used with psr-7-request/response or your own request and response logic.\n- [enm/json-api-server-bundle](https://eosnewmedia.github.io/JSON-API-Server-Bundle/) is a symfony bundle which integrates [enm/json-api-server](https://eosnewmedia.github.io/JSON-API-Server/) into your symfony application (symfony version ^4.0).\n- [raml-json-api](https://github.com/RJAPI/raml-json-api) RAML based JSON:API code generator for Laravel. Generates controllers, middlewares, models, routes, migrations and serves JSON:API.\n- [paknahad/jsonapi-bundle](https://github.com/paknahad/jsonapi-bundle) is a Symfony bundle. It is the fastest way to generate API.\n- [swisnl/json-api-server](https://github.com/swisnl/json-api-server) is a Laravel package to get a JSON:API up and running in minutes.\n- [hackerboy/json-api](https://github.com/hackerboydotcom/json-api) is a lightweight library that helps you to implement JSONAPI easily\n- [drupal](https://www.drupal.org/project/drupal) The Drupal CMS supports exposing all data it manages (entities) according to the JSON:API specification. [jsonapi_extras](https://www.drupal.org/project/jsonapi_extras) is an optional extra module to change resource type names, field names and more.\n- [bednic/json-api](https://gitlab.com/bednic/json-api) Annotation driven library for creating valid JSON API response document from your objects.\n- [pz/doctrine-rest](https://github.com/R3VoLuT1OneR/doctrine-rest) library provides basic tools for implementation of JSON:API with Doctrine 2\n- [pz/jsonapi-resource](https://github.com/R3VoLuT1OneR/jsonapi-resource) Serialize PHP class object into JSON:API resource object using PHP 8.0 Attributes.\n- [binarcode/laravel-restify](https://github.com/binarcode/laravel-restify) The fastest way to make a powerful JSON:API compatible Rest API with Laravel [Reference Docs](https://restify.binarcode.com/) .\n- [API Platform](https://api-platform.com) is an API-first Framework supporting JSON:API.\n\n### Node.js\n\n- [Fortune.js](http://fortune.js.org/) is a library that includes a [comprehensive implementation of JSON:API](https://github.com/fortunejs/fortune-json-api) .\n- [json-api](https://www.npmjs.org/package/json-api) turns an Express + Mongoose app into a JSON-API server.\n- [endpoints](https://github.com/endpoints) is an implementation of JSON:API using [Bookshelf](http://bookshelfjs.org) .\n- [YAYSON](https://github.com/confetti/yayson) is an isomorphic library for serializing and reading JSON:API data. Simply use it with plain objects or extend it to fit your ORM (currently it has an adapter for [Sequelize](http://sequelizejs.com) ).\n- [jsonapi-serializer](https://github.com/SeyZ/jsonapi-serializer) is a Node.js framework agnostic library for serializing your data to JSON:API.\n- [jsonapi-server](https://github.com/holidayextras/jsonapi-server) A feature-rich config-driven json:api framework.\n - [jsonapi-store-memoryhandler](https://github.com/holidayextras/jsonapi-server/blob/master/documentation/resources.md) An in-memory data store for rapid prototyping.\n - [jsonapi-store-relationaldb](https://github.com/holidayextras/jsonapi-store-relationaldb) A relational database handler for jsonapi-server.\n - [jsonapi-store-mongodb](https://github.com/holidayextras/jsonapi-store-mongodb) A mongodb handler for jsonapi-server.\n - [jsonapi-store-elasticsearch](https://github.com/holidayextras/jsonapi-store-elasticsearch) An elasticsearch handler for jsonapi-server.\n- [jagql](https://jagql.github.io) A resource driven framework to set up a {json:api} + GraphQL endpoint in record time.\n - [jagql/store-sequelize](https://npmjs.com/@jagql/store-sequelize) persist jagql resources to Postgres/MySQL/MSSQL/SQLite\n- [loopback-component-jsonapi](https://github.com/digitalsadhu/loopback-component-jsonapi) JSON:API support for [loopback](https://github.com/strongloop/loopback) highly-extensible, open-source Node.js framework\n- [loopback-jsonapi-model-serializer](https://www.npmjs.com/package/loopback-jsonapi-model-serializer) JSON:API serializer for loopback models.\n- [jsonapi-mapper](https://github.com/scoutforpets/jsonapi-mapper) JSON:API-Compliant Serialization for your Node ORM.\n- [jaysonapi](https://github.com/digia/jaysonapi) jaysonapi is a framework agnostic JSON:API v1.0.0 serializer. jaysonapi provides more of a functional approach to serializing your data. Define a serializer with a type and schema, and call serialize on it passing in the data, included, meta, errors, etc. as a plain object.\n- [json-api-ify](https://github.com/kutlerskaggs/json-api-ify) serialize the **** out of your data. json:api v1.0 complaint.\n- [bookshelf-jsonapi-params](https://github.com/scoutforpets/bookshelf-jsonapi-params) automatically apply JSON:API filtering, pagination, sparse fieldsets, includes, and sorting to your Bookshelf.js queries.\n- [Lux](https://github.com/postlight/lux) is a MVC style Node.js framework for building lightning fast JSON:APIs.\n- [jsonapi-mock](https://github.com/Thomas-X/jsonapi-mock) A [json-server](https://github.com/typicode/json-server) inspired jsonapi mock server. Setup a jsonapi mock server in almost no time, uses lowdb.\n- [DenaliJS](http://denalijs.org) A layered-conventions framework for building ambitious APIs. Includes a powerful addon system, best-in-class developer experience, and extensive documentation.\n- [jsonapi-fractal](https://github.com/andersondanilo/jsonapi-fractal) JSON:API Serializer inspired by Fractal (PHP)\n- [ts-japi](https://github.com/jun-sheaf/ts-japi) - A zero-dependency, highly-modular, js/ts-friendly, recursible, framework-agnostic library for serializing data to the JSON:API specification. Serializes the entire specification.\n- [Kurier](https://github.com/kurierjs/kurier) is a TypeScript framework to create APIs following the [1.1 Spec of JSON:API](https://jsonapi.org/format/1.1/) + the [Operations proposal spec](https://github.com/json-api/json-api/blob/999e6df77b28549d6c37b163b73c8e9102400020/_format/1.1/index.md#operations) .\n- [nestjs-json-api](https://github.com/klerick/nestjs-json-api) A module for NestJS and TypeORM to implement JSON API supporting features such as, end point, query params, body params, validation and transformation response.\n\n### Ruby\n\n- Plain Ruby\n - [Yaks](https://github.com/plexus/yaks) Library for building hypermedia APIs, contains a JSON:API output format.\n - [JSONAPI::Serializers](https://github.com/fotinakis/jsonapi-serializers) provides a pure Ruby, readonly serializer implementation.\n - [JSONAPI::Realizer](https://github.com/krainboltgreene/jsonapi-realizer) provides a pure Ruby pattern for turning JSON:API requests into models (has active record support and rails instructions)\n - [Roar](https://github.com/apotonick/roar) Renders and parses representations of Ruby objects\n - [Jbuilder::JsonAPI](https://github.com/vladfaust/jbuilder-json_api) Simple & lightweight extension for Jbuilder\n - [jsonapi-rb](http://jsonapi-rb.org) Ruby library for efficiently building and consuming JSON:API documents - with Rails and Hanami integrations.\n - [fast_jsonapi](https://github.com/Netflix/fast_jsonapi) A lightning fast JSON:API serializer for Ruby Objects.\n - [jsonapi_parameters](https://github.com/visualitypl/jsonapi_parameters) Rails-way to consume JSON:API input.\n- Ruby on Rails\n - [Jsonapi-for-rails](https://github.com/doga/jsonapi_for_rails) empowers your JSONAPI compliant [Rails](http://rubyonrails.org/) APIs. Implement your APIs with very little coding.\n - [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) is one of the original exemplar implementations, but is slightly out of date at\n the moment.\n - [JSONAPI::Resources](https://github.com/cerebris/jsonapi-resources) provides a complete framework for developing a JSON:API server. It is designed to work with Rails, and provides routes, controllers, and serializers.\n - [JSONAPI::Utils](https://github.com/b2beauty/jsonapi-utils) works on top of [JSONAPI::Resources](https://github.com/cerebris/jsonapi-resources) taking advantage of its resource-driven style and bringing a Rails way to build modern APIs with no or less learning curve.\n - [Caprese](https://github.com/nicklandgrebe/caprese) An opinionated Rails library for creating JSON:API servers that lets you focus on customizing the behavior of your endpoints rather than the dirty work of setting them up. Leverages the power of [ActiveModel::Serializer](https://github.com/rails-api/active_model_serializers) .\n - [JSONAPI Suite](https://github.com/jsonapi-suite) facilitates a server capable of deep querying and nested writes. Works\n with any ORM or datastore; comes with integration test helpers and\n automatic swagger documentation.\n - [JSONAPI.rb](https://github.com/stas/jsonapi.rb#usage) A set of pluggable\n mixins providing support for serialization (using `fast_jsonapi` ), error\n handling, includes, sparse fields, pagination, filtering (using `ransack` )\n and sorting. Strives to implement as much of the JSONAPI spec as possible.\n Small codebase (~500 sloc), good documentation and test coverage.\n - [Graphiti](https://www.graphiti.dev/guides/) a ruby library for RESTful Resources based on JSON:API. Works with vanilla Ruby, Sinatra and Rails.\n- Sinatra\n - [Sinja](https://github.com/mwpastore/sinja) extends [Sinatra](http://www.sinatrarb.com) and leverages [JSONAPI::Serializers](https://github.com/fotinakis/jsonapi-serializers) to enable rapid development of comprehensive, read-and-write, and JSON:API v1.0-compliant web services using the DAL/ORM of your choice. It includes a simple role-based authorization scheme, support for client-generated IDs, patchless clients, and coalesced find requests, exception handling, and more.\n\n### Python\n\n- [Hyp](https://github.com/kalasjocke/hyp) is a library for creating json-api responses.\n- [SQLAlchemy-JSONAPI](https://github.com/coltonprovias/sqlalchemy-jsonapi) provides JSON:API serialization for SQLAlchemy models.\n- [django-rest-framework-json-api](https://github.com/django-json-api/django-rest-framework-json-api) provides JSON:API parsing and rendering for the Django REST Framework\n- [jsoongia](https://github.com/digia/jsoongia) is a framework agnostic JSON:API implementation.\n- [ripozo](https://github.com/vertical-knowledge/ripozo/) provides a framework for serving JSON:API content (among other Hypermedia formats) in Flask, Django and more.\n- [marshmallow-jsonapi](https://github.com/marshmallow-code/marshmallow-jsonapi) provides JSON:API data formatting for any Python web framework.\n- [neoapi](https://pypi.python.org/pypi/neoapi/) serializes JSON:API–compliant responses from neomodel StructuredNodes for Neo4j data\n- [xamoom-janus](https://github.com/xamoom/xamoom-janus) is a Python module to easily and fast extend Python web frameworks like Flask or BottlyPy with json:api functionality. Also offers a flexible mechanism for data mapping and hooks to intercept and extend its functionality according to your projects needs.\n- [pyramid-jsonapi](https://github.com/colinhiggs/pyramid-jsonapi) Auto-build a JSON:API from sqlalchemy models using the pyramid framework.\n- [Flask-REST-JSONAPI](https://github.com/miLibris/flask-rest-jsonapi) Flask extension to create web api according to jsonapi specification with Flask, Marshmallow and data provider of your choice (SQLAlchemy, MongoDB, …)\n- [Flump](https://github.com/rolepoint/flump) Database agnostic JSON:API builder which depends on Flask and Marshmallow.\n- [SAFRS JSON API Framework](https://github.com/thomaxxl/safrs) Flask-SQLAlchemy jsonapi implementation with auto-generated openapi (fka swagger) interface.\n- [pydantic-jsonapi](https://github.com/DeanWay/pydantic-jsonapi) JSON:api validation with python type hinting using [pydantic](https://pydantic-docs.helpmanual.io/)\n- [pydanja](https://github.com/Centurix/pydanja) JSON:API implementation for [pydantic](https://pydantic-docs.helpmanual.io/) and [FastAPI](https://fastapi.tiangolo.com/) using generic types, complete with helpers for simplifying OpenAPI docs\n- [Flask-Restless-NG](https://github.com/mrevutskyi/flask-restless-ng) Builds JSON:API from SQLAlchemy models using Flask\n- [starlette-jsonapi](https://github.com/vladmunteanu/starlette-jsonapi) Microframework on top of Starlette and marshmallow-jsonapi with support for asynchronous ORMs\n- [kt.jsonapi](https://pypi.org/project/kt.jsonapi/) JSON:API response generation using the Zope Component Architecture.\n- [Flask-COMBO-JSONAPI](https://github.com/AdCombo/flask-combo-jsonapi) JSON:API flask extension for building REST APIs.\n- [FastAPI-JSONAPI](https://github.com/mts-ai/FastAPI-JSONAPI) FastAPI-JSONAPI is a FastAPI extension for building REST APIs\n\n### Go\n\n- [api2go](https://github.com/manyminds/api2go) is a full-fledged library to make it simple to provide a JSON:API with your Golang project.\n- [jsonapi](https://github.com/google/jsonapi) serializes and deserializes jsonapi formatted payloads using struct tags to annotate the structs that you already have in your Golang project. [Godoc](http://godoc.org/github.com/google/jsonapi)\n- [go-json-spec-handler](https://github.com/derekdowling/go-json-spec-handler) drop-in library for handling requests and sending responses in an existing API.\n- [jsh-api](https://github.com/derekdowling/go-json-spec-handler/tree/master/jsh-api) deals with the dirty work of building JSON:API resource endpoints. Built on top of [jsh](https://github.com/derekdowling/go-json-spec-handler)\n- [mfcochauxlaberge/jsonapi](https://github.com/mfcochauxlaberge/jsonapi) offers a large set of tools to build a JSON:API compliant service.\n- [pieoneers/jsonapi-go](https://github.com/pieoneers/jsonapi-go) lightweight JSON API implementation in Go. Make your client and server applications JSON API-enabled in hours not months.\n\n### .NET\n\n- [JsonApiDotNetCore](https://github.com/json-api-dotnet/JsonApiDotNetCore) is a framework for building json:api compliant REST APIs using .NET Core and Entity Framework Core. It eliminates as much boilerplate as possible by offering out-of-the-box features such as sorting, filtering and pagination. You just need to focus on defining the resources and implementing your custom business logic.\n- [JsonApiNet](https://github.com/l8nite/JsonApiNet) lets you quickly deserialize JSON:API documents into C# entities. Supports compound documents, complex type mapping from attributes, attribute mapping, and more. [See the README](https://github.com/l8nite/JsonApiNet/blob/master/README.md) for full details.\n- [NJsonApi](https://github.com/jacek-gorgon/NJsonApi) is a .NET server implementation of the standard. It aims at good extensibility and performance while maintaining developer-friendliness with interchangeable conventions and builder-style configuration.\n- [Migrap.AspNetCore.Hateoas](https://github.com/dcomartin/Migrap.AspNetCore.Hateoas) HATEOAS (Hypermedia as the Engine of Application State) framework for ASP.NET Core. Current implementation(s): Siren, JsonApi.\n- [Saule](https://github.com/joukevandermaas/saule/) is a small JSON:API 1.0 compatible library that integrates well with established Web API conventions. It has complete documentation and near 100% test coverage.\n- [Hypermedia.JsonApi.WebApi](https://github.com/cosullivan/Hypermedia/) is a Web API media type formatter for reading and writing JSON:API. It supports an external resource model definition and natively\nincludes related resources.\n- [JsonApiSerializer](https://github.com/codecutout/JsonApiSerializer) is a configurationless JSON:API serialization and deserialization library implemented as a Json.NET `JsonSerializerSetting` . It leverages the existing power and flexibility of Json.NET while providing a sensible default mapping between JSON:API and CLR objects.\n- [JsonApiFramework.Server](https://github.com/scott-mcdonald/JsonApiFramework) is a *portable* .NET Standard/Core server-side framework where developers define the domain model of the resources of a hypermedia API server either through configuration and/or conventions called a *service model* . With a *service model* developers can use a *document context* that represents a session with a JSON:API compound *document* for reading or writing of various JSON:API abstractions such as resources, resource identifiers, relationships, links, meta information, error objects, and version information all serialized/deserialized as high level CLR objects with automatic generation of JSON:API hypermedia.\n- [FSharp.JsonApi](https://github.com/cmeeren/FSharp.JsonApi/) is a library that allows you to use F# to easily create and consume flexible, strongly typed web APIs following the JSON:API specification.\n- [Felicity](https://github.com/cmeeren/Felicity/) is a boilerplate-free JSON:API framework for your functional F# domain model, optimized for developer happiness\n\n### Java\n\n- [crnk.io](http://www.crnk.io) is a JSON:API framework for clients and servers. It was started as a fork for Katharsis after the later [lost development momentum](https://www.reddit.com/r/java/comments/6hs0n8/crnkio_10_released_crank_up_rest_development/) . It has similar concepts but with active development support. On the server-side it comes, among others,\nwith a rich set of integrations (Servlet, JAX-RS, Spring, JPA, Bean Validation, Zipkin and more), bulk updates with JSON Patch, a meta-model for automation purposes, client stub generation for TypeScript and a module API for third-party contributions.\n- [Elide](http://elide.io) is a web framework supporting JSON:API. Through annotation-based JSON:API endpoint generation, Elide enables you to focus on your data model, security model, and business logic while avoiding unnecessary boilerplate. Moreover, through use of the JSON:API Patch extension, [Elide](http://elide.io) provides full support for database transactions.\n- [JSON:API for Spring HATEOAS](https://github.com/toedter/spring-hateoas-jsonapi) provides serialization/deserialization of the Spring HATEOAS representation models. The project also provides a builder to easily create relationships, included resource objects, pagination, and more.\n- [jsonapi-rvp](https://github.com/xlate/jsonapi-rvp) utilizes the platform capabilities available in the Jakarta EE environment (formerly Java EE) to expose JPA entities via JSON:API. Features include query and entity validation (using Bean Validators), pagination, use of surrogate keys as record identifiers, support for LEFT outer join conditions, and a simple JavaScript client.\n- [JSON:API object converter](https://github.com/MieskeB/json-api-spring-boot) converts normal Java objects to JSON:API standard with the use of annotations in the viewmodels (dtos).\n- [Dashjoin Low Code Development Platform](https://github.com/dashjoin/platform) connects to relational, document, and graph databases and makes them available via JSON:API. The platform offers powerful access control mechanisms, a query editor, and graphical layout designers.\n- [jsonapi-simple](https://github.com/devslm/jsonapi-simple) is a simple implementation of the JSON:API specification (only required output fields). This library implements only top-level fields: data, links, errors and meta (using spring boot dependencies) without any relationships, includes and others. It implemented also filtering, sorting and sparse fieldset. [See the documentation](https://devslm.github.io/jsonapi-simple/) for full details.\n\n### Scala\n\n- [scala-jsonapi](https://github.com/scala-jsonapi/scala-jsonapi) A Scala library for producing JSON output (and deserializing JSON input) based on JSON:API specification.\n\n### Elixir\n\n- [ja_serializer](https://github.com/AgilionApps/ja_serializer) is a behaviour and DSL to emit conforming JSON. Suitable for use in a Phoenix view or in a Plug stack.\n- [jsonapi](https://github.com/jeregrine/jsonapi) is a serializer and query parser built with plain old functions. Can parse and validate a JSONAPI compliant query and serialize Ecto Models or Elixir Structs into conforming JSON. Suitable for use in a Phoenix view, Plug Stack or anywhere you can call functions.\n\n### Haskell\n\n- [json-api](https://github.com/toddmohney/json-api) functions and datatypes for representing user-defined resources in accordance with the JSON-API specification.\n\n### Perl\n\n- [PONAPI::Server](https://metacpan.org/pod/PONAPI::Server) is a Plack-based web server, providing a generic service adhering to the spec. just plug your data-repository & play.\n\n### Vala\n\n- [JSON-API-GLib](https://github.com/major-lab/json-api-glib) provides GObjects that can be serialized to and unserialized from payloads with [JSON-GLib](https://wiki.gnome.org/Projects/JsonGlib) .\n\n### Rust\n\n- [jsonapi-rust](https://github.com/michiel/jsonapi-rust) A Rust library for serializing, deserializing and working with JSON-API data\n\n### Dart\n\n- [json_api_server](https://pub.dartlang.org/packages/json_api_server) is a JSON:API server running on Dart VM.\n\n### Crystal\n\n- [jsonapi-serializer-cr](https://github.com/andersondanilo/jsonapi-serializer-cr) is a JSON:API Serializer for Crystal Lang.\n\n## Examples\n\n- [Endpoints provides a fully working example API](http://github.com/endpoints/example/)\n- [Sinja provides a fully-working example API](https://github.com/mwpastore/sinja/tree/master/demo-app)\n\n### Playground\n\n- [json-api-document-viewer](https://tadast.github.io/json-api-document-viewer) the flat json:api structure is a good way to express complex relationships between objects. However the same flatness makes it difficult for humans to “parse” these relationships. This tool visualises object relationships by visually nesting them.\n- [corroborate](http://corroborate.arenpatel.com/) JSON:API request/response payload validator. It warns when there is a specification violation and also informs when a recommendation has not been followed.\n\n### Ruby\n\n- [json-patch](https://github.com/guillec/json-patch) implementation of JSON Patch (rfc6902)\n- [hana](https://github.com/tenderlove/hana) implementation of the JSON Patch and JSON pointer spec\n\n### JavaScript\n\n- [json-api-merge](https://www.npmjs.com/package/json-api-merge) JSON:API specific redundant duplication algorithm for merging included resources into original data\n- [json-patch](https://www.npmjs.org/package/json-patch) implementation of JSON Patch (rfc6902)\n\n### Python\n\n- [jsonpatch](https://python-json-patch.readthedocs.org) implementation of JSON Patch (rfc6902)\n- [drf-json-patch](https://drf-json-patch.readthedocs.org) integrates jsonpatch with Django REST Framework", "znaku_textu": 42509, "slov": 4691, "odkazu": 289, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/implementations/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:43", "sha256": "f78dae18bb3871f183b472b922fc3fb6d6e4bd93da9de7bd90d67d7ec3f4fd4f", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://github.com/json-api/json-api", "https://github.com/emberjs/data", "https://emberjs.com/api/ember-data/release/classes/DS.JSONAPIAdapter", "https://github.com/xbill82/backbone-relational-jsonapi", "https://github.com/orbitjs/orbit.js", "https://github.com/orbitjs/orbit.js/blob/master/lib/orbit-common/jsonapi-source.js", "https://github.com/orbitjs/ember-orbit", "https://github.com/confetti/yayson", "https://github.com/pixelhandler/ember-jsonapi-resources", "http://www.ember-cli.com/", "http://emberjs.com/", "https://github.com/wraithgar/hapi-json-api", "https://github.com/beauby/jsonapi-datastore", "https://github.com/alex94puchades/superagent-jsonapify", "https://github.com/visionmedia/superagent", "https://github.com/jakubrohleder/angular-jsonapi", "https://github.com/dixieio/redux-json-api", "https://github.com/twg/devour", "https://github.com/yury-dymov/json-api-normalizer", "https://github.com/olosegres/jsona", "https://github.com/nicklandgrebe/activeresource.js", "https://github.com/cantierecreativo/redux-bees", "https://github.com/DavidDuwaer/Coloquent", "https://github.com/wopian/kitsu", "https://github.com/milroyfraser/sarala-json-api-data-formatter", "https://github.com/milroyfraser/sarala", "https://laravel.com/docs/5.6/eloquent", "https://github.com/itsfadnis/jsonapi-client", "https://github.com/jsonapi-suite/jsorm", "https://github.com/jsonapi-suite/", "https://github.com/mrichar1/jsonapi-vuex", "https://github.com/bitex-la/heather-js", "https://github.com/SyneticNL/Hyral", "https://github.com/SyneticNL/Hyral/tree/master/packages/vue", "https://github.com/wednesday-solutions/jsonapi-redux-data", "https://github.com/andersondanilo/jsonapi-fractal", "https://github.com/jun-sheaf/ts-japi", "https://github.com/artemis-ag/mobx-async-store", "https://github.com/graphiti-api/spraypaint.js", "https://github.com/tobyzerner/json-api-models", "https://github.com/caiotarifa/fetchja", "https://github.com/reyesoft/ts-angular-jsonapi", "https://github.com/abdulhaq-e/ngrx-json-api", "https://github.com/mohuk/ts-jsonapi", "https://github.com/reyesoft/ngx-jsonapi", "https://www.npmjs.com/package/@crnk/angular-ngrx", "https://github.com/muellerbbm-vas/grivet", "https://github.com/infinum/datx", "https://github.com/infinum/datx/tree/master/packages/datx-jsonapi", "https://github.com/d34dman/drupal-jsonapi-params", "https://github.com/dipscope/EntityStore.TS", "https://github.com/dipscope/JsonApiEntityProvider.TS", "https://github.com/joshdholtz/jsonapi-ios", "https://github.com/wvteijlingen/spine", "https://github.com/aronbalog/Vox", "https://github.com/infinum/Japx", "https://github.com/mattpolzin/JSONAPI", "https://github.com/undabot/izzyparser-ios", "https://github.com/Datadog/swift-jsonapi", "https://github.com/jsmestad/jsonapi-consumer", "https://github.com/chingor13/json_api_client", "https://github.com/coryodaniel/munson", "https://github.com/trainline/json-api-vanilla", "https://github.com/amcaplan/simple_jsonapi_client", "https://github.com/Sonberg/jsonapi-unwrapper", "https://github.com/Art4/json-api-client", "https://github.com/woohoolabs/yang", "https://eosnewmedia.github.io/JSON-API-Client/", "https://eosnewmedia.github.io/JSON-API-Common/", "https://github.com/floor9design-ltd/json-api-formatter", "https://github.com/swisnl/json-api-client", "https://pub.dev/packages/json_api", "https://pub.dev/packages/rest_data", "https://pub.dev/packages/jsonapi_client", "https://pub.dev/packages/japx", "https://metacpan.org/pod/PONAPI::Client", "https://github.com/jasminb/jsonapi-converter", "http://www.crnk.io/", "https://github.com/MarkoMilos/jsonapi", "https://github.com/faogustavo/JSONApi", "https://github.com/kamikat/moshi-jsonapi", "https://github.com/xamoom/Morpheus", "https://github.com/undabot/izzy-json-api-android", "https://github.com/infinum/kotlin-jsonapix", "https://github.com/sckott/rjsonapi", "https://github.com/noahzgordon/elm-jsonapi", "https://github.com/noahzgordon/elm-jsonapi-http", "https://github.com/cosullivan/Hypermedia/", "https://github.com/codecutout/JsonApiSerializer", "https://github.com/scott-mcdonald/JsonApiFramework", "https://github.com/cmeeren/FSharp.JsonApi/", "https://github.com/OKTAYKIR/jsonapi-consumer/", "https://github.com/socialwifi/jsonapi-requests/", "https://github.com/qvantel/jsonapi-client", "https://github.com/noplay/json-api-doc", "https://github.com/NilssonPL/json-api-smart", "https://github.com/aonawale/JSONAPISerializer", "https://github.com/tobyzerner/json-api-server", "https://github.com/neomerx/json-api", "https://github.com/limoncello-php/app"]} {"url": "https://jsonapi.org/profiles/ethanresnick/cursor-pagination", "titulek": "JSON API — “Cursor Pagination” Profile", "h1": "Cursor Pagination", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "“Cursor Pagination” Profile"}, {"uroven": 2, "text": "Introduction"}, {"uroven": 2, "text": "Specification"}, {"uroven": 3, "text": "Concepts"}, {"uroven": 4, "text": "Sorting Requirement"}, {"uroven": 4, "text": "Cursors"}, {"uroven": 3, "text": "Query Parameters"}, {"uroven": 4, "text": "page[size]"}, {"uroven": 4, "text": "page[after] and page[before]"}, {"uroven": 5, "text": "Omitting Both page[after] and page[before]"}, {"uroven": 5, "text": "Combining page[after] and page[before]"}, {"uroven": 3, "text": "Document Structure"}, {"uroven": 4, "text": "Terms"}, {"uroven": 4, "text": "page Meta Object Members"}, {"uroven": 4, "text": "Item Cursors"}, {"uroven": 4, "text": "Links"}, {"uroven": 4, "text": "Collection Sizes"}, {"uroven": 3, "text": "Error Cases"}, {"uroven": 4, "text": "Unsupported Sort Error"}, {"uroven": 4, "text": "Max Page Size Exceeded Error"}, {"uroven": 4, "text": "Invalid Parameter Value Error"}, {"uroven": 3, "text": "Notes"}, {"uroven": 2, "text": "Version History"}, {"uroven": 2, "text": "Contact the Editor"}], "markdown": "# “Cursor Pagination” Profile\n\n## Introduction\n\nThis is the specification of [a profile](http://jsonapi.org/format/1.1/#profiles) for the JSON:API specification.\n\nThe url for this profile is `http://jsonapi.org/profiles/ethanresnick/cursor-pagination/`.\n\nCursor-based pagination (aka keyset pagination) is a [common](https://slack.engineering/evolving-api-pagination-at-slack-1c1f644f8e12) [pagination strategy](https://www.citusdata.com/blog/2016/03/30/five-ways-to-paginate/)\nthat avoids many of the pitfalls of “offset–limit” pagination.\n\nFor example, with offset–limit pagination, if an item from a prior page is\ndeleted while the client is paginating, all subsequent results will be shifted\nforward by one. Therefore, when the client requests the next page, there’s one\nresult that it will skip over and never see. Conversely, if a result is added\nto the list of results as the client is paginating, the client may see the\nsame result multiple times, on different pages. Cursor-based pagination\ncan prevent both of these possibilities.\n\nCursor-based pagination also performs better for large data sets under most\nimplementations.\n\nTo support cursor-based pagination, this specification defines three query\nparameters — `page[size]`, `page[before]`, and `page[after]` — \nand a method for providing clients with pagination links and cursors in response\nbodies.\n\nFor example, this request would get the next 100 people after the cursor `abcde`:\n\n```\nGET /people?page[size]=100&page[after]=abcde\n```\n\nReplacing `page[after]` with `page[before]` would allow the client to paginate\nbackwards.\n\nAlternatively, to find all people between cursors `abcde` and `fghij`\n(exclusive), the client could request:\n\n```\nGET /people?page[after]=abcde&page[before]=fghij\n```\n\nOther combinations are possible, and these parameters are described more below.\n\n## Specification\n\n### Concepts\n\n#### Sorting Requirement\n\n**Pagination only applies to an ordered list of results.** This order must not\nchange between requests unless the underlying data changes, to ensure that\nresults don’t arbitrarily move between pages.\n\nIf the client’s paginated request includes a `?sort` query parameter that\nonly partially orders the results, the server **MUST** apply additional\nsorting constraints — consistent with the client-requested ones — to produce\na unique ordering, if it wishes to support pagination of that data.\n\nFor example, suppose a client requests `GET /people?sort=age&page[size]=10`.\nIf multiple people have the same age, their relative ordering is not defined\n(and could vary between requests), making pagination impossible. Therefore,\nto fulfill the request, the server must treat all paginated requests with\n`?sort=age` as though the client had instead asked to sort by age followed\nby some unique field or combination of fields (e.g., `?sort=age,id`).\n\nSimilarly, when the collection being paginated has no natural or\nclient-requested order (like the set of resource identifier objects in\na relationship), the server **MUST** assign an order if it wishes to support\npagination.\n\nThe server **MAY** reject pagination requests if the client has requested that\nthe results be sorted in a way that server cannot efficiently paginate. In that\ncase, the server **MUST** reject the request according to the rules for the\nunsupported sort error.\n\n#### Cursors\n\nA “cursor” is a string, created by the server using whatever method it likes,\nthat divides the list of results into those that fall before the cursor, those\nthat fall after the cursor, and, optionally, one result that falls “on” the\ncursor.\n\nFor example, imagine that the list of results being paginated is as follows:\n\n```\n[\n { \"type\": \"examples\", \"id\": \"1\" },\n { \"type\": \"examples\", \"id\": \"5\" },\n { \"type\": \"examples\", \"id\": \"7\" },\n { \"type\": \"examples\", \"id\": \"8\" },\n { \"type\": \"examples\", \"id\": \"9\" }\n]\n```\n\nFor this list, the server might produce the cursor string `abcde` as its way of\nencoding “id = 5”. With that cursor, then, the first result would fall before\nthe cursor, the second result would fall on the cursor, and the other results\nwould fall after it.\n\nThe list of results **MAY** change between the client’s pagination requests.\nFor example, the result with `\"id\": \"5\"` might be removed from the result set if\nthe resource it refers to is deleted. In that case, the cursor `abcde` would no\nlonger fall on any one result, but the same results would still come before it\nand after it.\n\nIn rare cases, a server may find it unacceptable for the results list to change\nbetween a client’s pagination requests. In those cases, the server **MAY**\nencode into the cursor information uniquely identifying the client or its session,\nand use that identifier to return consistent results from a single “snapshot” in\ntime.\n\n### Query Parameters\n\n#### `page[size]`\n\nThe `page[size]` parameter indicates the number of results that the client\nwould like to see in the response.\n\nIf `page[size]` is provided, it **MUST** be a positive integer.1\nIf this requirement isn’t met — e.g. if `page[size]` is negative — the server\n**MUST** respond according to the rules for the invalid query parameter error.\n\nFor each endpoint on which it supports pagination, a server **MAY** define a\nmaximum number of results that it will send in response to a paginated request\nto that endpoint. This is called the “max page size”. If the server does not\nchoose a max page size for a given endpoint, it is implicitly infinity.\n\nIf `page[size]` exceeds the server-defined max page size, the server **MUST**\nrespond according to the rules for the max page size exceeded error.\n\nIf `page[size]` is omitted, the server **MUST** choose a “default page size”.\nThis default size **MUST** be an integer between 1 and the max page size,\ninclusive.\n\nThe `page[size]` value, or the default page\nsize if `page[size]` is omitted, is called the “used page size”.\n\nOn any valid paginated request, the number of pagination items\nreturned **MUST** equal the used page size — provided there are at\nleast that many items in the results list, and which satisfy the constraints of\nthe `page[after]` and/or `page[before]` parameters (if any).\n\n#### `page[after]` and `page[before]`\n\nThe `page[after]` and `page[before]` parameters are both optional and both, if\nprovided, take a cursor as their value. If their value is not a valid cursor,\nthe server **MUST** respond according to the rules for the\ninvalid query parameter error.\n\nThe `page[after]` parameter is typically sent by the client to get the next page,\nwhile `page[before]` is used to get the prior page.\n\nMore formally, when `page[after]` is provided, the returned paginated data **MUST** have as its first item the item that is *immediately after* the cursor\nin the results list. (An exception is that, if there are no items in the results\nlist that fall after the cursor, the returned paginated data **MUST** be an\nempty array.)\n\nWhen `page[before]` is provided, the *last* item returned in the paginated data **MUST** be the item that is closest to, but still before, the cursor in the\nunpaginated results list. (Analogous to the above, if there are no items in the\nresults list that fall before the cursor, the returned paginated data **MUST**\nbe an empty array.)\n\nFor example, imagine that the list of results being paginated is again:\n\n```\n[\n { \"type\": \"examples\", \"id\": \"1\" },\n { \"type\": \"examples\", \"id\": \"5\" },\n { \"type\": \"examples\", \"id\": \"7\" },\n { \"type\": \"examples\", \"id\": \"8\" },\n { \"type\": \"examples\", \"id\": \"9\" }\n]\n```\n\nFurther, imagine that the cursor `xxx` falls on the entry with `\"id\": \"9\"`,\nwhile the cursor `abcde` still falls on the entry with `\"id\": \"5\"`.\n\nThen, for example, if the request was:\n\n```\nGET /example-data?page[after]=abcde&page[size]=2\n```\n\nThe response would contain:\n\n```\n{\n \"links\": {\n \"prev\": \"/example-data?page[before]=yyy&page[size]=2\",\n \"next\": \"/example-data?page[after]=zzz&page[size]=2\"\n },\n \"data\": [\n // the pagination item metadata is optional below.\n { \"type\": \"examples\", \"id\": \"7\", \"meta\": { \"page\": { \"cursor\": \"yyy\" } } },\n { \"type\": \"examples\", \"id\": \"8\", \"meta\": { \"page\": { \"cursor\": \"zzz\" } } }\n ]\n}\n```\n\nAlternatively, if the request was:\n\n```\nGET /example-data?page[before]=xxx&page[size]=3\n```\n\nThe response would contain:\n\n```\n{\n \"links\": {\n \"prev\": \"/example-data?page[before]=abcde&page[size]=3\",\n \"next\": \"/example-data?page[after]=zzz&page[size]=3\"\n },\n \"data\": [\n // again, optional pagination item metadata is allowed for each item here.\n { \"type\": \"examples\", \"id\": \"5\" },\n { \"type\": \"examples\", \"id\": \"7\" },\n { \"type\": \"examples\", \"id\": \"8\" }\n ]\n}\n```\n\nNotice that the `page[before]=xxx` is causing the last item in the response’s\npaginated data to be the entry with `\"id\": \"8\"`, while the number of items in\nthe paginated data above that item is controlled by the used page size.\n\n##### Omitting Both `page[after]` and `page[before]`\n\nIf the client’s paginated request includes neither the `page[after]` nor the\n`page[before]` parameters, the returned paginated data **MUST** start with\nthe first item from the results list. (If the results list is empty, the\npaginated data **MUST** be an empty array.)\n\n##### Combining `page[after]` and `page[before]`\n\nClients **MAY** use the `page[after]` and `page[before]` parameters together on\nthe same request. These are called “range pagination requests”, as the client is\nasking for all the results starting from immediately after the `page[after]`\ncursor and continuing up until the `page[before]` cursor.\n\nServers are not required to support such requests. If the server chooses not to\nsupport these requests, it **MUST** respond according to the rules for the\nrange pagination not supported error.\n\nOn range pagination requests, the server **MUST** use its max page size for that\nendpoint as the default page size. In other words, the used page size will\neither by the value of the `page[size]` parameter or the max page size.\n\nIf the number of results that satisfy both the `page[after]` and `page[before]`\nconstraints exceeds the used page size, the server **MUST** respond with the\nsame paginated data that it would have if the `page[before]` parameter had not\nbeen provided. However, in this case the server **MUST** also add\n`\"rangeTruncated\": true` to the pagination metadata to indicate to the client\nthat the paginated data does not contain all the results it requested.\n\nFor example, given our example data and cursors above, imagine the client\nrequests:\n\n```\nGET /example-data?page[after]=abcde&page[before]=xxx\n```\n\nThen, assuming our server’s max page size was greater than 1, the response\nwould contain:\n\n```\n{\n \"links\": {\n \"prev\": \"/example-data?page[before]=yyy\",\n \"next\": \"/example-data?page[after]=zzz\"\n },\n \"data\": [\n { \"type\": \"examples\", \"id\": \"7\" },\n { \"type\": \"examples\", \"id\": \"8\" }\n ]\n}\n```\n\nHowever, if our server’s max page size was 1, or the client included\n`page[size]=1` in its request, the response would contain:\n\n```\n{\n \"meta\": {\n \"page\": { \"rangeTruncated\": true }\n },\n \"links\": {\n \"prev\": \"/example-data?page[before]=yyy&page[size]=1\",\n \"next\": \"/example-data?page[after]=yyy&page[size]=1\"\n },\n \"data\": [\n { \"type\": \"examples\", \"id\": \"7\" }\n ]\n}\n```\n\n### Document Structure\n\n#### Terms\n\nThis profile uses the following terms to refer to different document elements:\n\n1. paginated data: an array in a JSON:API\n response document that holds the results that were extracted from a full list\n of results being paginated. It is always the value of a `data` key. When the\n [primary data](https://jsonapi.org/format/#document-top-level) is being\n paginated, the value of the document’s top-level `data` key is paginated data.\n When the resource identifier objects in a relationship are being paginated,\n the value of the `data` key in the relationship object is paginated data.\n2. pagination links: the `links` object\n that’s a sibling of the paginated data.\n3. pagination metadata: the `page`\n member of the `meta` object that’s a sibling of the paginated data (and\n pagination links).\n4. pagination item: an entry in the\n paginated data array.\n5. pagination item metadata: the\n `page` member of the `meta` object that’s at the top-level of a\n paginated data item.\n\nTo demonstrate these terms, various elements are labeled in the following\nexample:\n\n```\nGET /people?page[size]=1\n```\n\n```\n{\n // \"pagination links\" (for the top-level `data`)\n \"links\": { },\n \"meta\": {\n // \"pagination metadata\"\n \"page\": {}\n },\n // \"paginated data\"\n \"data\": [\n // a \"pagination item\"\n {\n \"type\": \"people\",\n \"id\": \"1\",\n // \"pagination item metadata\" in `page`.\n \"meta\": { \"page\": {} },\n \"attributes\": {},\n \"relationships\": {\n \"friends\": {\n // \"pagination links\".\n // would be non-empty in practice to indicate that the server\n // has chosen to paginate this relationship, even though the\n // client hasn't explicitly asked, which is allowed.\n \"links\": {},\n // another instance of \"paginated data\"\n \"data\": [\n // a \"pagination item\", with (empty) \"pagination item metadata\".\n { \"type\": \"people\", \"id\": \"3\", \"meta\": { \"page\": { } } }\n ]\n }\n }\n }\n ]\n}\n```\n\n#### `page` Meta Object Members\n\nThis profile reserves a `page` member in every JSON:API-defined `meta` object.\n(Each of these `page` members constitutes an element defined by this profile,\nso they can be [aliased](https://jsonapi.org/format/1.1/#profile-keywords-and-aliases).)\n\nThe `page` member, when present, **MUST** hold an object as its value; any other\nvalues are [unrecognized](https://jsonapi.org/format/1.1/#profiles-processing).\nThe recognized keys/values in these various `page` objects are defined throughout\nthis specification.\n\n#### Item Cursors\n\nThe server **MAY** choose to send some or all pagination items back to the client\nwith a `cursor` member in the pagination item’s metadata.\nIf present, this member **MUST** hold a cursor that (at the time of the response)\n“falls on” the item it is returned with. Clients can use this cursor\nto paginate from this item.\n\nFor example, a response might contain:\n\n```\n{\n // top-level links, meta, etc. omitted.\n // more people would likely be in the response as well.\n \"data\": [{\n \"type\": \"people\",\n \"id\": \"3\",\n \"meta\": {\n \"page\": { \"cursor\": \"someOpaqueString\" }\n }\n //...\n }]\n}\n```\n\nWith this response, clients could use `page[before]=someOpaqueString` or\n`page[after]=someOpaqueString` to paginate from person 3 in either direction.\n\n#### Links\n\nJSON:API allows four types of pagination links: [`prev`, `next`, `first`, and\n`last`](https://jsonapi.org/format/#fetching-pagination).\n\nIt is **RECOMMENDED** that servers include `first` and `last` links when these\nare inexpensive to compute.\n\nHowever, servers **MUST** include a `prev` and a `next` link for each instance\nof paginated data in a response.\n\nIf a request does not contain the `page[before]` parameter, the server **MUST**\ndetermine whether a next page exists, and return `null` as the `next` link if not.\n\nIf a request does not contain the `page[after]` parameter, the server **MUST**\ndetermine whether a previous page exists, and return `null` as the `prev` link\nif not.\n\nIn all other cases, a server **SHOULD** set these links to `null` when it can\ninexpensively determine that the current response is for the first or last page\nrespectively.\n\nHowever, if the server can’t easily determine whether there are prior results\n(when computing the `prev` link) or subsequent results (when computing the\n`next` link), it **MAY** use a URI in these links that returns an empty array\nas its paginated data.\n\nFor example, imagine a request for:\n\n```\nGET /example-data?page[before]=xyz\n```\n\nTo fulfill this request, the server will likely issue a query that filters the\nfull `example-data` results list to find only records that are before the cursor.\nFrom those query results, the server would not know whether there are additional\nresults that come *after* the cursor, and it may not have a cheap way to find out.\n\nSo, in this case, the server can simply return a `next` URI where the `page[after]`\nparameter is set to the item cursor for the last item in the\nresponse’s paginated data.\n\nIf the client goes to fetch this link, it will either receive an empty array\nas the paginated data, in which case it knows it’s reached the end, or it will\nget the subsequent results.\n\n> Note: in general, servers are likely to find it more expensive to determine\n> whether a previous page exists when `page[after]` is in use, and whether a\n> subsequent page exists when `page[before]` is in use. Luckily, when `page[after]`\n> is in use, clients usually don’t care about the previous page (only the next\n> one), and vice-versa when `page[before]` is in use. So, by allowing the server\n> to return a link that might end up corresponding to an empty page, the server\n> can often skip a query that will never be needed.\n\n#### Collection Sizes\n\nThe pagination metadata **MAY** contain a `total` member containing an integer\nindicating the total number of items in the list of results that’s being\npaginated.\n\nFor example, a response to `GET /people?page[size]=2` might include:\n\n```\n{\n \"meta\": {\n \"page\": { \"total\": 200 }\n },\n // links omitted\n \"data\": [\n {\n \"type\": \"people\",\n // ...\n },\n {\n \"type\": \"people\",\n // ...\n }\n ]\n}\n```\n\nThe pagination metadata **MAY** also contain an `estimatedTotal` member.\nIf present, the value of this member **MUST** be an object. That object\n**MAY** have one key, `bestGuess`. If present, `bestGuess` **MUST** contain\nan integer indicating the server’s best estimate of the size of the full results\nlist.\n\nServer’s might choose to use `estimatedTotal` instead of `total` when computing\nthe exact total is costly.\n\n### Error Cases\n\n#### Unsupported Sort Error\n\nThe server **MUST** respond to this error by sending a `400 Bad Request`. The\nresponse document **MUST** contain an error object that identifies the `sort`\nparameter as the [error’s `source`](https://jsonapi.org/format/#error-objects),\nand has a `type` link of:\n\n```\nhttps://jsonapi.org/profiles/ethanresnick/cursor-pagination/unsupported-sort\n```\n\n#### Max Page Size Exceeded Error\n\nThe server **MUST** respond to this error by sending a `400 Bad Request`. The\nresponse document **MUST** contain an error object that:\n\n- identifies `page[size]` as the error’s `source` ;\n- provides the maximum page size as an integer in `maxSize` member of the `page` element in the error object’s `meta` object; and\n- includes a `type` link of: `https://jsonapi.org/profiles/ethanresnick/cursor-pagination/max-size-exceeded`\n\nIf this profile’s `page` element has not been [aliased](https://jsonapi.org/format/1.1/#profile-keywords-and-aliases),\nthe error object might look like:\n\n```\n{\n \"status\": \"400\",\n \"meta\": {\n \"page\": { \"maxSize\": 100 }\n },\n \"title\": \"Page size requested is too large.\",\n \"detail\": \"You requested a size of 200, but 100 is the maximum.\",\n \"source\": {\n \"parameter\": \"page[size]\"\n },\n \"links\": {\n \"type\": [\"https://jsonapi.org/profiles/ethanresnick/cursor-pagination/max-size-exceeded\"]\n }\n}\n```\n\n#### Invalid Parameter Value Error\n\nThe server **MUST** respond to this error by sending a `400 Bad Request` with an\nerror object in the response document that identifies the problematic parameter\nin the error object’s `source` member.\n\nFor example, the server might send:\n\n```\n{\n \"errors\": [{\n \"title\": \"Invalid Parameter.\",\n \"detail\": \"page[size] must be a positive integer; got 0\",\n \"source\": { \"parameter\": \"page[size]\" },\n \"status\": \"400\"\n }]\n}\n```\n\nThe server **MUST** respond to this error by sending a `400 Bad Request`. The\nresponse document **MUST** contain an error object that has a `type` link of:\n\n```\nhttps://jsonapi.org/profiles/ethanresnick/cursor-pagination/range-pagination-not-supported\n```\n\n### Notes\n\n1. Technically, a URI is a series of characters, so the value\nof a query parameter – including `page[size]` – is always a string. When\nthe text says the value “MUST be a positive integer”, it means more precisely\nthat the value **MUST** be a sequence of characters matching the regular\nexpression `^[0-9]+$` , which **MUST** then be interpreted as a base-10 integer.\n\n## Version History\n\n[View changes to this profile over time](https://github.com/json-api/json-api/commits/gh-pages/_profiles/ethanresnick/cursor-pagination/index.md)\n\n## Contact the Editor\n\nEthan Resnick\n [ethan.resnick@gmail.com](mailto:ethan.resnick@gmail.com)\n [https://ethanresnick.com/](https://ethanresnick.com/)\n [13104398032](tel:13104398032)", "znaku_textu": 19810, "slov": 3062, "odkazu": 44, "kodovani": "windows-1250", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/profiles/ethanresnick/cursor-pagination", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:48", "sha256": "8a2a1444c7a9ef1c9eb78239a963781f131bc61a00cfe477860b6553692c47d9", "hloubka": 2, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["https://slack.engineering/evolving-api-pagination-at-slack-1c1f644f8e12", "https://www.citusdata.com/blog/2016/03/30/five-ways-to-paginate/", "https://github.com/json-api/json-api/commits/gh-pages/_profiles/ethanresnick/cursor-pagination/index.md", "https://ethanresnick.com/", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]} {"url": "https://jsonapi.org/recommendations/", "titulek": "JSON:API — Recommendations", "h1": "Recommendations", "popis": "", "klicova_slova": "", "kanonicka": "", "jazyk": "", "robots_meta": "", "og": {}, "jsonld": [], "drobecky": [], "osnova": [{"uroven": 1, "text": "Recommendations"}, {"uroven": 2, "text": "Naming"}, {"uroven": 2, "text": "URL Design"}, {"uroven": 3, "text": "Reference Document"}, {"uroven": 3, "text": "URLs for Resource Collections"}, {"uroven": 3, "text": "URLs for Individual Resources"}, {"uroven": 2, "text": "Filtering"}, {"uroven": 2, "text": "Including Top-level, Resource-level and Relationship Links"}, {"uroven": 2, "text": "Supporting Clients Lacking PATCH"}, {"uroven": 2, "text": "Formatting Date and Time Fields"}, {"uroven": 2, "text": "Asynchronous Processing"}, {"uroven": 2, "text": "Authoring Profiles"}], "markdown": "# Recommendations\n\nThis section contains recommendations for JSON:API implementations. These\nrecommendations are intended to establish a level of consistency in areas that\nare beyond the scope of the base JSON:API specification.\n\n## Naming\n\nThe specification places certain [hard restrictions](http://jsonapi.org/format/#document-member-names) \non how members (i.e., keys) in a JSON:API document may be named. To further \nstandardize member names, which is especially important when mixing profiles\nauthored by different parties, the following rules are also recommended:\n\n- Member names **SHOULD** be camel-cased (i.e., `wordWordWord` )\n- Member names **SHOULD** start and end with a character “a-z” (U+0061 to U+007A)\n- Member names **SHOULD** contain only ASCII alphanumeric characters (i.e., “a-z”, “A-Z”, and “0-9”)\n\n## URL Design\n\n### Reference Document\n\nWhen determining an API’s URL structure, it is helpful to consider that all of\nits resources exist in a single “reference document” in which each resource is\naddressable at a unique path. Resources are grouped by type at the top level of\nthis document. Individual resources are keyed by ID within these typed\ncollections. Attributes and links within individual resources are uniquely\naddressable according to the resource object structure described above.\n\nThis concept of a reference document is used to determine appropriate URLs for\nresources as well as their relationships. It is important to understand that\nthis reference document differs slightly in structure from documents used to\ntransport resources due to different goals and constraints. For instance,\ncollections in the reference document are represented as sets because members\nmust be addressable by ID, while collections are represented as arrays in\ntransport documents because order is significant.\n\n### URLs for Resource Collections\n\nIt is recommended that the URL for a collection of resources be formed from\nthe resource type.\n\nFor example, a collection of resources of type `photos` will have the URL:\n\n```\n/photos\n```\n\n### URLs for Individual Resources\n\nTreat collections of resources as sets keyed by resource ID. The URL for an\nindividual resource can be formed by appending the resource’s ID to the\ncollection URL.\n\nFor example, a photo with an ID of `\"1\"` will have the URL:\n\n```\n/photos/1\n```\n\nAs described in the base specification, there are two URLs that can be exposed\nfor each relationship:\n\n- the “relationship URL” - a URL for the relationship itself, which is\nidentified with the `self` key in a relationship’s `links` object. This URL\nallows the client to directly manipulate the relationship. For example, it would\nallow a client to remove an `author` from a `post` without deleting the `people`\nresource itself.\n- the “related resource URL” - a URL for the related resource(s), which is\nidentified with the `related` key within a relationship’s `links` object. When\nfetched, it returns the related resource object(s) as the response’s primary data.\n\nIt is recommended that a relationship URL be formed by appending `/relationships/`\nand the name of the relationship to the resource’s URL.\n\nFor example, a photo’s `comments` relationship will have the URL:\n\n```\n/photos/1/relationships/comments\n```\n\nAnd a photo’s `photographer` relationship will have the URL:\n\n```\n/photos/1/relationships/photographer\n```\n\nIt is recommended that a related resource URL be formed by appending the name\nof the relationship to the resource’s URL.\n\nFor example, the URL for a photo’s `comments` will be:\n\n```\n/photos/1/comments\n```\n\nAnd the URL for a photo’s `photographer` will be:\n\n```\n/photos/1/photographer\n```\n\nBecause these URLs represent resources in relationships, they should not be\nused as `self` links for the resources themselves. Instead the recommendations\nfor individual resource URLs should still apply when forming `self` links.\n\n## Filtering\n\nThe base specification is agnostic about filtering strategies supported by a\nserver. The `filter` query parameter family is reserved to be used as the basis \nfor any filtering strategy.\n\nIt’s recommended that servers that wish to support filtering of a resource\ncollection based upon associations do so by allowing query parameters that\ncombine `filter` with the association name.\n\nFor example, the following is a request for all comments associated with a\nparticular post:\n\n```\nGET /comments?filter[post]=1 HTTP/1.1 \n```\n\nMultiple filter values can be combined in a comma-separated list. For example:\n\n```\nGET /comments?filter[post]=1,2 HTTP/1.1 \n```\n\nFurthermore, multiple filters can be applied to a single request:\n\n```\nGET /comments?filter[post]=1,2&filter[author]=12 HTTP/1.1 \n```\n\n## Including Top-level, Resource-level and Relationship Links\n\nThe base specification is agnostic about including links with a resource response. However, it is recommended that the following links be included within response documents:\n\n- **Top-level links** like a self-link (for the whole response) as well as relative pagination links (if appropriate).\n- **Resource-level links** like a self-link for each resource (which differs from the top-level, if the resource is part of a collection).\n- **Relationship links** for all available relationships of a resource.\n\nFor example, a request for a collection of comments could prompt the following response:\n\n```\nGET /comments HTTP/1.1\n\n{\n \"data\": [{\n \"type\": \"comments\",\n \"id\": \"1\",\n \"attributes\": {\n \"text\": \"HATEOS are the thing!\"\n },\n \"links\": {\n \"self\": \"/comments/1\"\n },\n \"relationships\": {\n \"author\": {\n \"links\": {\n \"self\": \"/comments/1/relationships/author\",\n \"related\": \"/comments/1/author\"\n }\n },\n \"articles\": {\n \"links\": {\n \"self\": \"/comments/1/relationships/articles\",\n \"related\": \"/comments/1/articles\"\n }\n }\n }\n }],\n \"links\": {\n \"self\": \"/comments\"\n }\n}\n```\n\n## Supporting Clients Lacking `PATCH`\n\nSome clients, like IE8, lack support for HTTP’s `PATCH` method. API servers\nthat wish to support these clients are recommended to treat `POST` requests as\n`PATCH` requests if the client includes the `X-HTTP-Method-Override: PATCH`\nheader. This allows clients that lack `PATCH` support to have their update\nrequests honored, simply by adding the header.\n\n## Formatting Date and Time Fields\n\nAlthough JSON:API does not specify the format of date and time fields, it is\nrecommended that servers align with ISO 8601. [This W3C\nNOTE](http://www.w3.org/TR/NOTE-datetime) provides an overview of the\nrecommended formats.\n\n## Asynchronous Processing\n\nConsider a situation when you need to create a resource and the operation takes a long time to complete.\n\n```\nPOST /photos HTTP/1.1 \n```\n\nThe request **SHOULD** return a status `202 Accepted` with a link in the `Content-Location` header.\n\n```\nHTTP/1.1 202 Accepted Content-Type: application/vnd.api+json Content-Location: https://example.com/photos/jobs/5234 { \"data\": { \"type\": \"jobs\", \"id\": \"5234\", \"attributes\": { \"status\": \"Pending request, waiting other process\" }, \"links\": { \"self\": \"/photos/jobs/5234\" } } } \n```\n\nTo check the status of the job process, a client can send a request to the location given earlier.\n\n```\nGET /photos/jobs/5234 HTTP/1.1 Accept: application/vnd.api+json \n```\n\nRequests for still-pending jobs **SHOULD** return a status `200 OK`, as the server is reporting the status successfully. Optionally, the server can return a `Retry-After` header to provide guidance to the client as to how long it should wait before checking again. Recommendations to retry sooner than 1 second can be accomplished with `Retry-After: 0`.\n\n```\nHTTP/1.1 200 OK Content-Type: application/vnd.api+json Retry-After: 10 { \"data\": { \"type\": \"jobs\", \"id\": \"5234\", \"attributes\": { \"status\": \"Pending request, waiting other process\" }, \"links\": { \"self\": \"/photos/jobs/5234\" } } } \n```\n\nWhen job process is done, the request **SHOULD** return a status `303 See other` with a link in `Location` header.\n\n```\nHTTP/1.1 303 See other Content-Type: application/vnd.api+json Location: https://example.com/photos/4577 \n```\n\n## Authoring Profiles\n\nProfiles are a mechanism that can be used by the sender of a document to make promises about its content, without adding to or altering the basic semantics of the JSON:API specification. For example, a profile may indicate that all resource objects will have a `timestamps` attribute field and that the members of the `timestamps` object will be formatted using the ISO 8601 date time format.\n\nA profile is an independent specification of those promises. The following example illustrates how the aforementioned profile might be authored:\n\n```\n# Timestamps profile\n\n## Introduction\n\nThis page specifies a profile for the `application/vnd.api+json` media type,\nas described in the [JSON:API specification](http://jsonapi.org/format/).\n\nThis profile allows every resource in a JSON:API document to represent\nsignificant timestamps in a consistent way.\n\n## Document Structure\n\nEvery resource object **MUST** include a `timestamps` member in its associated\n`attributes` object. If this member is present, its value **MUST** be an object that\n**MAY** contain at least one of the following members:\n\n* `created`\n* `updated`\n\nThe value of each member **MUST** comply with the variant of ISO 8601 used by\nJavaScript's `JSON.stringify` method to format Javascript `Date` objects.\n```", "znaku_textu": 8994, "slov": 1322, "odkazu": 29, "kodovani": "utf-8", "kodovani_deklarovane": "utf-8", "format": "html", "duplikat_z": "http://jsonapi.org/recommendations/", "http": 200, "odkud": "live", "wb_ts": "", "stazeno": "2026-09-14 03:17:41", "sha256": "7ba118069fd9c850d4452f113d1a79ba5f6167443df1909d576805dc287f3dd2", "hloubka": 1, "zdroj_objevu": "odkaz", "ze_seznamu": false, "mime": "text/html", "odkazy_externi": ["http://www.w3.org/TR/NOTE-datetime", "https://jekyllrb.com/", "http://softwaremaniacs.org/soft/highlight/en/", "https://creativecommons.org/publicdomain/zero/1.0/", "https://twitter.com/jsonapi", "https://github.com/json-api", "https://discuss.jsonapi.org/"]}