Skip to main content
POST
/
events
/
correction
Correct an ingested event
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 first 30 events matching the filters with the default sort order being EVENT_SOURCE_TIME DESC, EVENT_ID ASC can be corrected in a single request.
  • Async mode: When query parameter async = true is given, 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
account_id
string
required
Unique identifier of the account corresponding to the event
id
string
Unique identifier of an event generated by Togai for reference
event_id
string
Identifier of an event provided by the user
event_source_time
string
Timestamp of an event provided by the user
created_at
string
Timestamp corresponding to the event ingestion time in Togai
async
boolean
Determines the mode of the correction. Defaults to false
account_idaccount_id, idaccount_id, event_idaccount_id, event_source_timeaccount_id, event_id, created_ataccount_id, event_id, event_source_time

Authorizations

Authorization
string
header
required

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
Example:

"UNDO"

require_confirmation
boolean

Specifies whether to start a migration only after a confirmation

Example:

false

Body

application/json

Event Correction Payload for event correction

event
object

Contents of the event

Response

Success response

Events Correction response

data
object[]
required
Required array length: 1 - 50 elements