Create a new custom subtype for a account. Requires agency or account admin role.
http
POST https://services.leadconnectorhq.com/conversations/preferences/custom-subtypesAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | ve9EPM428h8vShlRW1KT | Account Id |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
name | string | Yes | Newsletter Subscription | Name of the custom subtype (max 100 characters) |
description | string | No | Weekly newsletter subscription preferences | Description of the custom subtype (max 100 characters) |
channel | string | Yes | email | Communication channel Possible values: 'email', 'sms' |
language | string | Yes | en | Language code |
Responses
200 - Successful response
201 - Response
400 - Bad Request
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"name": "Newsletter Subscription",
"description": "Weekly newsletter subscription preferences",
"channel": "email",
"language": "en"
}'const response = await fetch('https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name": "Newsletter Subscription", "description": "Weekly newsletter subscription preferences", "channel": "email", "language": "en"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"name": "Newsletter Subscription", "description": "Weekly newsletter subscription preferences", "channel": "email", "language": "en"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/conversations/preferences/custom-subtypes');
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({'name': 'Newsletter Subscription', 'description': 'Weekly newsletter subscription preferences', 'channel': 'email', 'language': 'en'}),
]);
$data = json_decode(curl_exec($ch), true);