# JSON:API JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. Clients must send all JSON:API data in request documents with the header `Content-Type: application/vnd.api+json`. Clients that include JSON:API media type in their `Accept` header must specify it. Servers must send `Content-Type: application/vnd.api+json` in the response headers. JSON object must be at the root of every JSON:API request and response. A document must contain at least one of the following: * `data`: The documents primary data. * `errors`: an array of error objects * `meta`: a meta object that contains non-standard meta-information. A document may contain any of: * `jsonapi`: an object describing the server's implementation * `links`: a links object related to the primary data. * `self`: the link that generated the current response document * `related`: A related resource link * `pagination` links for the primary data. * `included`: an array of resource objects that are related to the primary data. * if `data` is not included then `included` must not be presented. Resource objects must have: * `id`: not required when sent from client * `type`: Resource objects may have: * `attributes`: represents some of the resources data * `relationships`: describing relationships between the resource and other JSON:API resources. * `links`: containing links related to the resource. * `meta`: containing non-standard meta-information about a resource that cannot be represented as an attribute or relationship. ```json { "meta": { "authors": [ "x y" ] }, "data": { "type": "articles", "id": "1", "attributes": { "title": "How to make soap" }, "relationships": { "author": { "links": { "self": "/articles/1/relationships/author", "related": "/articles/1/author" }, "data": { "type": "people", "id": "9" } } }, "links": { "self": "https://example.com/articles/1" } } } ```