Confirm undo for one action
curl --request POST \
--url https://api-v2.watchcollect.com/v2/actions/{action_id}/revert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "frontend-action-revert:018f06e2-4f8d-7c01-8a0d-cc6fd78f7070:1780509605123:018f06e2-4f8d-7c01-8a0d-cc6fd78f7071",
"expected_versions": [
{
"stream_type": "saved_view",
"stream_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"latest_sequence": 123
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
idempotency_key: 'frontend-action-revert:018f06e2-4f8d-7c01-8a0d-cc6fd78f7070:1780509605123:018f06e2-4f8d-7c01-8a0d-cc6fd78f7071',
expected_versions: [
{
stream_type: 'saved_view',
stream_id: '018f06e2-4f8d-7c01-8a0d-cc6fd78f7070',
latest_sequence: 123
}
]
})
};
fetch('https://api-v2.watchcollect.com/v2/actions/{action_id}/revert', 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"
payload = {
"idempotency_key": "frontend-action-revert:018f06e2-4f8d-7c01-8a0d-cc6fd78f7070:1780509605123:018f06e2-4f8d-7c01-8a0d-cc6fd78f7071",
"expected_versions": [
{
"stream_type": "saved_view",
"stream_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"latest_sequence": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "accepted",
"event_ids": [
"018f06e2-4f8d-7c01-8a0d-cc6fd78f7002"
],
"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"
}
}{
"error": {
"code": "invalid_payload",
"message": "event is required",
"request_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7001"
}
}actions
Confirm undo for one action
Appends compensating events for the previewed action. The request must carry the expected_versions from a recent preview.
POST
/
v2
/
actions
/
{action_id}
/
revert
Confirm undo for one action
curl --request POST \
--url https://api-v2.watchcollect.com/v2/actions/{action_id}/revert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "frontend-action-revert:018f06e2-4f8d-7c01-8a0d-cc6fd78f7070:1780509605123:018f06e2-4f8d-7c01-8a0d-cc6fd78f7071",
"expected_versions": [
{
"stream_type": "saved_view",
"stream_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"latest_sequence": 123
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
idempotency_key: 'frontend-action-revert:018f06e2-4f8d-7c01-8a0d-cc6fd78f7070:1780509605123:018f06e2-4f8d-7c01-8a0d-cc6fd78f7071',
expected_versions: [
{
stream_type: 'saved_view',
stream_id: '018f06e2-4f8d-7c01-8a0d-cc6fd78f7070',
latest_sequence: 123
}
]
})
};
fetch('https://api-v2.watchcollect.com/v2/actions/{action_id}/revert', 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"
payload = {
"idempotency_key": "frontend-action-revert:018f06e2-4f8d-7c01-8a0d-cc6fd78f7070:1780509605123:018f06e2-4f8d-7c01-8a0d-cc6fd78f7071",
"expected_versions": [
{
"stream_type": "saved_view",
"stream_id": "018f06e2-4f8d-7c01-8a0d-cc6fd78f7070",
"latest_sequence": 123
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "accepted",
"event_ids": [
"018f06e2-4f8d-7c01-8a0d-cc6fd78f7002"
],
"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"
}
}{
"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
Body
application/json