AccountsBulk Consents

Create Bulk Consents

POST
/v1/Consents/Bulk

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Request Body

application/x-www-form-urlencoded

Items*array<unknown>

This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: contact_id, which must be a string representing phone number in E.164 format; correlation_id, a unique 32-character UUID used to uniquely map the request item with the response item; sender_id, which can be either a valid messaging service SID or a from phone number; status, a string representing the consent status. Can be one of [opt-in, opt-out]; source, a string indicating the medium through which the consent was collected. Can be one of [website, offline, opt-in-message, opt-out-message, others]; date_of_consent, an optional datetime string field in ISO-8601 format that captures the exact date and time when the user gave or revoked consent. If not provided, it will be empty.

Response Body

application/json

curl -X POST "https://example.com/v1/Consents/Bulk" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'Items=%7B%22contact_id%22%3A%22%2B19999999999%22%2C%22correlation_id%22%3A%22ad388b5a46b33b874b0d41f7226db2ef%22%2C%22sender_id%22%3A%22MG00000000000000000000000000000001%22%2C%22date_of_consent%22%3A%222025-02-28T10%3A05%3A27Z%22%2C%22status%22%3A%22opt-out%22%2C%22source%22%3A%22website%22%7D%2C%7B%22contact_id%22%3A%22%2B19%22%2C%22correlation_id%22%3A%2202520cfa6c432f0e3ec3a38c122d428d%22%2C%22sender_id%22%3A%22123456%22%2C%22date_of_consent%22%3A%222025-03-25%22%2C%22status%22%3A%22opt-in%22%2C%22source%22%3A%22opt-in-message%22%7D'
{  "items": [    {      "correlation_id": "ad388b5a46b33b874b0d41f7226db2ef",      "error_code": 0,      "error_messages": []    },    {      "correlation_id": "02520cfa6c432f0e3ec3a38c122d428d",      "error_code": 30646,      "error_messages": [        "INVALID_CONTACT_ID",        "INVALID_DATE_OF_CONSENT"      ]    }  ]}