Skip to main content
Process subscription change initiated by a user (admin/agent). Supports individual custom subscription changes and resub all functionality. Legal forms are automatically created for user-initiated resubscribe actions on custom subscriptions.
POST https://services.leadconnectorhq.com/conversations/preferences/unsubscriptions/user-change

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Body

locationId
string
default:"ve9EPM428h8vShlRW1KT"
required
Account Id
contactId
string
default:"OP7z4LCyPACyH5fcEIZa"
required
Contact Id
email
string
default:"user@example.com"
required
Email address
subscription_action
object
required
Subscription action details
Legal reason for the change (required only for resubscribe and resub_all actions)
Legal description/details

Respuestas

{}
{}

Ejemplo

curl -X POST 'https://services.leadconnectorhq.com/conversations/preferences/unsubscriptions/user-change' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "locationId": "ve9EPM428h8vShlRW1KT",
  "contactId": "OP7z4LCyPACyH5fcEIZa",
  "email": "user@example.com",
  "legal_reason": "User requested resubscribe via customer service",
  "legal_description": "Customer called support on 2024-01-15 requesting to be removed from newsletter"
}'
const response = await fetch('https://services.leadconnectorhq.com/conversations/preferences/unsubscriptions/user-change', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"locationId": "ve9EPM428h8vShlRW1KT", "contactId": "OP7z4LCyPACyH5fcEIZa", "email": "user@example.com", "legal_reason": "User requested resubscribe via customer service", "legal_description": "Customer called support on 2024-01-15 requesting to be removed from newsletter"}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'POST',
    'https://services.leadconnectorhq.com/conversations/preferences/unsubscriptions/user-change',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"locationId": "ve9EPM428h8vShlRW1KT", "contactId": "OP7z4LCyPACyH5fcEIZa", "email": "user@example.com", "legal_reason": "User requested resubscribe via customer service", "legal_description": "Customer called support on 2024-01-15 requesting to be removed from newsletter"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/conversations/preferences/unsubscriptions/user-change');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'locationId': 've9EPM428h8vShlRW1KT', 'contactId': 'OP7z4LCyPACyH5fcEIZa', 'email': 'user@example.com', 'legal_reason': 'User requested resubscribe via customer service', 'legal_description': 'Customer called support on 2024-01-15 requesting to be removed from newsletter'}),
]);
$data = json_decode(curl_exec($ch), true);