curl --request POST \
--url https://api.instantly.ai/api/v2/custom-tags/toggle-resource \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tag_ids": [
"01a082d0-83b9-7aa0-8eff-13f0a9f7f181"
],
"resource_type": 1,
"assign": true
}
'import requests
url = "https://api.instantly.ai/api/v2/custom-tags/toggle-resource"
payload = {
"tag_ids": ["01a082d0-83b9-7aa0-8eff-13f0a9f7f181"],
"resource_type": 1,
"assign": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tag_ids: ['01a082d0-83b9-7aa0-8eff-13f0a9f7f181'],
resource_type: 1,
assign: true
})
};
fetch('https://api.instantly.ai/api/v2/custom-tags/toggle-resource', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/custom-tags/toggle-resource")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tag_ids\": [\n \"01a082d0-83b9-7aa0-8eff-13f0a9f7f181\"\n ],\n \"resource_type\": 1,\n \"assign\": true\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/custom-tags/toggle-resource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tag_ids' => [
'01a082d0-83b9-7aa0-8eff-13f0a9f7f181'
],
'resource_type' => 1,
'assign' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.instantly.ai/api/v2/custom-tags/toggle-resource"
payload := strings.NewReader("{\n \"tag_ids\": [\n \"01a082d0-83b9-7aa0-8eff-13f0a9f7f181\"\n ],\n \"resource_type\": 1,\n \"assign\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}Assign or unassign tags to resources
This can be used for both accounts and campaigns. Please check the resource_type field for more information.
curl --request POST \
--url https://api.instantly.ai/api/v2/custom-tags/toggle-resource \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tag_ids": [
"01a082d0-83b9-7aa0-8eff-13f0a9f7f181"
],
"resource_type": 1,
"assign": true
}
'import requests
url = "https://api.instantly.ai/api/v2/custom-tags/toggle-resource"
payload = {
"tag_ids": ["01a082d0-83b9-7aa0-8eff-13f0a9f7f181"],
"resource_type": 1,
"assign": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tag_ids: ['01a082d0-83b9-7aa0-8eff-13f0a9f7f181'],
resource_type: 1,
assign: true
})
};
fetch('https://api.instantly.ai/api/v2/custom-tags/toggle-resource', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/custom-tags/toggle-resource")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tag_ids\": [\n \"01a082d0-83b9-7aa0-8eff-13f0a9f7f181\"\n ],\n \"resource_type\": 1,\n \"assign\": true\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/custom-tags/toggle-resource",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tag_ids' => [
'01a082d0-83b9-7aa0-8eff-13f0a9f7f181'
],
'resource_type' => 1,
'assign' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.instantly.ai/api/v2/custom-tags/toggle-resource"
payload := strings.NewReader("{\n \"tag_ids\": [\n \"01a082d0-83b9-7aa0-8eff-13f0a9f7f181\"\n ],\n \"resource_type\": 1,\n \"assign\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"success": true
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The list of tag ids to assign or unassign
1The resource type to assign or unassign the tags to
1, 2, 3 1
Whether to assign the tags to the resources.
true
The list of resource ids to assign or unassign. A resource id is the id of an account or a campaign. Required unless selected_all is true.
1Optional list of resource ids to exclude when selected_all is true.
1Whether to select all resources.
false
Optional selected-all filter. Accepts the existing account-status string shape and the merged object shape for account status, tag, any-tag, all-tags, and search criteria.
ACC_FILTER_PAUSED, ACC_FILTER_ERROR, ACC_FILTER_NO_CTD, ACC_FILTER_PW_ACCOUNTS, ACC_FILTER_DFY, ACC_FILTER_DFY_SETUP_PENDING, ACC_FILTER_W_ACTIVE, ACC_FILTER_W_PAUSED, ACC_FILTER_W_ERROR, null "ACC_FILTER_PAUSED"
Optional selected-all search query. If omitted, filter.search is used when present.
"jon@doe.com"
Response
Default Response
true