Skip to content

Consents

Manage Conversation API consents in batches.

Insert consent records

Request

Insert consent records for multiple identifications in a single request. If the request fails, none or only some of the records may be inserted. Retry the batch later to try again.

Security
BearerAuth
Path
project_idstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

Bodyapplication/jsonrequired
app_idstringrequired

The ID of the Conversation API app under which the consent records are to be stored.

consent_recordsArray of objectsrequired

A list of consent records to create. Each record must include an identification field, which uniquely identifies the subject (e.g., phone number or contact ID), and a consent_type.

curl -i -X POST \
  'https://us.conversationbatch.api.sinch.com/v1/projects/{project_id}/consents' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "app_id": "{{APP_ID}}",
    "consent_records": [
      {
        "identification": "{{PHONE_NUMBER_1}}",
        "consent_type": "OPT_OUT_ALL"
      },
      {
        "identification": "{{PHONE_NUMBER_2}}",
        "consent_type": "OPT_OUT_MARKETING"
      },
      {
        "identification": "{{PHONE_NUMBER_3}}",
        "consent_type": "OPT_OUT_NOTIFICATION"
      }
    ]
  }'

Responses

OK

Bodyapplication/json
batch_idstring

The unique ID for the batch of consent records created.

Response
{ "batch_id": "string" }
We'd love to hear from you!
Rate this content: