JSON:API
JSON:API is a specification, published at jsonapi.org by its editors, for how a client requests that resources be fetched or modified and how a server responds, using the application/vnd.api+json media type. With this skill the agent designs endpoints, produces and parses JSON:API documents, negotiates extensions and profiles, and implements the Atomic Operations extension.
Follow the workflow below step by step. Every rule here comes from a source in Sources, with the section it cites. When a rule and the pinned source disagree, the source wins; when the source has a newer revision than the pin, follow the refresh steps.
JSON:API sections have anchors but no numbers, so citations name the heading, for example (Compound Documents).
Inputs (fill in, or ask before starting)
- Role: server, client, or both.
- Target version: JSON:API 1.1 (default; finalized 2022-09-30). JSON:API 1.0 is supported: target it only for a named peer that rejects the
extandprofilemedia type parameters. The JSON:API 1.2 draft is a preview (posture: track): never claim it. Seereferences/versions.md. - Revision: the pinned revision in Sources, unless the user names another.
- Sources: when refreshing this skill or when a rule looks out of date, re-read every URL in Sources first, check the jsonapi.org milestones and the
_format/folder of the GitHub repository for a new version, and update the pins. - Features: which of
include, sparse fieldsets,sort, pagination,filter, client-generated IDs, relationship endpoints and writes the API supports. - Extensions and profiles: the URIs the API applies, for example
https://jsonapi.org/ext/atomic.
Invariants
- Media type and parameters. Every JSON:API payload is sent with
Content-Type: application/vnd.api+json; the only allowed parameters areextandprofile, each a quoted space-separated list of URIs (Universal Responsibilities; Rules for Media Type Parameters). - Server negotiation. A request
Content-Typewith any other parameter, or with an unsupportedextURI, gets415. AnAcceptwhose JSON:API instances all carry other parameters, or all carry an unsupportedext, gets406. Unknown profiles are ignored (Server Responsibilities). - Top level. A document has at least one of
data,errors,metaor an extension member;dataanderrorsnever coexist;includedneedsdata(Top Level). - Collections are arrays. Primary data for a collection is an array, even with one or zero items; a single resource is an object or
null(Top Level). - Identity. Every resource object has a string
typeandid; only a client-originated new resource may omitid, and may uselidinstead.typeplusididentifies exactly one resource in the API (Identification). - Shared field namespace. Attributes and relationships share one namespace with
typeandid: no field namedtypeorid, and no attribute and relationship with the same name. Foreign keys such asauthor_idshould be relationships, not attributes (Fields; Attributes). - Full linkage, no duplicates. Every included resource is reachable through a chain of relationships from the primary data, unless sparse fieldsets removed the linkage, and each
typeandidpair appears at most once (Compound Documents). - No extra members. Objects defined by the specification or an applied extension contain no other members, and implementations ignore non-compliant members (Document Structure).
- Member names. Implementation and profile member names are case sensitive, start and end with
a-z,A-Z,0-9or U+0080 and above, may contain-,_or space inside, and never contain the reserved characters such as+ , . [ ] : / @(Member Names). Extension members arenamespace:name(Extension Members). - Query parameter names. Implementation-specific parameters belong to a family whose base name is a legal member name with at least one character outside
a-z(camelCase recommended); an unknown or non-conforming parameter gets400(Implementation-Specific Query Parameters). - Unsupported features fail loudly.
includeon an endpoint that does not support it, an unknown relationship path, or an unsupportedsortgets400(Inclusion of Related Resources; Sorting). - Writes are all or nothing. A request completely succeeds or fails; no partial updates (Creating, Updating and Deleting Resources).
- PATCH is a merge. Missing attributes and relationships keep their current values and are never read as
null(Updating a Resource's Attributes; Updating a Resource's Relationships). - Errors. Error objects go in a top-level
errorsarray; each has at least one member, andstatus, when present, is a string (Error Objects).
Workflow
- Pick the version. Use JSON:API 1.1 unless a named peer only speaks 1.0.
->
references/versions.md✓ The target version is recorded, and it is not the 1.2 draft. - Model resources. Choose
typevalues, attributes and relationships; give every relationship aselfand/orrelatedlink or linkage. ->references/document-structure.md✓ No field is namedtypeorid, no foreign key is an attribute, and every member name passes the Member Names rules. - Implement content negotiation. Send the media type with
extandprofilewhen applied, answer415and406as the rules say, and sendVary: Acceptwhen the server supportsextorprofile. ->references/errors-and-extensions.md✓ A request withContent-Type: application/vnd.api+json; charset=utf-8gets415. - Implement fetching. Serve every
selfandrelatedURL you emit; addinclude,fields[TYPE],sort,page[...]andfilter[...]as chosen. ->references/fetching.md✓ A compound document has full linkage, unrequested resources are absent, and unsupported features return400. - Implement writes.
POSTto collections,PATCHandDELETEon resources, andPATCH,POSTandDELETEon relationship links, with the status codes each response section requires. ->references/writing.md✓ Each write returns the status the spec requires for its outcome, and aPATCHwithout an attribute leaves it unchanged. - Return errors. Build error objects with
status,title,detailandsource.pointer,source.parameterorsource.header; pick the most generally applicable status for several errors. ->references/errors-and-extensions.md✓ Everysource.pointerpoints at a value that exists in the request document. - Add extensions or profiles (only when needed). Implement Atomic Operations for ordered, atomic batches; define a profile for shared implementation semantics.
->
references/errors-and-extensions.md✓ Every extension member and query parameter is namespaced, andatomic:resultshas the same length asatomic:operations. - Upgrade (only when asked). Follow the 1.0 to 1.1 steps.
->
references/versions.md✓ 1.0 clients still work, and the 1.1 features you claim follow the 1.1 rules.
Verify before done
- Every response and request body carries
application/vnd.api+json, withextandprofilelisted when applied and no other parameter (Universal Responsibilities). -
415,406and400are returned in exactly the cases the spec names (Server Responsibilities; Query Parameters; Inclusion of Related Resources; Sorting). - No document has both
dataanderrors, orincludedwithoutdata(Top Level). - Every resource object has string
typeandid(orlidfor a new client resource), andtypeandidpairs are unique in compound documents (Identification; Compound Documents). - Sparse fieldsets never return a field the client did not ask for (Sparse Fieldsets).
- Pagination links use only
first,last,prevandnext, omitted ornullwhen unavailable (Pagination). -
201responses carry the created resource and aLocationthat matcheslinks.selfwhen both are present (201 Created). - Custom query parameters contain a non
a-zcharacter, and extension parameters arenamespace:name(Query Parameters). - Nothing claims JSON:API 1.2 in
jsonapi.version.
Reference index
references/versions.md: JSON:API 1.1, 1.0 and the 1.2 draft, which to use, what 1.1 added, the 1.0 to 1.1 upgrade, and the preview. Load for steps 1 and 8.references/document-structure.md: top level, resource objects,lid, relationships, linkage, compound documents, links and link objects, meta, thejsonapiobject, member names and @-Members. Load for step 2.references/fetching.md: fetching resources and relationships,include, sparse fieldsets, sorting, pagination, filtering, query parameter families and parsing. Load for step 4.references/writing.md: creating, updating and deleting resources and relationships, client-generated IDs, and every write status code. Load for step 5.references/errors-and-extensions.md: content negotiation, error objects, extensions and profiles, and the Atomic Operations extension. Load for steps 3, 6 and 7.
Related skills
http-semanticsfor methods, status codes,Location,Varyand content negotiation in general:npx skills add ScaleDockHQ/scaledock-skills --skill http-semantics.problem-detailsfor RFC 9457 errors on endpoints that are not JSON:API:npx skills add ScaleDockHQ/scaledock-skills --skill problem-details.openapifor describing a JSON:API in an OpenAPI document, for example as the target of adescribedbylink:npx skills add ScaleDockHQ/scaledock-skills --skill openapi.json-schemafor validating documents and attribute shapes:npx skills add ScaleDockHQ/scaledock-skills --skill json-schema.graphqlwhen comparing JSON:API with a GraphQL endpoint on the same service:npx skills add ScaleDockHQ/scaledock-skills --skill graphql.
Sources
Status uses the publishing body's own maturity term. Checked is the date the source was last read.
- JSON:API Latest Specification: latest specification page, serves v1.1, checked 2026-10-05.
- JSON:API v1.1: Stable (archived copy, normative text frozen), v1.1 finalized 2022-09-30, checked 2026-10-05.
- JSON:API v1.0: archived copy, normative text frozen, v1.0 final 2015-05-29, checked 2026-10-05.
- JSON:API v1.2: Still in Development (working draft), checked 2026-10-05.
- Atomic Operations extension: extension listed by the editors, unversioned, URI
https://jsonapi.org/ext/atomic, checked 2026-10-05. - Extensions and Profiles: registry page maintained by the editors, checked 2026-10-05.
- JSON:API home page: milestones list, checked 2026-10-05.
- json-api/json-api repository: source of jsonapi.org,
gh-pagesatbde79ce(2026-10-04), tagv1.1atdb7abaa(2022-09-30), checked 2026-10-05.