Virtual tags
List virtual tag keys
Every tag key the tenant has, with the description an agent regenerates its rules from, how many rules sit under it, and who last touched it. updated_by_kind says whether that was a person or an agent. created_by_user and updated_by_user carry the tenant member behind created_by and updated_by; they are absent when an agent made the change, and also when the id no longer belongs to a member of this tenant.
GET
/
api
/
v1
/
tenant
/
virtual-tag-keys
List virtual tag keys
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys', 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.costgraph.ai/api/v1/tenant/virtual-tag-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-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"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": [
{
"compiled_at": "<string>",
"created_at": "<string>",
"created_by": "<string>",
"created_by_user": {
"active": true,
"email": "<string>",
"id": "<string>",
"name": "<string>",
"role": "<string>"
},
"description": "<string>",
"exported": true,
"exported_to": "<string>",
"id": "<string>",
"key": "<string>",
"last_proposed_at": "<string>",
"proposal_fingerprint": "<string>",
"rule_count": 123,
"rules_revision": 123,
"tenant_id": "<string>",
"updated_at": "<string>",
"updated_by": "<string>",
"updated_by_kind": "<string>",
"updated_by_user": {
"active": true,
"email": "<string>",
"id": "<string>",
"name": "<string>",
"role": "<string>"
}
}
]
}{
"message": "some message",
"status": "error"
}Was this page helpful?
⌘I
List virtual tag keys
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys', 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.costgraph.ai/api/v1/tenant/virtual-tag-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-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"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/virtual-tag-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": [
{
"compiled_at": "<string>",
"created_at": "<string>",
"created_by": "<string>",
"created_by_user": {
"active": true,
"email": "<string>",
"id": "<string>",
"name": "<string>",
"role": "<string>"
},
"description": "<string>",
"exported": true,
"exported_to": "<string>",
"id": "<string>",
"key": "<string>",
"last_proposed_at": "<string>",
"proposal_fingerprint": "<string>",
"rule_count": 123,
"rules_revision": 123,
"tenant_id": "<string>",
"updated_at": "<string>",
"updated_by": "<string>",
"updated_by_kind": "<string>",
"updated_by_user": {
"active": true,
"email": "<string>",
"id": "<string>",
"name": "<string>",
"role": "<string>"
}
}
]
}{
"message": "some message",
"status": "error"
}