Attach or detach tags from vault accounts
Attach or detach one or more tags from the requested vault accounts. Endpoint Permission: For protected tags: Owner, Admin, Non-Signing Admin. For non protected tags: Owner, Admin, Non-Signing Admin, Signer, Editor, Approver.
POST
/
vault
/
accounts
/
attached_tags
TypeScript
const response: Promise<FireblocksResponse<VaultAccountsTagAttachmentOperationsResponse>> = fireblocks.vaults.attachOrDetachTagsFromVaultAccounts(vaultsApiAttachOrDetachTagsFromVaultAccountsRequest);CompletableFuture<ApiResponse<VaultAccountsTagAttachmentOperationsResponse>> response = fireblocks.vaults().attachOrDetachTagsFromVaultAccounts(vaultAccountsTagAttachmentOperationsRequest, idempotencyKey);response = fireblocks.vaults.attach_or_detach_tags_from_vault_accounts(vault_accounts_tag_attachment_operations_request, idempotency_key);curl --request POST \
--url https://api.fireblocks.io/v1/vault/accounts/attached_tags \
--header 'Content-Type: application/json' \
--data '
{
"vaultAccountIds": [
"0",
"1"
],
"tagIdsToAttach": [
"df4c0987-30da-4976-8dcf-bc2dd41ae331",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
],
"tagIdsToDetach": [
"df4c0987-30da-4976-8dcf-bc2dd41ae331",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
vaultAccountIds: ['0', '1'],
tagIdsToAttach: ['df4c0987-30da-4976-8dcf-bc2dd41ae331', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'],
tagIdsToDetach: ['df4c0987-30da-4976-8dcf-bc2dd41ae331', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890']
})
};
fetch('https://api.fireblocks.io/v1/vault/accounts/attached_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://api.fireblocks.io/v1/vault/accounts/attached_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([
'vaultAccountIds' => [
'0',
'1'
],
'tagIdsToAttach' => [
'df4c0987-30da-4976-8dcf-bc2dd41ae331',
'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
],
'tagIdsToDetach' => [
'df4c0987-30da-4976-8dcf-bc2dd41ae331',
'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
]
]),
CURLOPT_HTTPHEADER => [
"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.fireblocks.io/v1/vault/accounts/attached_tags"
payload := strings.NewReader("{\n \"vaultAccountIds\": [\n \"0\",\n \"1\"\n ],\n \"tagIdsToAttach\": [\n \"df4c0987-30da-4976-8dcf-bc2dd41ae331\",\n \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n ],\n \"tagIdsToDetach\": [\n \"df4c0987-30da-4976-8dcf-bc2dd41ae331\",\n \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/vault/accounts/attached_tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"vaultAccountIds\": [\n \"0\",\n \"1\"\n ],\n \"tagIdsToAttach\": [\n \"df4c0987-30da-4976-8dcf-bc2dd41ae331\",\n \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n ],\n \"tagIdsToDetach\": [\n \"df4c0987-30da-4976-8dcf-bc2dd41ae331\",\n \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"appliedOperations": [
{
"vaultAccountId": "1",
"tagId": "f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"
}
],
"pendingOperations": [
{
"vaultAccountId": "1",
"tagId": "f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
"approvalRequestId": "12345"
}
],
"rejectedOperations": [
{
"vaultAccountId": "1",
"tagId": "f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"
}
]
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}Headers
A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours.
Body
application/json
The IDs of the vault accounts to attach tags to
Required array length:
1 - 100 elementsExample:
["0", "1"]
The IDs of the tags to attach
Required array length:
1 - 20 elementsExample:
[
"df4c0987-30da-4976-8dcf-bc2dd41ae331",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]
The IDs of the tags to detach
Required array length:
1 - 20 elementsExample:
[
"df4c0987-30da-4976-8dcf-bc2dd41ae331",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]
Was this page helpful?
⌘I
TypeScript
const response: Promise<FireblocksResponse<VaultAccountsTagAttachmentOperationsResponse>> = fireblocks.vaults.attachOrDetachTagsFromVaultAccounts(vaultsApiAttachOrDetachTagsFromVaultAccountsRequest);CompletableFuture<ApiResponse<VaultAccountsTagAttachmentOperationsResponse>> response = fireblocks.vaults().attachOrDetachTagsFromVaultAccounts(vaultAccountsTagAttachmentOperationsRequest, idempotencyKey);response = fireblocks.vaults.attach_or_detach_tags_from_vault_accounts(vault_accounts_tag_attachment_operations_request, idempotency_key);curl --request POST \
--url https://api.fireblocks.io/v1/vault/accounts/attached_tags \
--header 'Content-Type: application/json' \
--data '
{
"vaultAccountIds": [
"0",
"1"
],
"tagIdsToAttach": [
"df4c0987-30da-4976-8dcf-bc2dd41ae331",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
],
"tagIdsToDetach": [
"df4c0987-30da-4976-8dcf-bc2dd41ae331",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
]
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
vaultAccountIds: ['0', '1'],
tagIdsToAttach: ['df4c0987-30da-4976-8dcf-bc2dd41ae331', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'],
tagIdsToDetach: ['df4c0987-30da-4976-8dcf-bc2dd41ae331', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890']
})
};
fetch('https://api.fireblocks.io/v1/vault/accounts/attached_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://api.fireblocks.io/v1/vault/accounts/attached_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([
'vaultAccountIds' => [
'0',
'1'
],
'tagIdsToAttach' => [
'df4c0987-30da-4976-8dcf-bc2dd41ae331',
'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
],
'tagIdsToDetach' => [
'df4c0987-30da-4976-8dcf-bc2dd41ae331',
'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
]
]),
CURLOPT_HTTPHEADER => [
"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.fireblocks.io/v1/vault/accounts/attached_tags"
payload := strings.NewReader("{\n \"vaultAccountIds\": [\n \"0\",\n \"1\"\n ],\n \"tagIdsToAttach\": [\n \"df4c0987-30da-4976-8dcf-bc2dd41ae331\",\n \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n ],\n \"tagIdsToDetach\": [\n \"df4c0987-30da-4976-8dcf-bc2dd41ae331\",\n \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/vault/accounts/attached_tags")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"vaultAccountIds\": [\n \"0\",\n \"1\"\n ],\n \"tagIdsToAttach\": [\n \"df4c0987-30da-4976-8dcf-bc2dd41ae331\",\n \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n ],\n \"tagIdsToDetach\": [\n \"df4c0987-30da-4976-8dcf-bc2dd41ae331\",\n \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"appliedOperations": [
{
"vaultAccountId": "1",
"tagId": "f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"
}
],
"pendingOperations": [
{
"vaultAccountId": "1",
"tagId": "f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
"approvalRequestId": "12345"
}
],
"rejectedOperations": [
{
"vaultAccountId": "1",
"tagId": "f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11"
}
]
}{
"message": "<string>",
"code": 123
}{
"message": "<string>",
"code": 123
}