Record user properties
Records or updates user properties to enable personalized experiences and cohort analysis on the BIK dashboard.
Store detailed user attributes to drive data-informed strategies. This endpoint supports bulk operations and validates each property entry individually, returning any invalid entries in the response.
Request parameters
| Name | Type | Required/Optional | Description |
|---|---|---|---|
userProperties | UserProperty[] | Required | Array of user property objects. Check the UserProperty type here |
Request Information
| Category | Value |
|---|---|
| Http request | POST |
| URL | https://bikapi.bikayi.app/integrations/bikPlatformFunctions-createOrUpdateUserProperties |
curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-createOrUpdateUserProperties' \
--header 'Authorization: Basic AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"userProperties": [
{
"phoneNumber": "9090909090",
"email": "mark@bik.ai",
"firstName": "Test",
"lastName": "2"
},
{
"phoneNumber": "9090909010",
"emial": "mark2@bik.ai",
"firstName": "Test2",
"lastName": "4"
}
]
}'
JSON response example:
{
"status": 200,
"data": {
"invalidUserProperties": [
{
"phoneNumber": "9090909010",
"emil": "mark2@bik.ai",
"firstName": "Test2",
"lastName": "4",
"storeId": "p60HYv5wjgQaOrPdqT5NjbpkroD2",
"customerId": "5242031",
"error": "ValidationError: \"emil\" is not allowed"
}
],
"bulkUpsertUPResponse": {
"createCount": 0,
"updateCount": 1,
"docsFailedToUpdate": []
}
}
}
Response parameters
| Name | Type | Description |
|---|---|---|
status | boolean | HTTP status code |
data | RecordUserProperties | Response containing upsert results and any invalid entries |
UserProperty Type
| Name | Type | Required/Optional | Description |
|---|---|---|---|
firstName | string | Required | User first name |
lastName | string | Required | User last name |
source | string | Optional | Data source identifier |
phoneNumber | string | Optional | Phone number |
alternatePhoneNumber | string | Optional | Alternate phone number |
email | string | Optional | Email address |
address1 | string | Optional | Address line 1 |
address2 | string | Optional | Address line 2 |
city | string | Optional | City |
state | string | Optional | State or province |
country | string | Optional | Country |
createdAt | Date/string | Optional | Creation timestamp |
updatedAt | Date/string | Optional | Last update timestamp |
emailMarketingConsent | boolean | Optional | Whether the user has consented to email marketing |
smsMarketingConsent | boolean | Optional | Whether the user has consented to SMS marketing |
tags | string[] | Optional | Tags associated with the user |
partnerCustomerId | string | Optional | Partner platform customer ID |
RecordUserProperties Type
| Name | Type | Description |
|---|---|---|
bulkUpsertUPResponse | BulkUpsertUPResponse | Summary of the bulk upsert operation |
invalidUserProperties | UserProperty[] | Array of user property entries that failed validation |
BulkUpsertUPResponse Type
| Name | Type | Description |
|---|---|---|
createCount | number | Number of user properties created |
updateCount | number | Number of user properties updated |
Errors
| Error Code | Meaning |
|---|---|
| 400 | Invalid payload -- Your request is invalid. |
| 401 | Unauthorized -- User is not authenticated. |
| 404 | Not Found -- The specified API could not be found. |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |