Copyright © 2026 World Wide Web Consortium . W3C ® liability , trademark and permissive document license rules apply.
[@@ from charter ]
The Linked Web Storage Protocol specification aims to provide applications with secure and permissioned access to externally stored data in an interoperable way.
The Linked Web Storage Protocol does/does not include protocol details for integration with identity layers and mechanisms; access management and data integrity; notifications about resource changes; and authorization mechanisms.
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C standards and drafts index .
This is an unofficial proposal.
This document was published by the Linked Web Storage Working Group as an Editor's Draft.
Publication as an Editor's Draft does not imply endorsement by W3C and its Members.
This is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to cite this document as other than a work in progress.
This document was produced by a group operating under the W3C Patent Policy . W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent that the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy .
This document is governed by the 18 August 2025 W3C Process Document .
This section is non-normative.
List of TODO s and ideas in flux to enable editors to communicate asynchronously.
This section is non-normative.
The LWS Protocol defines standard interactions by which a some party can make some resources available to some agents.
A resource manager may keep a served resource private, may make it publicly available to anyone, or may limited its visibility to a constrained set of requesting agents .
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MAY , MUST , MUST NOT , OPTIONAL , RECOMMENDED , REQUIRED , SHOULD , and SHOULD NOT in this document are to be interpreted as described in BCP 14 [ RFC2119 ] [ RFC8174 ] when, and only when, they appear in all capitals, as shown here.
A LWS REST Server is an HTTP server [ rfc9112 ] that complies with all of the relevant " MUST " statements in this specification. Specifically, the relevant normative " MUST " statements in Sections 999 REST Binding of this document MUST be respected.
A LWS REST Client is an HTTP client [ rfc9112 ] that complies with all of the relevant " MUST " statements in this specification. Specifically, the relevant normative " MUST " statements in Sections 999 REST Binding of this document MUST be respected.
The terms "authorization server" and "client" are defined by the OAuth 2.0 Authorization Framework [ RFC6749 ].
The terms "end-user" and "issuer" are defined by OpenID Connect Core 1.0 [ OPENID-CONNECT-CORE ].
This specificaiton defines the following terms:
This specification defines operations on served resources , the resulting change of state, and a response indended to give the requesting agent requested infomation or inform them of the outcome of the operation . An operation is any of the following actions that can be performed on a served resource :
The folowing section will describe the semantics and responses of these operations but the following core responses apply to any operation:
This section defines a mechanism for identifying agents and end users that interact with a linked web storage server. This specification does not mandate a particular format for end-user credentials, though it does describe how existing identity systems can be used in conjunction with the linked web storage authorization framework.
The data model described in this section outlines the requirements for any concrete serialization of an end-user credential.
An end-user credential MUST include tamper evident claims about a subject, including:
Validation of an end-user credential requires a trust relationship between the verifier and issuer of the credential. This trust relationship MAY be established through an out-of-band mechanism. Any additional mechanisms for establishing trust between a verifier and an issuer are outlined in specific authentication suites.
An end-user credential MUST be signed. It is RECOMMENDED that the signature uses asymmetric cryptography.
Each authentication suite MUST be associated with a token type URI. An authentication suite SHOULD use a URI defined in the IANA "OAuth URI" registry.
Define how requesting agents discover served resources and their capabilities.
This section delineates the abstract data model governing the organization of resources within the Linked Web Storage (LWS) system. It encompasses the structuring of containers and resources, their hierarchical interrelations, the functional semantics of containers as organizational units, rules pertaining to containment, and mechanisms for clients to organize and navigate resource collections. This model establishes the logical namespace of the storage, delineating inter-resource relationships therein, without presupposing any specific identifier structure or semantic implications derived from identifier composition. Logical organization MUST prioritize discoverability and self-descriptive APIs, avoiding hardcoded locations. Containment is represented as metadata to enable multiple containers per resource without URL changes, supporting sharing use cases. All entities MUST have associated metadata resources using Link Sets (RFC 9264), distinguishing server-managed and user-managed data.
Create
In
LWS,
a
resource
constitutes
the
fundamental
unit
of
storage
and
access.
Each
resource
possesses
a
unique
identifier
within
the
system.
A
resource
may
encompass
data,
such
as
content
or
structured
information,
alongside
associated
metadata,
including
attributes
like
type
or
modification
timestamps.
Resources
MUST
be
classified
as
'DataResource',
'Container',
or
'MetadataResource'
via
metadata
types.
DataResources
MAY
have
multiple
representations;
servers
MUST
track
original
media
types
and
support
reification
in
metadata
using
the
'representation'
property,
which
includes
'mediaType'
and
optional
'sizeInBytes'.
A container represents a specialized resource type capable of encompassing other resources as members. Containers function as organizational constructs, facilitating the grouping of resources in a manner akin to collections or directories. A container maintains references to its member resources, which may comprise both non-container resources and additional container resources, thereby enabling hierarchical formations. Typically, a container holds minimal intrinsic content beyond metadata or enumerations of its members; its principal role is to aggregate and structure subordinate resources. The storage system's root is designated as a container, serving as the apex organizational unit devoid of a superior parent. Containers MUST support pagination for membership listings using 'ContainerPage' types, with properties such as 'first', 'next', 'prev', and 'last'. Representations MUST use JSON-LD with a specific frame and normative context, optionally advertising content negotiation via 'Vary: Accept' headers. Storage MAY function as a root container, enabling direct writes.
In
addition
With
the
exception
of
the
root
container,
every
resource
is
affiliated
with
precisely
one
parent
container.
This
affiliation
engenders
a
strict
hierarchical
structure,
manifesting
as
a
tree
with
a
singular
root
container
at
its
pinnacle.
Upon
creation
within
a
designated
container,
a
new
resource
becomes
a
member
of
that
container,
appearing
within
its
membership
enumeration.
Cycles
or
multiple
parent
affiliations
are
prohibited
within
this
model;
a
resource
cannot
concurrently
belong
to
multiple
containers
without
duplication
or
alternative
referencing
mechanisms
external
to
the
core
responses
,
a
create
operation
may
produce
any
of:
containment
framework.
This
constraint
enhances
model
simplicity
and
aligns
with
conventional
organizational
paradigms.
Containment
MUST
be
modeled
as
metadata
links
using
'contains'
(from
container
to
member)
and
'partOf'
(from
member
to
container),
allowing
transitive
queries
and
multiple
hierarchies
without
slash
semantics.
Servers
MAY
support
hierarchy
arrays
for
ancestors.
Operations involving the creation, deletion, or relocation of resources influence container memberships as follows:
Container instantiation occurs via the standard resource creation operation (Section 7.1), differentiated by an indicator specifying the intent to establish a container rather than a non-container resource. This process yields an empty container amenable to subsequent population with members, including sub-containers to extend the hierarchy. Servers MUST assign identifiers, and empty containers MUST be supported.
This
section
defines
the
four
core
operations
that
a
Linked
Web
Storage
(LWS)
server
MUST
support.
These
operations
manipulate
resources
and
containers
in
a
transport-independent
manner,
focusing
on
semantics
rather
than
implementation
details.
Each
operation
requests
specifies
inputs,
expected
behaviors,
and
possible
responses.
Responses
include
success
indicators,
resource
representations
(where
applicable),
and
error
conditions.
Implementations
MUST
handle
these
operations
atomically
and
consistently,
meaning
each
operation
either
succeeds
completely
or
fails
without
partial
side
effects.
In
case
of
errors,
responses
SHOULD
provide
enough
detail
for
agents
to
understand
the
issue
without
leaking
sensitive
information.
The
create
resource
operation
adds
a
new
served
resource
representation
.
Draw
from
Solid
Protocol
-
Reading
Resources
to
an
existing
container
.
This
operation
handles
both
the
creation
of
data
resources
(files)
and
sub-containers.
Inputs:
Behavior:
Possible Responses:
Retrieves the representation of an existing resource or the listing of a container.
Modifies
the
contents
state
of
an
existing
[served
resource]
via
full
replacement
or
a
served
partial
patch.
Delete
Permanently
removes
a
resource
and
its
associated
metadata.
Define
the
data
model
for
logical
resource
organization
within
LWS,
including
This
section
defines
how
containers
the
generic
operations
and
responses
from
Section
7
are
structured,
hierarchical
relationships
between
resources,
realized
over
HTTP
using
RESTful
conventions.
It
specifies
the
HTTP
methods,
request
formats,
and
status
codes
that
an
LWS
REST
Servers
and
LWS
REST
Clients
should
use
for
interoperability.
In
other
words,
it’s
a
concrete
mapping
of
the
abstract
operations
to
HTTP
requests
and
responses.
The
following
assumes
an
LWS
server
exposing
resources
via
HTTP
URIs,
and
an
LWS
client
using
HTTP
methods
(GET,
POST,
PUT,
PATCH,
DELETE,
etc.)
to
invoke
the
operations.
For
each
core
operation
(create,
read,
update,
delete),
we
describe
the
HTTP
method(s)
to
use,
required
headers
or
special
considerations
(including
concurrency
controls
via
ETags,
content
negotiation,
and
pagination
for
container
semantics,
containment
rules,
listings),
and
what
the
server
should
do
and
return.
Standard
HTTP
status
codes
are
used
to
indicate
outcomes
(success
or
various
errors),
following
the
semantics
outlined
in
Section
7,
with
additional
mappings
for
scenarios
such
as
quota
exceeded
(507
Insufficient
Storage)
or
precondition
failures
(412
Precondition
Failed).
The
binding
tries
to
adhere
to
HTTP/1.1
and
relevant
RFCs
(such
as
[
RFC7231
]
for
HTTP
semantics,
[
RFC7233
]
for
range
requests,
[
RFC5789
]
for
PATCH,
[
RFC8288
]
for
Web
Linking,
and
[
RFC9264
]
for
Link
Sets)
so
that
it
integrates
naturally
with
web
standards.
Discoverability
is
emphasized
through
mechanisms
like
Link
headers
and
WWW-Authenticate
headers
on
401
responses,
avoiding
hardcoded
URI
locations.
Metadata
integration,
as
defined
in
Section
9.1,
is
required
across
operations,
ensuring
atomicity
and
use
of
Link
Sets
for
organizing
server-managed
and
navigating
collections
user-managed
properties.
Note: Examples given in this section (HTTP request and response snippets) are non-normative , meant to illustrate typical usage. The actual requirements are stated in the descriptive text and tables. Also, while this binding covers HTTP (as the initial target protocol), the LWS operations could in principle be bound to other protocols in the future. Servers SHOULD support content negotiation for formats like JSON-LD (with normative contexts and optional framing for containers) and Turtle, using custom media types such as 'application/lws+json' where appropriate.
This section defines the model for associating metadata with LWS resources. The LWS metadata system is based on the principles of Web Linking [ RFC8288 ], which allows servers to describe the relationships between resources using typed links. Metadata enhances discoverability, supports self-descriptive APIs, and aligns with resource operations, container hierarchies, and REST bindings as outlined in sections 7 and 8.
Metadata Model All metadata in LWS is expressed as a set of typed links originating from a resource (the link context). Each link consists of:
Metadata distinguishes between resources and their representations, allowing for multiple media types where applicable. For containers, metadata includes membership details and supports pagination to handle large sets efficiently. For DataResources, metadata includes representations, each with mediaType and optional sizeInBytes.
The Linkset Resource For each resource in storage, a server MUST make metadata links available as a standalone resource according to [ RFC9264 ].
Discovering Metadata Clients discover metadata primarily through Link headers in response to GET or HEAD requests.
Metadata Types
| Category | Description |
|---|---|
| System Managed | Maintained by the server; Read-Only. Includes acl, linkset, type, representation, sizeInBytes, modified. |
| Core Metadata | Managed by the client (subject to server restrictions). Includes partOf, contains, title, creator. |
| User-Defined | Custom vocabularies and indexes created by the user. |
Modifiability Considerations Core metadata MAY be modified by clients. To ensure interoperability, servers MUST use standard HTTP headers to advertise their capabilities:
Method Discovery: Servers MUST advertise support for GET and PATCH operations on the linkset resource via the Allow header.
Patch Format Discovery: Servers MUST advertise support for JSON Merge Patch [ RFC7386 ] via the Accept-Patch header: Accept-Patch: application/merge-patch+json.
Optional Methods: Servers MAY support PUT or alternative patch formats; if supported, these MUST be included in the Allow and Accept-Patch headers respectively.
[!IMPORTANT] Clients SHOULD NOT assume support for PUT or specific patch formats unless they are advertised in the resource headers and MUST handle 405 Method Not Allowed or 415 Unsupported Media Type responses gracefully.
Managing Metadata Metadata is managed by interacting with the resource's associated linkset URI. Servers MUST support concurrency controls (e.g., ETags) for updates.
Partial
Updates
(PATCH):
This
should
cover
is
the
primary
mechanism
for
metadata
management.
Servers
MUST
support
PATCH
using
application/merge-patch+json.
Replacement (PUT): If advertised in the Allow header, a client MAY replace the entire linkset. If the server does not support PUT, it MUST reject the request with 405 Method Not Allowed.
Restrictions: Servers MAY restrict modifications to specific links (like partOf or contains) to maintain system integrity (e.g., preventing resource "moves" that break slash-based semantics). If a server restricts partOf modifications, it MUST document this in its conformance statement.
Lifecycle: Metadata lifecycles are tied to the described resource; deleting a resource MUST result in the automatic removal of its associated linkset metadata.
New
resources
are
created
using
POST
to
a
target
container
creation,
membership
management,
URI,
with
the
server
assigning
the
final
identifier.
Clients
MAY
suggest
a
name
via
the
Slug
header.
Clients
MAY
provide
initial
user-managed
metadata
for
the
new
resource
by
including
one
or
more
Link
headers
in
the
POST
request,
following
the
syntax
of
Web
Linking
in
[
RFC8288
].
Server-managed
metadata
MUST
be
generated
automatically
by
the
server
upon
creation
and
MUST
NOT
be
overridden
by
client-provided
links.
On
success,
return
the
relationship
201
status
code
with
the
new
URI
in
the
Location
header.
The
server
MUST
include
Link
headers
for
key
server-managed
metadata,
such
as
a
link
to
the
parent
container
(rel="partOf"),
a
link
to
the
ACL
resource
(rel="acl"),
and
a
link
to
its
dedicated
linkset
resource
(rel="linkset";
type="application/linkset+json").
Additional
links
SHOULD
include
rel="type"
(indicating
Container
or
DataResource)
and
rel="mediaType"
if
applicable.
The
body
MAY
be
empty
or
include
a
minimal
representation
of
the
resource.
All
metadata
creation
and
linking
MUST
be
atomic
with
the
resource
creation
to
maintain
consistency.
POST (to a container URI) – Create with server-assigned name: Use POST to add a new resource inside an existing container. The server assigns an identifier to the resource, optionally suggested via the Slug header. The server MAY honor the Slug header if it does not conflict with naming rules or existing resources. Clients MUST include a Content-Type header in the request to indicate the media type of the new resource, enabling the server to distinguish between resource types. Specifically, servers MUST interpret the Content-Type as follows: if it matches the LWS-defined media type for containers (application/lws+json), the server creates a Container; otherwise, it creates a DataResource with the specified media type.
Example (POST to create a new data resource):
POST /alice/notes/ HTTP/1.1Host: example.comAuthorization: Bearer <token>Content-Type: text/plainContent-Length: 47Slug: shoppinglist.txtmilkeggsbreadbutterapplesorange juice
In
this
example,
the
client
is
posting
to
the
container
/alice/notes/
.
It
provides
text/plain
content
(a
grocery
list)
and
suggests
the
resources
they
contain.
name
shoppinglist.txt
for
the
new
resource.
If
/alice/notes/
exists
and
the
client
is
authorized,
the
server
will
create
a
new
DataResource
(based
on
the
Content-Type),
generate
associated
metadata,
and
link
it
via
the
linkset.
Example (Response to POST):
HTTP/1.1 201 CreatedLocation: /alice/notes/shoppinglist.txtContent-Type: text/plain; charset=UTF-8ETag: "def789012"Link: </alice/notes/shoppinglist.txt.meta>; rel="linkset"; type="application/linkset+json"Link: </alice/notes/>; rel="partOf"Link: </alice/notes/shoppinglist.txt.acl>; rel="acl"Link: <https://www.w3.org/ns/lws#DataResource>; rel="type"Content-Length: 0
On
success,
return
201
Created
with
the
new
URI
in
the
Location
header.
The
body
may
be
empty
or
a
minimal
representation.
Include
relevant
headers
such
as
Content-Type
matching
the
created
resource;
Content-Length:
0
indicates
no
body.
Server
responses
MUST
use
entity
tags
for
responses
that
contain
resource
representations
or
successful
responses
to
HEAD
requests,
enabling
concurrency
control
in
subsequent
operations.
If
the
target
container
/alice/notes/
does
not
exist,
the
server
MUST
return
a
404
error
status
unless
another
status
code
is
more
appropriate.
Creating
Containers:
To
create
a
new
container
via
the
REST
API,
a
client
uses
POST
to
an
existing
parent
container,
with
the
Content-Type
header
set
to
the
LWS-defined
media
type
application/lws+json
to
indicate
container
creation.
The
body
MAY
be
empty.
Servers
MUST
support
creation
of
containers
using
this
media
type.
For
example:
POST /alice/ HTTP/1.1Host: example.comAuthorization: Bearer <token>Content-Type: application/lws+jsonContent-Length: 0Slug: notes
This
would
create
a
new
container
at
/alice/notes/
,
with
server-generated
metadata
including
rel="type"
as
https://www.w3.org/ns/lws#Container
.
Additional notes on Create (HTTP binding):
Managing and Retrieving Metadata (Related to Creation): While metadata is primarily retrieved via read operations (Section 9.3), it is generated during creation. Clients can immediately retrieve it post-creation using GET or HEAD on the new resource URI. As described in Section 9.1, clients can use the Prefer header to request inclusion of specific metadata links (via relation types) and attributes.
The read resource operation requests a resource representation with HTTP GET requests (and HEAD for header-only requests). The behavior differs depending on whether the target URL is a container or a non-container resource (DataResource). Servers MUST distinguish resource types via metadata. All responses MUST integrate with metadata as defined in Section 9.1, including Link headers for key relations such as rel="linkset", rel="acl", rel="partOf", and rel="type". Servers MUST ensure atomicity between the resource state and its metadata during reads.
GET (non-container resource) – Retrieve a resource’s content: Send GET to the resource URI for full content (if authorized). Respond with 200 OK, body containing the data, and Content-Type matching the stored media type. Servers MUST support range requests per [ RFC7233 ] for partial retrieval. Responses MUST include an ETag header for concurrency control and caching.
Example (GET a file):
GET /alice/notes/shoppinglist.txt HTTP/1.1Authorization: Bearer <token>Accept: text/plain
This
strawman
requests
the
content
of
/alice/notes/shoppinglist.txt
,
indicating
that
the
client
wants
it
in
text
form.
Assuming
the
resource
exists,
is
text,
and
the
client
has
access:
HTTP/1.1 200 OKContent-Type: text/plain; charset=UTF-8Content-Length: 34ETag: "abc123456"Link: </alice/notes/shoppinglist.txt.meta>; rel="linkset"; type="application/linkset+json"Link: </alice/notes/>; rel="partOf"Link: </alice/notes/shoppinglist.txt.acl>; rel="acl"Link: <https://www.w3.org/ns/lws#DataResource>; rel="type"
milk
cheese
bread
guacamole
soda
chocolate bars
hash
eggs
mapping
The
server
returned
the
text
content
(34
bytes
in
total,
as
indicated
by
Content-Length
).
The
content
is
exactly
the
stored
data
in
the
file.
The
ETag:
"abc123456"
is
a
version
identifier
for
caching
or
concurrency
purposes.
The
response
includes
Link
headers
for
metadata
discoverability,
with
mandatory
fields
such
as
partOf,
acl,
and
type.
GET
(container
resource)
–
List
a
container’s
contents:
When
the
target
URI
corresponds
to
a
container
(determined
via
metadata
type),
a
GET
request
will
return
a
listing
of
the
operations
container’s
members
rather
than
raw
content.
Servers
MUST
support
pagination
for
large
memberships,
using
query
parameters
or
headers
to
return
partial
listings
with
links
to
subsequent
pages,
responding
with
206
Partial
Content
for
paginated
responses.
Listings
MUST
include
metadata
for
each
member:
resource
IDs
(
MUST
),
types
as
an
array
of
system
and
user-defined
(
MUST
),
representations
with
mediaType
and
optional
sizeInBytes
(
MUST
for
DataResources),
modified
timestamps
(
SHOULD
).
Example (GET a container with JSON-LD):
GET /alice/notes/ HTTP/1.1Authorization: Bearer <token>Accept: application/ld+jsonAssuming the container exists and the client has access:
HTTP/1.1 200 OKContent-Type: application/ld+json; profile="https://www.w3.org/ns/lws/v1"ETag: "container-etag-789"Link: </alice/notes/.meta>; rel="linkset"; type="application/linkset+json"Link: </alice/>; rel="partOf"Link: </alice/notes/.acl>; rel="acl"Link: <https://www.w3.org/ns/lws#Container>; rel="type"
{
"@context": "https://www.w3.org/ns/lws/context/v1.jsonld", "@id": "/alice/notes/", "@type": "Container", "totalItems": 2, "first": { "@type": "ContainerPage", "@id": "/alice/notes/?page=1", "partOf": "/alice/notes/", "contains": [
{
"@id": "/alice/notes/1.txt", "@type": ["DataResource", "http://example.org/customType"], "representation": [
{
"mediaType": "text/plain", "sizeInBytes": 1024
}
],
"modified": "2025-11-24T12:00:00Z"
},
{
"@id": "/alice/notes/2.txt", "@type": "DataResource", "representation": [
{
"mediaType": "text/plain", "sizeInBytes": 2048
}
],
"modified": "2025-11-24T13:00:00Z"
}
]
}
}
In
this
example,
/alice/notes/
is
a
container.
The
response
uses
JSON-LD
with
a
normative
context,
listing
members
with
required
metadata.
For
large
containers,
the
response
might
include
a
"next"
property
and
use
206
Partial
Content.
In
all
cases,
the
server
MUST
include
the
following
metadata
in
the
response
headers:
an
ETag
(representing
the
listing
version,
which
changes
on
membership
modifications),
and
Link
headers
with
rel="type"
indicating
it
is
a
container,
rel="linkset",
rel="partOf",
and
rel="acl".
HEAD (any resource or container) – Headers/metadata only: The LWS server MUST support HEAD [ RFC9110 ] for both containers and non-containers, returning the same headers as GET (including ETag, Content-Type, Link for metadata) but without a body. This enables metadata retrieval without transferring content.
Caching and Conditional Requests: LWS leverages HTTP caching semantics. Servers MUST support conditional requests via If-None-Match (with ETags) or If-Modified-Since headers. If the resource or container listing has not changed, respond with 304 Not Modified to avoid redundant transfers. ETags MUST be provided in all GET/HEAD responses for concurrency and caching support.
Discoverability and Authorization: For enhanced discoverability, servers SHOULD include WWW-Authenticate headers on 401 Unauthorized responses with parameters to guide clients without hardcoded URIs. Metadata links SHOULD be included where applicable.
The
update
resource
modifies
the
contents
of
an
existing
served
resource
by
a
PUT
request
(to
replace
the
entire
resource)
or
a
PATCH
request
(to
apply
a
partial
modification).
The
client
must
have
write
access
to
the
resource’s
URL
to
perform
these
operations.
Note:
This
section
describes
updating
a
resource's
primary
content.
To
update
its
metadata,
see
Section
9.3.2.
LWS
servers
MUST
handle
PUT
and
PATCH
requests
on
resource
URIs
as
modifications
to
the
resource
content
only,
with
no
default
impact
on
the
associated
linkset.
To
optionally
update
both
content
and
metadata
in
a
single
atomic
operation,
clients
MAY
include
Link
headers
in
the
PUT/PATCH
request
to
the
resource
URI
and
specify
the
preference
'Prefer:
set-linkset'
(as
defined
above
in
RFC
7240).
In
this
case,
the
server
MUST
interpret
the
provided
Link
headers
as
a
replacement
(for
PUT)
or
partial
update
(for
PATCH)
to
the
linkset,
in
addition
to
applying
the
content
changes.
This
behavior
is
OPTIONAL
for
servers
but,
if
supported,
MUST
be
invoked
explicitly
via
the
Prefer
header
to
prevent
unintentional
metadata
overwrites.
Servers
that
do
not
support
combined
updates
MUST
ignore
the
preference
or
respond
with
501
Not
Implemented.
PUT
(replace
full
resource)
–
Send
PUT
to
the
resource
URI
with
new
full
content
in
the
body
and
matching
Content-Type
(generally
consistent
with
existing
type).
PUT
is
idempotent
for
existing
resources.
For
safety,
include
If-Match
with
current
ETag
(per
Section
7.3
concurrency);
mismatch
yields
412
Precondition
Failed
or
409
Conflict.
Without
checks,
updates
are
unconditional
but
risk
overwriting
concurrent
changes.
If
a
server
supports
Etags
for
a
resource,
it
MUST
reject
unconditional
PUT
requests
that
lack
an
If-Match
header
with
a
428
Precondition
Required
response.
Example (PUT to update a resource):
PUT /alice/personalinfo.json HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/json
If-Match: "abc123456"
{
"name": "Alice",
"age": 30,"city": "New London","state": "Connecticut"
}
In this example, the client is updating an existing JSON resource at /alice/personalinfo.json. It includes an If-Match header with the ETag "abc123456" that it got from an earlier GET or HEAD request. The server will compare that to the current ETag; if they match, it proceeds to replace the content with the JSON provided. If they don’t match, the server rejects the update (because the resource was changed by someone else in the meantime). Successful response: If the update succeeds, the server can respond with 200 OK and possibly include the updated representation or some confirmation (like the new content or a part of it). Alternatively, the server may respond with 204 No Content to indicate success with no body (especially common if no further info needs to be conveyed). In either case, the server SHOULD include a new ETag to signify the new version, and maybe a Content-Type if a body is returned. For example:
HTTP/1.1 204 No ContentETag: "def789012"
This
tells
the
client
the
update
went
through
and
provides
the
new
ETag
.
If
the
server
chose
to
return
the
updated
content,
it
might
use
200
OK
and
include
the
JSON
in
the
body,
along
with
headers.
If-Match
did
not
match
(concurrent
modification),
the
server
could
return
412
Precondition
Failed
(meaning
the
precondition
header
failed)
or
409
Conflict
–
our
earlier
abstract
description
used
Conflict
for
concurrency
issues,
and
409
is
a
natural
mapping
for
that
scenario.
If
the
resource
did
not
exist,
a
PUT
meant
as
an
update
will
result
in
404
Not
Found
(unless
the
intent
was
to
create,
but
typically
clients
use
PUT
for
create
only
when
they
are
sure
of
what
they’re
doing,
or
they
use
it
as
upsert
without
If-Match).
If
the
client
is
not
authorized,
403
Forbidden
(or
401
Unauthorized
if
no
valid
credentials
were
provided).
If
the
request
payload
is
not
valid,
400
Bad
Request
.
PATCH
(partial
update)
–
The
HTTP
PATCH
method
[
RFC5789
]
allows
a
client
to
specify
partial
modifications
to
a
resource,
rather
than
sending
the
whole
new
content.
This
is
useful
for
large
resources
where
sending
the
entire
content
would
be
inefficient
if
only
a
small
part
changed,
or
for
concurrent
editing
where
you
want
to
apply
specific
changes.
LWS
REST
Servers
server
MUST
minimally
support
JSON
Merge
Patch
(application/merge-patch+json)
as
defined
in
[
RFC7386
and
].
Update Resource Metadata (HTTP PUT / PATCH on Linkset) A resource's metadata is updated by modifying its corresponding linkset resource, discovered via the Link header with rel="linkset". Full Replacement (PUT): A PUT request to the linkset URI with a complete linkset document in the body replaces all metadata for the resource. Partial Update (PATCH): A PATCH request to the linkset URI adds, removes, or modifies specific links.
Concurrency
Control
for
Metadata
Because
a
resource's
metadata
can
be
modified
by
multiple
actors,
preventing
concurrent
overwrites
is
critical.
To
ensure
data
integrity,
LWS
REST
Clients
servers
and
clients
MUST
implement
optimistic
concurrency
control
using
conditional
requests
[
RFC7232
]
for
all
PUT
and
PATCH
operations
on
a
linkset
resource.
Server
Responsibilities:
A
server
MUST
include
an
Etag
header
in
its
responses
to
communicate
over
HTTP
GET
and
HEAD
requests
for
a
linkset
resource.
Upon
a
successful
PUT
or
PATCH
on
the
linkset,
the
server
MUST
generate
a
new,
unique
Etag
value
for
the
modified
linkset
and
return
it
in
the
Etag
header
of
the
response.
Client
Responsibilities:
When
modifying
a
linkset
resource,
a
client
MUST
include
an
If-Match
header
containing
the
most
recent
Etag
it
received
for
that
resource.
Processing
Rules:
If
the
If-Match
header
value
does
not
match
the
linkset's
current
Etag,
the
server
MUST
reject
the
request
with
a
412
Precondition
Failed
status
code.
If
the
If-Match
header
is
missing
from
a
PUT
or
PATCH
request
to
a
linkset
URI,
the
server
MUST
reject
the
request
with
a
428
Precondition
Required
status
code
[
RFC6585
].
Example
(PUT
to
replace
a
linkset):
A
client
first
fetches
the
linkset
and
receives
its
ETag.
GET /alice/personalinfo.json.meta HTTP/1.1
Authorization: Bearer <token>
Accept: application/linkset+json
HTTP/1.1 200 OK
Content-Type: application/linkset+json
ETag: "meta-v1"
{
"linkset": [
{
"anchor": "/alice/personalinfo.json",
"describedby": [ { "href": "/schemas/personal-info.json" } ]
}
]
}
The client now wants to add a license. It constructs a new, complete linkset document and sends a PUT request with the If-Match header.
PUT /alice/personalinfo.json.meta HTTP/1.1
Authorization: Bearer <token>
Content-Type: application/linkset+json
If-Match: "meta-v1"
{
"linkset": [
{
"anchor": "/alice/personalinfo.json",
"describedby": [ { "href": "/schemas/personal-info.json" } ],
"license": [ { "href": "https://creativecommons.org/licenses/by/4.0/" } ]
}
]
}
If successful, the server responds with success and the new ETag.
HTTP/1.1 204 No ContentETag: "meta-v2"Summary of Update Rules If you want to change only the content of a resource → PUT/PATCH the resource itself. If you want to change only the links (metadata) of a resource → PUT/PATCH the resource’s associated linkset resource. If you want to change both content and links → PUT/PATCH the resource itself, including the appropriate Link headers AND 'Prefer: set-linkset'. Setting both is off by default.
The
delete
resource
operation
is
implemented
using
REST
conventions.
the
HTTP
DELETE
method,
as
defined
in
the
abstract
operation
above.
This
section
specifies
the
HTTP
bindings
for
inputs,
behaviors,
and
responses.
The
following
DELETE
request
targets
the
URI
of
the
resource
or
container
to
remove.
Clients
MAY
include
an
If-Match
header
with
an
ETag
for
concurrency
checks,
as
described
in
the
abstract
operation.
For non-container resources, the server processes the deletion as specified in the abstract behavior.
For container resources, the server defaults to non-recursive deletion. If recursion is desired and supported, clients MUST use the Depth: infinity header, as defined in [ RFC4918 ]. Servers that do not support recursion MUST reject such requests with 501 Not Implemented.
On success, the server MUST respond with 204 No Content. Servers SHOULD support concurrency checks via If-Match with ETags; mismatches MUST yield 412 Precondition Failed.
If the client lacks authorization, the server MUST return 403 Forbidden (if the client's identity is known but permissions are insufficient) or 401 Unauthorized (if no valid authentication is provided). In cases where revealing resource existence poses a security risk, the server MAY return 404 Not Found instead.
Example (DELETE a non-container resource):
DELETE /alice/notes/shoppinglist.txt HTTP/1.1Authorization: Bearer <token>If-Match: "abc123456"
Assuming
the
ETag
matches
and
the
client
is
authorized,
the
server
deletes
the
resource,
its
metadata,
and
updates
the
containing
container
/alice/notes/
atomically:
HTTP/1.1 204 No ContentExample (DELETE a non-empty container without recursion):
DELETE /alice/notes/ HTTP/1.1Authorization: Bearer <token>
Assuming
/alice/notes/
contains
resources,
the
server
refuses
the
deletion:
HTTP/1.1 409 ConflictContent-Type: text/plainCannot delete container /alice/notes/ - container is not empty.Example (DELETE a container with recursion, if supported):
DELETE /alice/notes/ HTTP/1.1Authorization: Bearer <token>Depth: infinityAssuming the server supports recursion and the client has permissions for all contents, the server deletes the container and its descendants atomically:
HTTP/1.1 204 No Content
This
table
maps
generic
LWS
response
responses
(from
Section
8)
to
an
HTTP
status
code
codes
and
payload:
payloads
for
consistency,
incorporating
specific
scenarios
such
as
pagination,
concurrency
controls,
quota
constraints,
and
metadata
integration:
| LWS response | HTTP status code | HTTP payload |
|---|---|---|
|
|
200 OK |
|
|
|
|
Typically
no
response
body
(or
a
minimal
representation
of
the
new
resource).
The
Location
header
is
set
to
the
new
resource’s
URI.
Headers
like
ETag
MUST
be
included
for
concurrency;
Link
headers
for
server-managed
metadata.
|
|
| 204 No Content | No response body. Indicates the resource was deleted or the request succeeded and there’s nothing else to say. Servers MAY use 410 Gone for permanent deletions. |
| Bad Request (invalid input or constraints) | 400 Bad Request |
Error
details
explaining
what
was
wrong.
Servers
SHOULD
use
the
standard
format
defined
in
[
|
Define how resources are identified and addressed within the LWS Protocol, including URI schemes, resource naming conventions, and resolution mechanisms. This section may be moved within another section; e.g. Resource Access
this left intentionally blank
The features described in this section are being drafted to ground discussions and may be removed if there is:
this left intentionally blank
Define mechanisms for content negotiation based on profiles, allowing clients to request specific representations or views of resources (e.g., JSON-LD contexts, different RDF serializations, or application-specific profiles).
this left intentionally blank
Define notification mechanisms that allow clients to be informed of changes to resources, including subscription models, event formats, and delivery mechanisms.
this left intentionally blank
Define inbox resources with specific semantics within LWS, including message posting, retrieval, and management capabilities for asynchronous communication patterns.
this left intentionally blank
Describe considerations for ensuring LWS implementations can work across different platforms, environments, and storage backends while maintaining interoperability - and provide affordances to enable change in storage providers
this left intentionally blank
Formal security considerations section covering threat models, security requirements, and implementation guidance for secure LWS deployments.
All communications related to requesting, retrieving and presenting end-user credentials between clients and servers must use TLS-protected connections.
End-user credentials are vulnerable to theft and replay. Tokens should have a reasonably short lifetime, such as 3600 seconds (1 hour).
Clients that persist end-user credentials must take great care to store these tokens securely. Tokens should never be stored unencrypted in a browser's localStorage, in URLs or in logs.
Privacy implications of the LWS Protocol, including data minimization, user consent, and privacy-preserving implementation patterns.
End-user credentials carry information about users. While digital signatures can protect end-user credentials against tampering, it is possible for clients or other third parties to read the values inside an unencrypted credential.
As a result, issuers should create end-user credentials that contain only the information necessary for authentication. Avoid including sensitive attributes unless required.
Implementations should not log the full contents of an end-user credential. If logging is necessary, tokens should be truncated or hashed.
This section is non-normative.
This specification adds the following value to the "Well-Known URIs" registry [ IANA.well-known ] established by RFC 5785 [ RFC5785 ].
Referenced in:
Referenced in: