Skip to main content
POST
/
events
/
batch
cURL
curl --request POST \
  --url https://api.getenso.ai/events/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "events": [
    {
      "CustomerEntityId": "<string>",
      "metric": "<string>",
      "value": 123,
      "timestamp": "2023-11-07T05:31:56Z",
      "metadata": {},
      "eventId": "<string>",
      "JobId": "<string>",
      "jobId": "<string>"
    }
  ]
}
'
{
  "status": "success",
  "message": "Success",
  "data": {
    "summary": {
      "success": 0,
      "failed": 3,
      "total": 3
    },
    "failedRecords": [
      {
        "index": 2,
        "error": "Customer entity not found",
        "code": 2002,
        "statusCode": 404
      },
      {
        "index": 0,
        "error": "Cannot parse input: expected '\"' before: 'N NaN:NaN:NaN.NaN\",\"metadata\":null,\"status\":\"active\",\"CustomerEntityId\":\"ent_6CsgzAdRgTlzT_9O\",\"JobId\":\"job_xI_wWRvcLpZzhiJF\",\"OrganisationId\":\"org_k0JGnR6VZsLd': (while reading the value of key timestamp): (at row 1)\\n: While executing WaitForAsyncInsert. ",
        "code": "27",
        "statusCode": 400
      },
      {
        "index": 1,
        "error": "Cannot parse input: expected '\"' before: 'N NaN:NaN:NaN.NaN\",\"metadata\":null,\"status\":\"active\",\"CustomerEntityId\":\"ent_6CsgzAdRgTlzT_9O\",\"JobId\":\"job_xI_wWRvcLpZzhiJF\",\"OrganisationId\":\"org_k0JGnR6VZsLd': (while reading the value of key timestamp): (at row 1)\\n: While executing WaitForAsyncInsert. ",
        "code": "27",
        "statusCode": 400
      }
    ]
  }
}

Error codes

CodeDescription
2001Customer entity ID required
2002Customer entity not found
2003events array is required

Authorizations

Authorization
string
header
required

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

Body

application/json

Batch events payload

events
object[]
required

List of events to be created

Response

Batch processed

status
string
Example:

"success"

message
string
Example:

"Success"

data
object