Skip to main content
The only requirement for a client sending JSON:API requests is that it must specify the application/vnd.api+json media type in Accept and/or Content-Type headers.

Header requirements by method

HTTP MethodAccept headerContent-Type header
GET, OPTIONS, HEADRequiredNot required
POST, PATCH, DELETERecommendedRequired

Media type constraints

  • The Content-Type header value application/vnd.api+json must not contain any media type parameters.
  • The Accept header value application/vnd.api+json must not contain media type parameters, except quality values.
  • The client must ignore any media type parameters received in the Content-Type header of the response.

Valid request examples

GET request
GET /api/users HTTP/1.1
Accept: application/vnd.api+json
POST request (with Accept)
POST /api/users HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
POST request (without Accept)
POST /api/users HTTP/1.1
Content-Type: application/vnd.api+json

JSON:API response format

When using the application/vnd.api+json media type, responses are in JSON:API format:
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{"data": [
  {
    "type": "accounts",
    "id": "1",
    "attributes": {
      "name": "Life Plan Counseling"
    },
    "relationships": {}
  }
]}

Plain API format

Requests with a non-JSON:API media type value (e.g., application/json) are treated as plain API requests. The response data will be in plain JSON format rather than JSON:API. Request
GET /api/users HTTP/1.1
Accept: application/json
Response
[
  {
    "id": 1,
    "name": "Life Plan Counseling",
    "contacts": [
      1
    ]
  }
]
For more information, see the JSON:API Client Responsibilities specification.

Build docs developers (and LLMs) love