Record contact consent

Records the contact's consent on one channel at one of its addresses and returns the contact.

PUT
/v1/contacts/{id}/identities/{identityId}/consent/{channel}

Records the contact's consent on one channel at one of its addresses and returns the contact. opted_out stops every send on that channel to that address until the contact opts back in; opted_in is what channels that require opt-in check for. source and capturedAt say where and when the contact decided; proof keeps your evidence. A decision captured before the recorded one is ignored. A change publishes contact.consent_changed.

x-api-key<token>

In: header

Path Parameters

id*string
Match^contact_[0-9a-hjkmnp-tv-z]{16,24}$
identityId*string
Match^cident_[0-9a-hjkmnp-tv-z]{16,24}$
channel*"email"

Value in

  • "email"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

status*string

Value in

  • "opted_in"
  • "opted_out"
source*string

Where the consent was captured, such as a form URL or a checkout step.

Length1 <= length <= 200
capturedAt*string
proof?|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/contacts/string/identities/string/consent/email" \  -H "Content-Type: application/json" \  -d '{    "status": "opted_in",    "source": "string",    "capturedAt": "string"  }'
{  "id": "string",  "name": "string",  "displayName": "string",  "avatar": "string",  "status": "active",  "statusReason": "string",  "externalId": "string",  "identities": [    {      "id": "string",      "type": "email",      "identifier": "string",      "verified": true,      "channels": [        {          "channel": "email",          "reachability": "unknown",          "consent": {            "status": "opted_in",            "source": "string",            "capturedAt": "string",            "proof": {              "property1": "string",              "property2": "string"            }          }        }      ]    }  ],  "profile": {    "firstName": "string",    "lastName": "string",    "company": "string",    "jobTitle": "string",    "location": {      "country": "string",      "state": "string",      "city": "string",      "timezone": "string"    },    "customFields": {      "property1": "string",      "property2": "string"    },    "source": "api"  },  "preferences": {    "preferredChannels": [      "email"    ],    "language": "string",    "timezone": "string",    "notifications": {      "email": true,      "quiet_hours": {        "start": "string",        "end": "string"      }    }  },  "tags": [    "string"  ],  "metadata": {    "property1": "string",    "property2": "string"  },  "createdAt": "string",  "updatedAt": "string"}

Related documentation