Documentation
POST /api/intent/revert
Undo the last applied intent.
| Request | POST /api/intent/revert |
|---|---|
| Authentication | Session cookie required |
| Handler | backend/server.py |
What it does
Reverts the most recent reversible intent and regenerates the store. The response names what was reverted from, so the record of the change survives the undo.
Authentication
Session cookie required. Send the ff_session cookie. Without one the engine treats the caller as a new visitor with no holds and no claims, and returns a new cookie to use from then on.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
ff_session | cookie | string | Optional | The session identifier. Omit it on the first call and store the value the response sets; every later call must send the same one or the engine treats the caller as a new visitor with no holds and no claims. |
Request
The cookie jar carries the session between calls. Angle-bracketed values are the parameter types from the table above.
curl -s -b cookies.txt -c cookies.txt \
-X POST -H 'Content-Type: application/json' \
"https://flowfinds.ai/api/intent/revert"const res = await fetch("https://flowfinds.ai/api/intent/revert", {
method: "POST",
credentials: "include",
});
const data = await res.json();import requests
s = requests.Session()
r = s.post("https://flowfinds.ai/api/intent/revert")
data = r.json()Recorded example
curl -s -b cookies.txt -c cookies.txt \
-X POST -H 'Content-Type: application/json' \
-d '{}' \
"$FLOWFINDS_ORIGIN/api/intent/revert"Responses
200 — The revert completed.
| Field | Type | Description |
|---|---|---|
status | string | `reverted`, or `revert_failed` when the store rebuild failed. |
product_id | string | The product. |
reverted_from | object | The `surface`, `diff` and `lead` that were in force before the revert. |
Errors
| Status | Reason | When |
|---|---|---|
409 | nothing_to_revert | No reversible intent is in force. |
409 | build_in_progress | A build is already running. |
500 | revert_build_raised | The regeneration raised. |
Related
GET /api/store— The state of the session's storefront.POST /api/store— Start generating the storefront for the session's product.POST /api/store/publish— Verify and publish the storefront, regenerating it if verification demands.POST /api/intent— Ask the engine what it would change on a surface, and why.POST /api/intent/apply— Apply a proposed intent, regenerating the store.POST /api/intent/order— Override the section the storefront leads with.POST /api/ai/edit— Edit the storefront in natural language.GET /api/editor/— Read editor state and store metrics.
Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.