Allows you to update tags to multiple contacts at once, you can add or remove tags from the contacts
http
POST https://services.leadconnectorhq.com/contacts/bulk/tags/update/{type}Authorization
| 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. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
contacts | string[] | Yes | list of contact ids to be processed | |
tags | string[] | Yes | list of tags to be added or removed | |
locationId | string | Yes | asdrwHvLUxlfw5SqKVCN | account id from where the bulk request is executed |
removeAllTags | boolean | No | false | Option to implement remove all tags. if true, all tags will be removed from the contacts. Can only be used with remove type. |
Responses
201 - Successful response
succeded(boolean, required): Indicates if the operation was successful Example:TrueerrorCount(number, required): Number of errors encountered during the operation Example:0responses(string[], required): Responses for each contact processed
json
{
"succeded": true,
"errorCount": 0,
"responses": [
{
"contactId": "qFSqySFkVvNzOSqgGqFi",
"message": "Tags updated",
"type": "success",
"oldTags": [
"tag-1",
"tag-2"
],
"tagsAdded": [],
"tagsRemoved": []
},
{
"contactId": "abcdef",
"message": "contact id is not a valid firebase id",
"type": "error"
},
{
"contactId": "qFSqySFkVvNzOSqgGqFi",
"message": "contact is deleted",
"type": "error"
},
{
"contactId": "3ualbhnV7j3n3a9r2moD",
"message": "contact does not belong to account",
"type": "error"
}
]
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/contacts/bulk/tags/update/YOUR_type' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"contacts": [
"qFSqySFkVvNzOSqgGqFi",
"abcdef",
"qFSqySFkVvNzOSqgGqFi",
"3ualbhnV7j3n3a9r2moD"
],
"tags": [
"tag-1",
"tag-2"
],
"locationId": "asdrwHvLUxlfw5SqKVCN",
"removeAllTags": "false"
}'const response = await fetch('https://services.leadconnectorhq.com/contacts/bulk/tags/update/YOUR_type', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"contacts": ["qFSqySFkVvNzOSqgGqFi", "abcdef", "qFSqySFkVvNzOSqgGqFi", "3ualbhnV7j3n3a9r2moD"], "tags": ["tag-1", "tag-2"], "locationId": "asdrwHvLUxlfw5SqKVCN", "removeAllTags": "false"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/contacts/bulk/tags/update/YOUR_type',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"contacts": ["qFSqySFkVvNzOSqgGqFi", "abcdef", "qFSqySFkVvNzOSqgGqFi", "3ualbhnV7j3n3a9r2moD"], "tags": ["tag-1", "tag-2"], "locationId": "asdrwHvLUxlfw5SqKVCN", "removeAllTags": "false"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/contacts/bulk/tags/update/YOUR_type');
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({'contacts': ['qFSqySFkVvNzOSqgGqFi', 'abcdef', 'qFSqySFkVvNzOSqgGqFi', '3ualbhnV7j3n3a9r2moD'], 'tags': ['tag-1', 'tag-2'], 'locationId': 'asdrwHvLUxlfw5SqKVCN', 'removeAllTags': 'false'}),
]);
$data = json_decode(curl_exec($ch), true);