Tag Value Update API
curl --request PATCH \
--url https://api.pazy.io/v1.0/tag/:tagId/valueimport requests
url = "https://api.pazy.io/v1.0/tag/:tagId/value"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.pazy.io/v1.0/tag/:tagId/value', 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.pazy.io/v1.0/tag/:tagId/value",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/tag/:tagId/value"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.pazy.io/v1.0/tag/:tagId/value")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/tag/:tagId/value")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyTags APIs
Tag Value Update API
Enable or disable one or more values of an existing dropdown tag
Tag Value Update API
curl --request PATCH \
--url https://api.pazy.io/v1.0/tag/:tagId/valueimport requests
url = "https://api.pazy.io/v1.0/tag/:tagId/value"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.pazy.io/v1.0/tag/:tagId/value', 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.pazy.io/v1.0/tag/:tagId/value",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.pazy.io/v1.0/tag/:tagId/value"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.pazy.io/v1.0/tag/:tagId/value")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pazy.io/v1.0/tag/:tagId/value")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyAuthentication
All requests require an API key in the request headers. Headers:Authorization: Api-Key YOUR_API_KEY
Content-Type: application/json
Request
Content-Type:application/json
This endpoint updates the state of one or more values of an existing dropdown tag. Use the tag’s slug (from the Tag List API) as the tagId path parameter, and the value ids (from the Tag Detail API or Tag Value Creation API) in the body.
Every id in the payload must belong to the tag identified by tagId — if any id does not, the entire request is rejected and no value is updated.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tagId | string | Yes | Slug identifier of the dropdown tag whose values are being updated (1–64 characters) |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tags | array | Yes | Tag values to update. Min 1, Max 100 items. |
tags[].id | integer | Yes | Id of the tag value to update (minimum 1). Obtain this from the Tag Detail API. |
tags[].state | string | Yes | The state to set on the tag value. Allowed values: ENABLED, DISABLED. |
Tag Value State Values
| Value | Description |
|---|---|
ENABLED | The value is active and can be selected on new transactions |
DISABLED | The value is retired and can no longer be selected on new transactions |
When a value is disabled, Pazy checks whether it is still in use on any open transaction (invoices, reimbursements, expenses, purchase orders, and similar). If it is in use, the value is kept as
DEPRECATED so existing records stay intact. If it is not in use anywhere, the value is fully retired to DISABLED and is also cleared from any vendor it was mapped to as a default. Either way the request succeeds — the state reported by the Tag Detail API afterwards reflects the outcome.Code Examples
curl -X PATCH https://api.pazy.io/v1.0/tag/cost-centre/value \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tags": [
{ "id": 1024, "state": "DISABLED" },
{ "id": 1025, "state": "ENABLED" }
]
}'
const response = await fetch('https://api.pazy.io/v1.0/tag/cost-centre/value', {
method: 'PATCH',
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
tags: [
{ id: 1024, state: 'DISABLED' },
{ id: 1025, state: 'ENABLED' }
]
})
});
const result = await response.json();
import requests
url = "https://api.pazy.io/v1.0/tag/cost-centre/value"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"tags": [
{ "id": 1024, "state": "DISABLED" },
{ "id": 1025, "state": "ENABLED" }
]
}
response = requests.patch(url, headers=headers, json=payload)
result = response.json()
Success Response
HTTP Status:200 OK
Response Fields:
| Field | Type | Description |
|---|---|---|
ok | boolean | Indicates whether the request was successful |
updated | boolean | Indicates whether the tag values were updated |
Response Example
{
"ok": true,
"updated": true
}
Error Responses
Tag Is Not a Dropdown
Returned when the target tag is not a dropdown tag (only dropdown tag values can be updated). HTTP Status:400 Bad Request
{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Tag should be dropdown"
}
}
Tag Value Does Not Belong to the Tag
Returned when one or more ids in the payload do not exist under the tag given in the path. No value is updated in this case. The same error is returned when the tag slug itself does not exist. HTTP Status:400 Bad Request
{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Tag value id 2048, 2049 does not belong to the tag cost-centre"
}
}
Validation Error
Returned when the requiredtags array is missing, empty, contains more than 100 items, or an item has an unsupported state.
HTTP Status: 400 Bad Request
{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed: /body: must have required property 'tags'"
}
}
{
"ok": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed: /body/tags/0/state: must be equal to one of the allowed values"
}
}
Access Denied
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "ACCESS_DENIED",
"message": "Access denied: Only admin and bookkeeper can update this resources"
}
}
Authentication Errors
HTTP Status:401 Unauthorized
{
"ok": false,
"error": {
"code": "MISSING_CREDENTIALS",
"message": "Missing Credentials"
}
}
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API Key"
}
}
Permission Errors
HTTP Status:403 Forbidden
{
"ok": false,
"error": {
"code": "INSUFFICIENT_PERMISSIONS",
"message": "Permission check failed - PERMISSION_CHECK_FAILED"
}
}
Tag Value Update Failed
In the rare case the values could not be persisted, the response is returned with an HTTP200 OK status, ok: false, and updated: false.
HTTP Status: 200 OK
{
"ok": false,
"updated": false
}
Best Practices
- Only
DROPDOWNtag values can be updated — use the Tag List API to confirm the tag’sdataTypebefore calling - Fetch the value ids with the Tag Detail API; passing an id that belongs to a different tag rejects the whole request
- Batch related changes into a single call — up to 100 values can be updated at once
- Always check the
updatedflag in addition to the HTTP status; a failure is returned withok: falseandupdated: falseunder a200 OKstatus - Disabling a value does not alter transactions that already carry it — it only stops the value from being selected going forward
- Access is limited to users with tag update permission and an admin or bookkeeper role
Was this page helpful?