Put back the assistant’s last change
POST
/storefront/assistant-change/undo
const url = 'https://example.com/storefront/assistant-change/undo';const options = { method: 'POST', headers: {cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/storefront/assistant-change/undo \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token>Puts the drafts back as they were before the assistant’s last change: the shop’s draft, a page’s draft or a draft post as it was, a page or post it wrote removed, or a page it deleted back. Only the last change, once, and only while what it changed is still exactly as the assistant left it: if anyone has changed it since (or published it, or taken its address), nothing is put back and the answer is 409, so the later change is never written over. Two requests at once put it back once; the other finds nothing (404).
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”What was put back
Media typeapplication/json
object
kind
required
string
name
required
string
at
required
string format: date-time
Example
{ "kind": "shop"}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}The plan does not include a shop
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Nothing to put back
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Changed since the assistant’s change, so it cannot be put back
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
Media typeapplication/json
object
error
required
string
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}