Preview undo for one action
curl --request POST \
--url https://api-v2.watchcollect.com/v2/actions/{action_id}/revert/preview \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-v2.watchcollect.com/v2/actions/{action_id}/revert/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-v2.watchcollect.com/v2/actions/{action_id}/revert/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ready",
"effects": [
{
"entity": {
"type": "saved_view",
"id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"label": "Rolex feed"
},
"summary": "Delete the saved view created by this action."
}
],
"conflicts": [
{
"entity": {
"type": "saved_view",
"id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"label": "Rolex feed"
},
"latest_event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"latest_event_type": "SavedViewUpdated",
"latest_occurred_at_ms": 123,
"latest_action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"expected_versions": [
{
"stream_type": "saved_view",
"stream_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"latest_sequence": 123
}
],
"message": "<string>"
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}actions
Preview undo for one action
Computes the compensating event plan without mutating state. Conflicts indicate later API events on the same primary stream.
POST
/
v2
/
actions
/
{action_id}
/
revert
/
preview
Preview undo for one action
curl --request POST \
--url https://api-v2.watchcollect.com/v2/actions/{action_id}/revert/preview \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-v2.watchcollect.com/v2/actions/{action_id}/revert/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-v2.watchcollect.com/v2/actions/{action_id}/revert/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ready",
"effects": [
{
"entity": {
"type": "saved_view",
"id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"label": "Rolex feed"
},
"summary": "Delete the saved view created by this action."
}
],
"conflicts": [
{
"entity": {
"type": "saved_view",
"id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"label": "Rolex feed"
},
"latest_event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"latest_event_type": "SavedViewUpdated",
"latest_occurred_at_ms": 123,
"latest_action_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"expected_versions": [
{
"stream_type": "saved_view",
"stream_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"latest_sequence": 123
}
],
"message": "<string>"
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Undo preview including effects, conflicts and expected stream versions.