Add tags to a partner
curl --request POST \
--url https://platform.tolt.com/v2/partners/{id}/tags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tag_ids": [
"ptag_zDEcdqNuNBPcokarWxBnk9gB"
]
}
'import requests
url = "https://platform.tolt.com/v2/partners/{id}/tags"
payload = { "tag_ids": ["ptag_zDEcdqNuNBPcokarWxBnk9gB"] }
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: ['ptag_zDEcdqNuNBPcokarWxBnk9gB']})
};
fetch('https://platform.tolt.com/v2/partners/{id}/tags', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.tolt.com/v2/partners/{id}/tags",
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' => [
'ptag_zDEcdqNuNBPcokarWxBnk9gB'
]
]),
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://platform.tolt.com/v2/partners/{id}/tags"
payload := strings.NewReader("{\n \"tag_ids\": [\n \"ptag_zDEcdqNuNBPcokarWxBnk9gB\"\n ]\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))
}HttpResponse<String> response = Unirest.post("https://platform.tolt.com/v2/partners/{id}/tags")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tag_ids\": [\n \"ptag_zDEcdqNuNBPcokarWxBnk9gB\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.tolt.com/v2/partners/{id}/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tag_ids\": [\n \"ptag_zDEcdqNuNBPcokarWxBnk9gB\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Successfully added partner tags",
"data": [
{
"id": "ptag_zDEcdqNuNBPcokarWxBnk9gB",
"name": "VIP",
"color": "#2457D6"
}
]
}{
"success": false,
"message": "No tag in the partner's program with id ptag_9fQ2xLLmN3kP8dRvT1wYbHcS",
"code": "invalid_reference",
"doc_url": "https://docs.tolt.com/errors#invalid_reference",
"errors": [
{
"field": "tag_ids",
"message": "No tag in the partner's program with id ptag_9fQ2xLLmN3kP8dRvT1wYbHcS"
}
]
}{
"success": false,
"message": "Unauthorized",
"code": "unauthorized",
"doc_url": "https://docs.tolt.com/errors#unauthorized"
}{
"success": false,
"message": "Partner not found",
"code": "not_found",
"doc_url": "https://docs.tolt.com/errors#not_found"
}{
"success": false,
"message": "Request body exceeds 1 MB",
"code": "payload_too_large",
"doc_url": "https://docs.tolt.com/errors#payload_too_large"
}{
"success": false,
"message": "Too many requests. Retry after the window resets.",
"code": "rate_limited",
"doc_url": "https://docs.tolt.com/errors#rate_limited"
}Partners
Add tags to a partner
Puts one or more tags on the partner. Each tag must belong to the partner’s program; tags the partner already has stay as they are. Returns every tag the partner now has, and sends partner.updated if any tag was added.
POST
/
v2
/
partners
/
{id}
/
tags
Add tags to a partner
curl --request POST \
--url https://platform.tolt.com/v2/partners/{id}/tags \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tag_ids": [
"ptag_zDEcdqNuNBPcokarWxBnk9gB"
]
}
'import requests
url = "https://platform.tolt.com/v2/partners/{id}/tags"
payload = { "tag_ids": ["ptag_zDEcdqNuNBPcokarWxBnk9gB"] }
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: ['ptag_zDEcdqNuNBPcokarWxBnk9gB']})
};
fetch('https://platform.tolt.com/v2/partners/{id}/tags', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://platform.tolt.com/v2/partners/{id}/tags",
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' => [
'ptag_zDEcdqNuNBPcokarWxBnk9gB'
]
]),
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://platform.tolt.com/v2/partners/{id}/tags"
payload := strings.NewReader("{\n \"tag_ids\": [\n \"ptag_zDEcdqNuNBPcokarWxBnk9gB\"\n ]\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))
}HttpResponse<String> response = Unirest.post("https://platform.tolt.com/v2/partners/{id}/tags")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tag_ids\": [\n \"ptag_zDEcdqNuNBPcokarWxBnk9gB\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.tolt.com/v2/partners/{id}/tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tag_ids\": [\n \"ptag_zDEcdqNuNBPcokarWxBnk9gB\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Successfully added partner tags",
"data": [
{
"id": "ptag_zDEcdqNuNBPcokarWxBnk9gB",
"name": "VIP",
"color": "#2457D6"
}
]
}{
"success": false,
"message": "No tag in the partner's program with id ptag_9fQ2xLLmN3kP8dRvT1wYbHcS",
"code": "invalid_reference",
"doc_url": "https://docs.tolt.com/errors#invalid_reference",
"errors": [
{
"field": "tag_ids",
"message": "No tag in the partner's program with id ptag_9fQ2xLLmN3kP8dRvT1wYbHcS"
}
]
}{
"success": false,
"message": "Unauthorized",
"code": "unauthorized",
"doc_url": "https://docs.tolt.com/errors#unauthorized"
}{
"success": false,
"message": "Partner not found",
"code": "not_found",
"doc_url": "https://docs.tolt.com/errors#not_found"
}{
"success": false,
"message": "Request body exceeds 1 MB",
"code": "payload_too_large",
"doc_url": "https://docs.tolt.com/errors#payload_too_large"
}{
"success": false,
"message": "Too many requests. Retry after the window resets.",
"code": "rate_limited",
"doc_url": "https://docs.tolt.com/errors#rate_limited"
}Authorizations
Tolt API key sent as a bearer token.
Path Parameters
Example:
"part_NLYzgNKuSuASvrvoxNtau6SY"
Body
application/json
Ids of the tags to add (ptag_...), as returned when listing partner tags. Each must belong to the partner's program. Tags the partner already has stay as they are.
Required array length:
1 - 100 elementsMinimum string length:
1
