Change Asset Tags
curl --request POST \
--url https://api.us.lexful.app/v1/tags/assets/changes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-ID: <x-account-id>' \
--data '
{
"changes": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"remove": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expect": {
"has": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"lacks": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}
]
}
'import requests
url = "https://api.us.lexful.app/v1/tags/assets/changes"
payload = { "changes": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"remove": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"expect": {
"has": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"lacks": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
}
] }
headers = {
"X-Account-ID": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Account-ID': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
changes: [
{
asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
add: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
remove: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
expect: {
has: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
lacks: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
}
]
})
};
fetch('https://api.us.lexful.app/v1/tags/assets/changes', 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://api.us.lexful.app/v1/tags/assets/changes",
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([
'changes' => [
[
'asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'add' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'remove' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'expect' => [
'has' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'lacks' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-ID: <x-account-id>"
],
]);
$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.us.lexful.app/v1/tags/assets/changes"
payload := strings.NewReader("{\n \"changes\": [\n {\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"remove\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expect\": {\n \"has\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"lacks\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Account-ID", "<x-account-id>")
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://api.us.lexful.app/v1/tags/assets/changes")
.header("X-Account-ID", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"changes\": [\n {\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"remove\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expect\": {\n \"has\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"lacks\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/tags/assets/changes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Account-ID"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"changes\": [\n {\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"remove\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expect\": {\n \"has\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"lacks\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changes": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"added": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"removed": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}Tags
Change Asset Tags
Atomically add and remove tags on up to 100 assets. Optional per-asset expect preconditions fail the whole batch with 409 when memberships have changed.
POST
/
v1
/
tags
/
assets
/
changes
Change Asset Tags
curl --request POST \
--url https://api.us.lexful.app/v1/tags/assets/changes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-ID: <x-account-id>' \
--data '
{
"changes": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"remove": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expect": {
"has": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"lacks": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}
]
}
'import requests
url = "https://api.us.lexful.app/v1/tags/assets/changes"
payload = { "changes": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"add": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"remove": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"expect": {
"has": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"lacks": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
}
] }
headers = {
"X-Account-ID": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Account-ID': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
changes: [
{
asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
add: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
remove: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
expect: {
has: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
lacks: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
}
]
})
};
fetch('https://api.us.lexful.app/v1/tags/assets/changes', 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://api.us.lexful.app/v1/tags/assets/changes",
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([
'changes' => [
[
'asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'add' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'remove' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'expect' => [
'has' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'lacks' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-ID: <x-account-id>"
],
]);
$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.us.lexful.app/v1/tags/assets/changes"
payload := strings.NewReader("{\n \"changes\": [\n {\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"remove\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expect\": {\n \"has\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"lacks\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Account-ID", "<x-account-id>")
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://api.us.lexful.app/v1/tags/assets/changes")
.header("X-Account-ID", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"changes\": [\n {\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"remove\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expect\": {\n \"has\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"lacks\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/tags/assets/changes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Account-ID"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"changes\": [\n {\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"add\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"remove\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"expect\": {\n \"has\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"lacks\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"operation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changes": [
{
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"added": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"removed": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}Authorizations
Bearer token
Headers
Account ID
Body
application/json
Was this page helpful?