Update consent
Use the Update Consent API to record a customer's marketing consent, or a withdrawal of it, on a channel. Use it whenever consent changes in your system after the customer already exists in BIK, for example when a customer unsubscribes in your CRM or confirms a double opt-in.
A withdrawal (UNSUBSCRIBED) stops marketing messages to that customer on that channel from the next send. Each change is kept in the customer's consent history along with the purpose, evidenceRef and consentedAt you send.
info
Identify each customer with exactly one of bikCustomerId or partnerCustomerId. Send between 1 and 10 entries per request.
Request parameters
| Name | Type | Required/Optional | Description |
|---|---|---|---|
consents | ConsentUpdate[] | Required | 1 to 10 consent changes. See the ConsentUpdate type here. |
ConsentUpdate Type
| Name | Type | Required/Optional | Description |
|---|---|---|---|
bikCustomerId | string | Optional | BIK customer ID. Send this or partnerCustomerId, not both. |
partnerCustomerId | string | Optional | External customer ID. Send this or bikCustomerId, not both. |
channel | string | Required | One of whatsapp, email, sms, rcs, webpush |
status | string | Required | One of SUBSCRIBED, UNSUBSCRIBED, PENDING |
contact | string | Optional | A single phone number (E.164, for example +919090909090), email or WhatsApp ID of the customer. When sent, only this contact is changed. When left out, every contact the customer has on the channel is changed. Up to 100 characters. |
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 |
Note:
purpose and evidenceRef cannot start with =, +, - or @.
Consent statuses
| Status | Meaning | Receives marketing? |
|---|---|---|
SUBSCRIBED | The customer has agreed to marketing on this channel. | Yes |
UNSUBSCRIBED | The customer has withdrawn consent on this channel. | No |
PENDING | Consent is not confirmed yet, for example a double opt-in link not yet clicked. | Yes |
A few rules to keep in mind:
PENDINGcannot replace a withdrawal. If the customer isUNSUBSCRIBEDon the channel, aPENDINGentry is rejected; sendSUBSCRIBEDonce the customer confirms.rcsandwebpushconsent apply to the customer's phone numbers.smsconsent does not coverrcs; send both if both apply.- Customers you never sent consent for are treated as not subscribed and can still receive marketing.
Request Information
| Category | Value |
|---|---|
| Http request | POST |
| URL | https://bikapi.bikayi.app/integrations/bikPlatformFunctions-consent/update |
Sample request
curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-consent/update' \
--header 'Authorization: Basic AUTH_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"consents": [
{
"partnerCustomerId": "abcd-122345",
"channel": "email",
"status": "UNSUBSCRIBED",
"purpose": "marketing",
"evidenceRef": "crm-unsub-20931",
"consentedAt": "2026-11-13T10:00:00.000Z"
},
{
"bikCustomerId": "5482636",
"channel": "whatsapp",
"status": "SUBSCRIBED",
"contact": "+919090909090"
},
{
"partnerCustomerId": "unknown-999",
"channel": "sms",
"status": "UNSUBSCRIBED"
}
]
}'
JSON response example:
{
"status": 200,
"success": true,
"data": {
"applied": 2,
"rejected": [
{
"index": 2,
"reason": "Customer not found or invalid partnerCustomerId"
}
]
}
}
Response parameters
| Name | Type | Description |
|---|---|---|
status | number | HTTP status code |
success | boolean | Indicates whether the request succeeded |
data.applied | number | Number of consent records updated. One entry can update several records when the customer has more than one contact on that channel. |
data.rejected | { index: number, reason: string }[] | Entries that were not applied. index is the entry's position in consents (starting at 0) and reason says why. A rejected entry never stops the other entries from being applied. |
Rejection reasons
| Reason | What to do |
|---|---|
Customer not found or invalid partnerCustomerId | Check the ID, or create the customer first with Create or update. |
Invalid bikCustomerId | bikCustomerId must be the numeric BIK customer ID. |
Customer not found in this store | The customer belongs to a different store, or was deleted. |
Customer has no contact on this channel | Add the matching phone number or email to the customer first. |
Contact does not belong to this customer on this channel | Check contact, or leave it out to change every contact on the channel. |
Customer has withdrawn consent on this channel; send SUBSCRIBED once they confirm | PENDING cannot replace a withdrawal. Send SUBSCRIBED after the customer confirms. |
Duplicate entry for this customer, channel and contact in this request | Send each customer, channel and contact only once per request. |
Errors
| Error Code | Meaning |
|---|---|
| 400 | Invalid payload -- Your request is invalid, for example an unknown channel or status, both or neither of bikCustomerId and partnerCustomerId, or more than 10 entries. Nothing is applied. |
| 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. Retry the same request. |
| 502 | Bad Gateway -- A partnerCustomerId could not be looked up. Nothing is applied; retry the same request. |
Error response example:
{
"status": 400,
"errors": [
{
"message": "\"consents[0].status\" must be one of [SUBSCRIBED, UNSUBSCRIBED, PENDING]"
}
]
}