POST
/
events
/
correction
curl --request POST \
  --url https://api.togai.com/events/correction \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "event": {
    "schemaName": "<string>",
    "id": "c0b1306d-f506-43a6-856b-69221efaee6b",
    "timestamp": "2022-06-15T07:30:35.123",
    "accountId": 1,
    "attributes": [
      {
        "name": "message",
        "value": 100,
        "unit": "characters"
      }
    ],
    "dimensions": {}
  }
}'
{
  "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_METERED",
        "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"
          }
        ],
        "dimensions": {}
      },
      "ingestionStatus": {
        "status": "INGESTION_COMPLETED_EVENT_NOT_METERED",
        "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"
    }
  ]
}

Query Parameters: Allowed filter combinations

All matching events will be considered for correction
  • Sync mode: Maximum of 5 events matching the filters can be corrected in a request.
  • Async mode: Events matching the filters will be considered for correction and takes place in background.
    Status of background job can be obtained using List Jobs API

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

action
enum<string>
required

Action to perform in event correction

Available options:
UNDO,
REDO,
REDO_EVENT
require_confirmation
boolean

Specifies whether to start a migration only after a confirmation

Body

application/json
event
object

Contents of the event

Response

200 - application/json
data
object[]
required