Undo ingested events.
curl --request DELETE \
--url https://api.togai.com/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.togai.com/events"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.togai.com/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"referenceId": "event.21OpEx4DHQu.CZlyh",
"eventPayload": {
"timestamp": "2023-02-23T14:25:10Z",
"schemaName": "travelCompletedEvent",
"id": "c0b1306d-f506-43a6-856b-69221efaee6b",
"accountId": "1",
"attributes": [
{
"name": "distanceTravelled",
"value": 50,
"unit": "Miles"
},
{
"name": "timeSpent",
"value": 60,
"unit": "Minutes"
}
],
"dimensions": {
"location": "Seattle",
"costCenterCode": 1234,
"travelType": "Business"
}
},
"ingestionStatus": {
"status": "INGESTION_COMPLETED_EVENT_NOT_BILLED",
"statusDescription": "Event ingestion completed successfully but the event is not associated with any bill plan."
},
"customerId": "CUS0001",
"source": {
"id": "ENTITLED",
"type": "ENTITLED"
},
"createdAt": "2023-02-23T14:25:10Z",
"status": "REVERTED",
"reason": "Event Reverted"
},
{
"referenceId": "event.23OrTx4FGQu.XVpzf",
"eventPayload": {
"timestamp": "2023-02-23T14:25:10Z",
"schemaName": "smsSentEvent",
"id": "sdvb325j-f506-43a6-856b-69221efaee6b",
"accountId": "1",
"attributes": [
{
"name": "smsCount",
"value": 50,
"unit": "count"
}
]
},
"ingestionStatus": {
"status": "INGESTION_COMPLETED_EVENT_NOT_BILLED",
"statusDescription": "Event ingestion completed successfully but the event is not associated with any bill plan."
},
"customerId": "CUS0001",
"source": {
"id": "",
"type": ""
},
"createdAt": "2023-01-01T14:25:10Z",
"status": "FAILED",
"reason": "Event was ingested in past pricing cycle"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<Reason message>"
}Event Management
Undo ingested events.
This API lets you to revert the changes caused by events.
- Usages: Reduction of all usages associated with this event
- Revenue: Reduction of all revenues associated with this event
- Entitlements: Entitlements(Feature Credits) consumed by this event are granted back to the account.
DELETE
/
events
Undo ingested events.
curl --request DELETE \
--url https://api.togai.com/events \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.togai.com/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.togai.com/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.togai.com/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.togai.com/events"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.togai.com/events")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"referenceId": "event.21OpEx4DHQu.CZlyh",
"eventPayload": {
"timestamp": "2023-02-23T14:25:10Z",
"schemaName": "travelCompletedEvent",
"id": "c0b1306d-f506-43a6-856b-69221efaee6b",
"accountId": "1",
"attributes": [
{
"name": "distanceTravelled",
"value": 50,
"unit": "Miles"
},
{
"name": "timeSpent",
"value": 60,
"unit": "Minutes"
}
],
"dimensions": {
"location": "Seattle",
"costCenterCode": 1234,
"travelType": "Business"
}
},
"ingestionStatus": {
"status": "INGESTION_COMPLETED_EVENT_NOT_BILLED",
"statusDescription": "Event ingestion completed successfully but the event is not associated with any bill plan."
},
"customerId": "CUS0001",
"source": {
"id": "ENTITLED",
"type": "ENTITLED"
},
"createdAt": "2023-02-23T14:25:10Z",
"status": "REVERTED",
"reason": "Event Reverted"
},
{
"referenceId": "event.23OrTx4FGQu.XVpzf",
"eventPayload": {
"timestamp": "2023-02-23T14:25:10Z",
"schemaName": "smsSentEvent",
"id": "sdvb325j-f506-43a6-856b-69221efaee6b",
"accountId": "1",
"attributes": [
{
"name": "smsCount",
"value": 50,
"unit": "count"
}
]
},
"ingestionStatus": {
"status": "INGESTION_COMPLETED_EVENT_NOT_BILLED",
"statusDescription": "Event ingestion completed successfully but the event is not associated with any bill plan."
},
"customerId": "CUS0001",
"source": {
"id": "",
"type": ""
},
"createdAt": "2023-01-01T14:25:10Z",
"status": "FAILED",
"reason": "Event was ingested in past pricing cycle"
}
]
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<Reason message>"
}Query Parameters: Allowed filter combinations
All matching events will be considered for deletion
Maximum of 5 events will be deleted per request. This behavior might change in future
Query Parameters
Query Parameters
string
required
Unique identifier of the account corresponding to the event
string
Unique identifier of an event generated by Togai for reference
string
Identifier of an event provided by the user
string
Timestamp of an event provided by the user
string
Timestamp corresponding to the event ingestion time in Togai
Allowed Combinations
Allowed Combinations
account_idaccount_id, idaccount_id, event_idaccount_id, event_source_timeaccount_id, event_id, created_ataccount_id, event_id, event_source_time⌘I
