Consents

Manage Conversation API consents in batches.

Insert consent records

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.

SecurityBearerAuth
Request
path Parameters
project_id
required
string

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

Request Body schema: application/json
required
app_id
required
string

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

required
Array of objects

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.

Responses
200

OK

Response Schema: application/json
batch_id
string

The unique ID for the batch of consent records created.

401

Invalid credentials

403

Permission denied. The specified project may not be allowed to use the batch endpoint.

500

Internal error

post/v1/projects/{project_id}/consents
Request samples
application/json
{
  • "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"
      }
    ]
}
Response samples
application/json
{
  • "batch_id": "string"
}