Skip to main content

Send single event

Use the Send Event API to ingest events from your application into BIK.

Request parameters

info

Either email or phoneNumber must be provided; both cannot be empty at the same time.

NameTypeRequired/OptionalDescription
eventEventRequiredEvent object to ingest

Event Type

NameTypeRequired/OptionalDescription
namestringOptionalCustomer name
phoneNumberstringOptionalCustomer phone number
emailstringOptionalCustomer email address
eventNamestringRequiredEvent name
eventProperties[key: string]: string or number or boolean or objectRequiredKey-value pairs describing the event
createdAtstringOptionalISO 8601 timestamp of the original event. Defaults to ingestion time if omitted.
isMigrationbooleanOptionalSet to true to route through the historical migration pipeline. Defaults to false.

Request Information

CategoryValue
Http requestPOST
URLhttps://bikapi.bikayi.app/integrations/bikPlatformFunctions-events/sendEvent

Sample request

curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-events/sendEvent' \
--header 'Authorization: Basic AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"event": {
"name": "Name",
"email": "test@bik.ai",
"phoneNumber": "+19494572787",
"eventName": "purchasedAProduct",
"eventProperties": {
"productId": "PRODUCT_ID",
"orderId": "test-order-id1234",
"orderName": "my-order",
"productName": "my-product",
"itemPrice": 500,
"currency": "INR",
"customerId": "CUST_TEST_123",
"variantId": "1234567890"
}
}
}'

JSON response example:

{
"status": 200,
"success": true
}

Response parameters

NameTypeDescription
statusnumberHTTP status code
successbooleanIndicates whether the request succeeded

Errors

Error CodeMeaning
400Invalid payload -- Your request is invalid.
401Unauthorized -- User is not authenticated.
404Not Found -- The specified API could not be found.
500Internal Server Error -- We had a problem with our server. Try again later.

Error response example:

{
"status": 400,
"errors": [
{
"message": "'eventProperties.variantId' is required"
}
]
}

Historical Data Migration

By default, events are processed in real time. To backfill historical data, set "isMigration": true in the event payload — this routes it through a separate low-priority pipeline that preserves the original createdAt timestamp.

ScenarioisMigrationcreatedAtResult
Normal real-time eventfalse / omittedomittedIngestion time used, goes to real-time stream
Historical eventtrue"2024-11-15T..."Supplied date preserved, routed to migration pipeline
Historical event, no datetrueomittedIngestion time used, still routed to migration pipeline
Back-date only, no flagfalse / omitted"2024-11-15T..."Date preserved but goes to real-time stream — will be rejected by data stream
danger

Always set both isMigration: true and createdAt together when pushing historical data.


Note: BIK does not currently support custom event ingestion.