Create or update
Use the Create or Update Customer API to create a new customer record or update an existing one.
Request parameters
Either email or phoneNumber must be provided; both cannot be empty at the same time.
| Name | Type | Required/Optional | Description |
|---|---|---|---|
partnerCustomerId | string | Optional | External customer ID |
firstName | string | Optional | Customer first name |
lastName | string | Optional | Customer last name |
phoneNumber | string | Optional | Customer phone number |
email | string | Optional | Customer email address |
secondaryEmail | string | Optional | Secondary email address |
secondaryPhoneNumber | string | Optional | Secondary phone number |
alternateEmails | string[] | Optional | Alternate email addresses for asset creation |
alternatePhoneNumbers | string[] | Optional | Alternate phone numbers for asset creation |
secondaryEmails | string[] | Optional | Alternate email addresses for asset creation |
secondaryPhoneNumbers | string[] | Optional | Alternate phone numbers for asset creation |
overWriteAssets | boolean | Optional | Replace existing assets with the provided values |
tags | string[] | Optional | Customer tags |
addresses | BikPlatformAddress[] | Optional | Customer addresses. See the BikPlatformAddress type here. |
consent | CustomerConsent[] | Optional | Marketing consent per channel, at most one entry per channel. See the CustomerConsent type here. |
The secondaryEmails and secondaryPhoneNumbers fields are deprecated. Use alternateEmails and alternatePhoneNumbers instead.
Recording consent
Use consent to record what the customer agreed to (or withdrew) for marketing on each channel, for example from your signup form or CRM. This is how you pass DPDP consent to BIK.
- Each entry applies to every contact the customer has on that channel, including the secondary and alternate phone numbers and emails sent in the same request.
UNSUBSCRIBEDstops marketing messages to the customer on that channel from the next send.PENDINGmeans the customer has not confirmed yet (for example, a double opt-in link not yet clicked). It is recorded, and the customer still receives marketing.PENDINGis not accepted for a customer who has withdrawn consent (UNSUBSCRIBED) on that channel; sendSUBSCRIBEDonce they confirm.rcsandwebpushconsent apply to the customer's phone numbers.smsconsent does not coverrcs; send both if both apply.- A customer created without
consentis treated as not subscribed and can still receive marketing. - If the
consentlist is invalid (unknown channel or status, or two entries for the same channel), the request fails with400and the customer is not saved. - An entry that cannot be applied (for example,
emailconsent for a customer with no email) does not fail the request. It comes back inconsent.rejectedwith the reason, and the other entries are still applied.
To change consent later for a customer that already exists, use the Update consent API.
Request Information
| Category | Value |
|---|---|
| Http request | POST |
| URL | https://bikapi.bikayi.app/integrations/bikPlatformFunctions-customers/createOrUpdate |
Sample request
curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-customers/createOrUpdate' \
--header 'Authorization: Basic AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"partnerCustomerId": "abcd-122345",
"firstName": "First",
"lastName": "Last",
"phoneNumber": "+919090909090",
"email": "test.2@bik.ai",
"secondaryEmail": "test3@bik.ai",
"secondaryPhoneNumber": "+918908898123",
"alternateEmails": ["test898900@bik.ai", "test898911@bik.ai"],
"alternatePhoneNumbers": ["+918989890011", "+918989890022"],
"tags": ["test", "test2"],
"addresses": [
{
"address1": "hsr layout",
"city": "bangalore",
"country": "India",
"countryCode": "IN",
"state": "karnataka",
"zip": "560102"
}
],
"consent": [
{
"channel": "whatsapp",
"status": "SUBSCRIBED",
"purpose": "marketing",
"evidenceRef": "signup-form-1042",
"consentedAt": "2026-11-13T10:00:00.000Z"
},
{
"channel": "email",
"status": "UNSUBSCRIBED"
}
]
}'
JSON response example:
{
"status": 200,
"success": true,
"data": {
"customer": {
"id": 5482636,
"partnerCustomerId": "abcd-122345",
"firstName": "Test",
"lastName": "Last",
"phoneNumber": "+919090909090",
"email": "test.2@bik.ai",
"countryCode": "IND",
"createdAt": "2024-08-09T09:32:55.568Z",
"updatedAt": "2024-08-09T09:33:15.939Z",
"assets": [
{
"id": 4516077,
"createdAt": "2024-08-09T09:32:55.583Z",
"assetName": "EMAIL",
"assetValue": "test.2@bik.ai",
"countryCode": null
},
{
"id": 4516079,
"createdAt": "2024-08-09T09:33:16.284Z",
"assetName": "PHONE_NUMBER",
"assetValue": "+919090909090",
"countryCode": "IND"
}
]
},
"consent": {
"applied": 2,
"rejected": []
}
}
}
Response parameters
| Name | Type | Description |
|---|---|---|
status | number | HTTP status code |
success | boolean | Indicates whether the request succeeded |
data.customer | BikPlatformCustomer | Customer record |
data.consent | ConsentResult | Result of the consent list. Present only when consent was sent. See the ConsentResult type here. |
CustomerConsent Type
| Name | Type | Required/Optional | Description |
|---|---|---|---|
channel | string | Required | One of whatsapp, email, sms, rcs, webpush |
status | string | Required | One of SUBSCRIBED, UNSUBSCRIBED, PENDING |
purpose | string | Optional | Why consent was collected, for example marketing. Up to 100 characters. |
evidenceRef | string | Optional | Your reference to the proof of consent, for example a form submission or CRM record ID. Up to 255 characters. |
consentedAt | string | Optional | When the customer gave or withdrew consent, as an ISO 8601 timestamp |
purpose and evidenceRef cannot start with =, +, - or @.
ConsentResult Type
| Name | Type | Description |
|---|---|---|
applied | number | Number of consent records updated. One entry can update several records when the customer has more than one contact on that channel. |
rejected | { index: number, reason: string }[] | Entries that were not applied. index is the entry's position in the consent list (starting at 0) and reason says why. |
Common reason values:
| Reason | What to do |
|---|---|
Customer has no contact on this channel | Send the matching phone number or email on the customer first. |
Customer has withdrawn consent on this channel; send SUBSCRIBED once they confirm | PENDING cannot replace a withdrawal. Send SUBSCRIBED after the customer confirms. |
BikPlatformAddress Type
| Name | Type | Required/Optional | Description |
|---|---|---|---|
partnerAddressId | string | Optional | External address ID |
addressId | string | Optional | BIK address ID |
address1 | string | Required | Primary address line |
address2 | string | Optional | Secondary address line |
city | string | Required | City |
country | string | Required | Country |
countryCode | string | Required | Country code |
state | string | Required | State or province |
stateCode | string | Optional | State or province code |
zip | string | Required | Postal / ZIP code |
latitude | number | Optional | Address latitude |
longitude | number | Optional | Address longitude |
timezone | string | Optional | Address timezone |
firstName | string | Optional | First name |
lastName | string | Optional | Last name |
phoneNumber | string | Optional | Phone number |
email | string | Optional | Email address |
isDefault | boolean | Optional | Whether this is the default address |
BikPlatformCustomer Type
| Name | Type | Description |
|---|---|---|
partnerCustomerId | string | External customer ID |
firstName | string | Customer first name |
lastName | string | Customer last name |
phoneNumber | string | Customer phone number |
email | string | Customer email address |
addresses | BikPlatformAddress[] | Customer addresses |
assets | BikPlatformCustomerAssets[] | Customer assets |
BikPlatformAddress Type
| Name | Type | Description |
|---|---|---|
partnerAddressId | string | External address ID |
addressId | string | BIK address ID |
address1 | string | Primary address line |
address2 | string | Secondary address line |
city | string | City |
country | string | Country |
countryCode | string | Country code |
state | string | State or province |
stateCode | string | State or province code |
zip | string | Postal / ZIP code |
latitude | number | Address latitude |
longitude | number | Address longitude |
timezone | string | Address timezone |
firstName | string | First name |
lastName | string | Last name |
phoneNumber | string | Phone number |
email | string | Email address |
isDefault | boolean | Whether this is the default address |
BikPlatformCustomerAssets Type
These represent the customer's secondary email addresses and phone numbers.
| Name | Type | Description |
|---|---|---|
id | string | Asset ID |
createdAt | string | Asset creation timestamp |
assetName | string | Asset type (PHONE_NUMBER or EMAIL) |
assetValue | string | Asset value (a valid phone number or email) |
countryCode | string | Country code |
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. If the message is Customer saved but consent could not be recorded; please retry, the customer was saved but the consent list was not; send the same request again. |
Error response example:
{
"status": 400,
"errors": [
{
"message": "'email' is required. 'phoneNumber' is required"
}
]
}