Skip to main content

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​

NameTypeRequired/OptionalDescription
consentsConsentUpdate[]Required1 to 10 consent changes. See the ConsentUpdate type here.

ConsentUpdate Type​

NameTypeRequired/OptionalDescription
bikCustomerIdstringOptionalBIK customer ID. Send this or partnerCustomerId, not both.
partnerCustomerIdstringOptionalExternal customer ID. Send this or bikCustomerId, not both.
channelstringRequiredOne of whatsapp, email, sms, rcs, webpush
statusstringRequiredOne of SUBSCRIBED, UNSUBSCRIBED, PENDING
contactstringOptionalA 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.
purposestringOptionalWhy consent was collected, for example marketing. Up to 100 characters.
evidenceRefstringOptionalYour reference to the proof of consent, for example a form submission or CRM record ID. Up to 255 characters.
consentedAtstringOptionalWhen the customer gave or withdrew consent, as an ISO 8601 timestamp
Note:

purpose and evidenceRef cannot start with =, +, - or @.

StatusMeaningReceives marketing?
SUBSCRIBEDThe customer has agreed to marketing on this channel.Yes
UNSUBSCRIBEDThe customer has withdrawn consent on this channel.No
PENDINGConsent is not confirmed yet, for example a double opt-in link not yet clicked.Yes

A few rules to keep in mind:

  • PENDING cannot replace a withdrawal. If the customer is UNSUBSCRIBED on the channel, a PENDING entry is rejected; send SUBSCRIBED once the customer confirms.
  • rcs and webpush consent apply to the customer's phone numbers. sms consent does not cover rcs; send both if both apply.
  • Customers you never sent consent for are treated as not subscribed and can still receive marketing.

Request Information​

CategoryValue
Http requestPOST
URLhttps://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​

NameTypeDescription
statusnumberHTTP status code
successbooleanIndicates whether the request succeeded
data.appliednumberNumber 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​

ReasonWhat to do
Customer not found or invalid partnerCustomerIdCheck the ID, or create the customer first with Create or update.
Invalid bikCustomerIdbikCustomerId must be the numeric BIK customer ID.
Customer not found in this storeThe customer belongs to a different store, or was deleted.
Customer has no contact on this channelAdd the matching phone number or email to the customer first.
Contact does not belong to this customer on this channelCheck contact, or leave it out to change every contact on the channel.
Customer has withdrawn consent on this channel; send SUBSCRIBED once they confirmPENDING cannot replace a withdrawal. Send SUBSCRIBED after the customer confirms.
Duplicate entry for this customer, channel and contact in this requestSend each customer, channel and contact only once per request.

Errors​

Error CodeMeaning
400Invalid 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.
401Unauthorized -- User is not authenticated.
404Not Found -- The specified API could not be found.
500Internal Server Error -- We had a problem with our server. Retry the same request.
502Bad 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]"
}
]
}