The update endpoint
The browser posts one signed batch and reads back new markup. This page states the contract exactly: what the request must carry, what the server checks and in what order, and what each failure answers.
{
"_token": "the session token",
"components": [
{
"snapshot": "{\"data\":{...},\"memo\":{...},\"checksum\":\"...\"}",
"updates": { "count": 1 },
"calls": [
{ "method": "increment", "params": [], "metadata": {} }
]
}
]
}The JSON on the left is the batch shape this page documents; the frame is a component that speaks it.
Where it lives
Every endpoint sits under a prefix derived from the application key: the first eight hexadecimal characters of SHA-256 over the key string followed by livewire-endpoint.
/livewire-{hash}/update
/livewire-{hash}/upload-file
/livewire-{hash}/preview-file/{filename}
/livewire-{hash}/js/{file}
/livewire-{hash}/css/{file}
The update endpoint accepts POST and is registered in the web group, so the session and the framework's CSRF check run before the handler. The handler itself owns every other check.
The page publishes the address it used as data-update-uri on the script tag and as uri in window.livewireScriptConfig. Setting update_uri in configuration changes that published address; the package still registers the default path only, so an application that changes it must serve the new URI itself.
What the request must carry
| Requirement | Failure |
|---|---|
An X-Livewire header, any value | 404, empty body |
A content type starting with application/json | 404, empty body |
A valid session CSRF token: _token in the JSON body, or a token header | 419 from the framework's CSRF middleware |
A JSON body no larger than payload.max_size | 500, with the configured limit named |
At least one component, each with a string snapshot, an object updates, and an array calls | 404, empty body |
The body is read before it is parsed, so a chunked request without a content length still meets the size guard. The request is then rebuilt around a cheap clone of the bytes, so the session, the signed-in user, and an action's services still work.
{
"_token": "the session token",
"components": [
{
"snapshot": "{\"data\":{...},\"memo\":{...},\"checksum\":\"...\"}",
"updates": { "count": 1 },
"calls": [
{ "method": "increment", "params": [], "metadata": {} }
]
}
]
}
snapshot is one minified JSON string per component. A call's params is a list or an object; any other JSON type is malformed. Every component envelope is checked before any count limit applies, so a malformed batch is a 404 rather than a limit violation.
The per-component pipeline
Components run in the order the request listed them. One request holds the whole batch's state: the render stack, the children, the response assets, and the computed values.
- Parse the snapshot into
data,memo, andchecksum. A structure the protocol does not define is a404. - Verify the checksum. The client's failure allowance is checked once for the batch, before the first snapshot, and each failure is counted.
- Decide whether the component can skip its render: no updates, only
$commitcalls, declared reactive props, no bindings, and props identical to what the parent passed. A skip answers{"skip":true,"id":...}. - Run the registered persistent guards. The first guard that answers a response ends the whole batch with it.
- Check the release token. A mismatch is a
419. - Check the origin the snapshot recorded against the update's
Originheader, or the host it was addressed to. A mismatch is a404. - Restore the children the memo recorded, then hydrate the fields from
data. A field the component does not publish, or one it locked, cannot be updated. - Run
boot,initialize, andhydrate; then fetch unresolved model references. - Apply a parent's reactive props, then each update in order:
updatingfor the root field, the dotted-path assignment, and oneupdatedper touched root after all assignments. - Run the calls in order: an event is resolved to a listener, an upload call is handled by the runtime, a policy may refuse, and a JSON action records its return metadata.
- Fetch model references an action wrote, then render unless the response skips it: JSON-only calls, an explicit
skipRender, or a redirect withoutrender_on_redirect. - Run
dehydrate, build and sign the new snapshot, injectwire:id,wire:name,wire:snapshot, andwire:effectsinto the first root tag, and add the result aseffects.html. An island action answers with its fragment instead.
The answer carries one entry per component, in request order, plus the response-level assets:
{ "components": [ { "snapshot": "...", "effects": { "html": "..." } } ], "assets": [] }
A streamed action sends its frames before that payload. The response is then text/event-stream with cache-control: no-cache and x-livewire-stream: true; each frame is {"stream":true,"body":{...},"endStream":true}, and the ordinary JSON payload follows the last frame. Assets are not injected into a streamed answer.
The snapshot envelope
Three keys, always in this order, serialized minified so the same snapshot always encodes to the same bytes:
| Key | Holds |
|---|---|
data | The wire-public fields, in declaration order, plus __meta__ for synthesized fields |
memo | id, name, children, release, then the feature entries: json, async, isolate, props, errors, scripts, assets, slots, and the page's path, method, origin |
checksum | HMAC-SHA256, lowercase hex |
memo.children is always an object, and an empty child list is {}, never null or an omission.
The checksum signs {"data":...,"memo":...} with memo.children removed, under the application's encryption key. The child list is the one part the browser may rewrite while it morphs the DOM, so it is outside the signature; every other entry is covered. Verification removes the same parts and compares in constant time, so a tampered data.count is a 419 while a rewritten child list is accepted.
The release token is a-{release_token}-{component release token}, with both defaults a, so an unchanged installation sends a-a-a. A redeployment that changes the configured token invalidates every browser session still holding an old snapshot. The check runs after the checksum.
The failure allowance
A client that keeps sending corrupt snapshots is stopped by the framework's rate limiter:
- Ten failures per ten minutes, keyed
livewire-checksum-failures:{ip}in the default cache store. - The allowance is checked once per batch, before the first snapshot is verified; each failed snapshot is counted once.
- Once the allowance is used, the batch answers
429withToo many invalid Livewire requests. Please try again later.and aRetry-Afterheader in seconds. - A cache that cannot be read does not block the request: the limiter fails open rather than turning a cache outage into a broken endpoint.
Limits
All four live under payload in the configuration. None disables one. Each configured limit answers 500 with the message below, which names the setting.
| Setting | Default | Counts |
|---|---|---|
max_size | 1048576 bytes | The request body, compared after it is read |
max_nesting_depth | 10 | One dotted update path, such as a.b.c |
max_calls | 50 | Every call in the batch, summed |
max_components | 200 | Every component in the batch |
The error table
| Status | Cause | Message |
|---|---|---|
404 | Missing header or JSON content type, empty or invalid body, malformed envelope, foreign origin | Empty body |
404 | A model reference names no row | Unable to find the [post] model for the reference [12]. |
404 | Snapshot structure | Invalid Livewire snapshot structure: expected [data], [memo], [checksum], [memo.id], and [memo.name]. |
419 | Checksum | Livewire encountered corrupt data when trying to hydrate a component. |
419 | Release token | Livewire detected a release token mismatch. |
419 | Unknown action | Unable to call component method. Public method [save] not found on component |
419 | Locked field | Unable to update locked property [id] of component [counter] |
419 | Typed hydration | Unable to hydrate [count] into component [counter]: ... |
429 | Failure allowance used | Too many invalid Livewire requests. Please try again later. |
500 | Unknown component | Unable to find component: [posts] |
500 | Field not public | Unable to set component data. Public property [$title] not found on component: [post-editor] |
500 | Payload too large | Livewire request payload is too large (2048KB). Maximum allowed size is 1024KB. followed by the setting's path |
500 | Too many components | Too many components in a single request (201). Maximum allowed is 200. followed by the setting's path |
500 | Too many calls | Too many method calls in a single request (51). Maximum allowed is 50. followed by the setting's path |
500 | Path too deep | Property path [a.b.c] exceeds the maximum nesting depth of 10 levels. followed by the setting's path |
500 | Rendering | No root tag, more than one root element, or a view that does not exist |
500 | Undeclared event | Handler for event [post-saved] does not exist |
401 | Upload URL | The upload endpoint's signature is invalid or expired |
403 | A policy refused an action | This action is unauthorized. |
403 | Temporary file reference | The temporary file reference is invalid or expired |
422 | An upload failed validation | the uploaded file is invalid: ... |
Production sends the status, not the reason. Every response above is an empty body with its status. In debug mode the framework's error page renders for a corrupt payload, a release mismatch, an unknown method, and an undeclared event; other errors gain an x-livewire-error header carrying the message. A framework error page answers 500 even for a debugged 419.
Validation is not in this table on purpose. A rule failure during an update is an HTTP 200: the messages travel in memo.errors, the component renders with them, and the browser reads them from the snapshot.