Search and filter Policy Components
curl --request POST \
--url https://api.draftt.io/v1/policy/{policyId}/component/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pageSize": 20,
"filter": {
"activeExtendedSupport": true,
"extendedSupportAnnualCost": {
"$gte": 1000
}
},
"componentData": {
"select": [
"tags"
]
},
"sort": {
"urgency": "desc"
},
"pageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19",
"calculateDisplayNames": true
}
'import requests
url = "https://api.draftt.io/v1/policy/{policyId}/component/query"
payload = {
"pageSize": 20,
"filter": {
"activeExtendedSupport": True,
"extendedSupportAnnualCost": { "$gte": 1000 }
},
"componentData": { "select": ["tags"] },
"sort": { "urgency": "desc" },
"pageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19",
"calculateDisplayNames": True
}
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({
pageSize: 20,
filter: {activeExtendedSupport: true, extendedSupportAnnualCost: {$gte: 1000}},
componentData: {select: ['tags']},
sort: {urgency: 'desc'},
pageToken: 'eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19',
calculateDisplayNames: true
})
};
fetch('https://api.draftt.io/v1/policy/{policyId}/component/query', 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.draftt.io/v1/policy/{policyId}/component/query",
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([
'pageSize' => 20,
'filter' => [
'activeExtendedSupport' => true,
'extendedSupportAnnualCost' => [
'$gte' => 1000
]
],
'componentData' => [
'select' => [
'tags'
]
],
'sort' => [
'urgency' => 'desc'
],
'pageToken' => 'eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19',
'calculateDisplayNames' => true
]),
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://api.draftt.io/v1/policy/{policyId}/component/query"
payload := strings.NewReader("{\n \"pageSize\": 20,\n \"filter\": {\n \"activeExtendedSupport\": true,\n \"extendedSupportAnnualCost\": {\n \"$gte\": 1000\n }\n },\n \"componentData\": {\n \"select\": [\n \"tags\"\n ]\n },\n \"sort\": {\n \"urgency\": \"desc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19\",\n \"calculateDisplayNames\": true\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://api.draftt.io/v1/policy/{policyId}/component/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pageSize\": 20,\n \"filter\": {\n \"activeExtendedSupport\": true,\n \"extendedSupportAnnualCost\": {\n \"$gte\": 1000\n }\n },\n \"componentData\": {\n \"select\": [\n \"tags\"\n ]\n },\n \"sort\": {\n \"urgency\": \"desc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19\",\n \"calculateDisplayNames\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.draftt.io/v1/policy/{policyId}/component/query")
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 \"pageSize\": 20,\n \"filter\": {\n \"activeExtendedSupport\": true,\n \"extendedSupportAnnualCost\": {\n \"$gte\": 1000\n }\n },\n \"componentData\": {\n \"select\": [\n \"tags\"\n ]\n },\n \"sort\": {\n \"urgency\": \"desc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19\",\n \"calculateDisplayNames\": true\n}"
response = http.request(request)
puts response.read_body{
"nextPageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19",
"items": [
{
"id": "456654",
"technology": "eks",
"name": "staging-cluster-us-east-1",
"urgency": 62,
"effort": 0,
"priority": 0,
"status": "Outdated",
"policyId": "1",
"componentId": "12321",
"orgComplexity": 0,
"isCompliant": false,
"currentVersion": "1.29",
"desiredVersion": "1.30",
"dueDate": "2025-03-23T00:00:00.000Z",
"createdAt": "2025-03-26T17:02:41.237Z",
"updatedAt": "2025-04-07T02:47:31.606Z",
"deletedAt": null,
"recommendedVersion": "1.32",
"extendedSupportAnnualCost": 4380,
"impendingDate": "2025-03-23T00:00:00.000Z",
"outdatedDate": "2026-03-23T00:00:00.000Z",
"activeExtendedSupport": true,
"tags": {
"environment": "staging",
"Terraform": "true"
},
"displayName": "Amazon EKS"
},
"..."
]
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Policy Component
Search and filter Policy Components
POST
/
policy
/
{policyId}
/
component
/
query
Search and filter Policy Components
curl --request POST \
--url https://api.draftt.io/v1/policy/{policyId}/component/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pageSize": 20,
"filter": {
"activeExtendedSupport": true,
"extendedSupportAnnualCost": {
"$gte": 1000
}
},
"componentData": {
"select": [
"tags"
]
},
"sort": {
"urgency": "desc"
},
"pageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19",
"calculateDisplayNames": true
}
'import requests
url = "https://api.draftt.io/v1/policy/{policyId}/component/query"
payload = {
"pageSize": 20,
"filter": {
"activeExtendedSupport": True,
"extendedSupportAnnualCost": { "$gte": 1000 }
},
"componentData": { "select": ["tags"] },
"sort": { "urgency": "desc" },
"pageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19",
"calculateDisplayNames": True
}
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({
pageSize: 20,
filter: {activeExtendedSupport: true, extendedSupportAnnualCost: {$gte: 1000}},
componentData: {select: ['tags']},
sort: {urgency: 'desc'},
pageToken: 'eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19',
calculateDisplayNames: true
})
};
fetch('https://api.draftt.io/v1/policy/{policyId}/component/query', 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.draftt.io/v1/policy/{policyId}/component/query",
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([
'pageSize' => 20,
'filter' => [
'activeExtendedSupport' => true,
'extendedSupportAnnualCost' => [
'$gte' => 1000
]
],
'componentData' => [
'select' => [
'tags'
]
],
'sort' => [
'urgency' => 'desc'
],
'pageToken' => 'eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19',
'calculateDisplayNames' => true
]),
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://api.draftt.io/v1/policy/{policyId}/component/query"
payload := strings.NewReader("{\n \"pageSize\": 20,\n \"filter\": {\n \"activeExtendedSupport\": true,\n \"extendedSupportAnnualCost\": {\n \"$gte\": 1000\n }\n },\n \"componentData\": {\n \"select\": [\n \"tags\"\n ]\n },\n \"sort\": {\n \"urgency\": \"desc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19\",\n \"calculateDisplayNames\": true\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://api.draftt.io/v1/policy/{policyId}/component/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pageSize\": 20,\n \"filter\": {\n \"activeExtendedSupport\": true,\n \"extendedSupportAnnualCost\": {\n \"$gte\": 1000\n }\n },\n \"componentData\": {\n \"select\": [\n \"tags\"\n ]\n },\n \"sort\": {\n \"urgency\": \"desc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19\",\n \"calculateDisplayNames\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.draftt.io/v1/policy/{policyId}/component/query")
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 \"pageSize\": 20,\n \"filter\": {\n \"activeExtendedSupport\": true,\n \"extendedSupportAnnualCost\": {\n \"$gte\": 1000\n }\n },\n \"componentData\": {\n \"select\": [\n \"tags\"\n ]\n },\n \"sort\": {\n \"urgency\": \"desc\"\n },\n \"pageToken\": \"eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19\",\n \"calculateDisplayNames\": true\n}"
response = http.request(request)
puts response.read_body{
"nextPageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19",
"items": [
{
"id": "456654",
"technology": "eks",
"name": "staging-cluster-us-east-1",
"urgency": 62,
"effort": 0,
"priority": 0,
"status": "Outdated",
"policyId": "1",
"componentId": "12321",
"orgComplexity": 0,
"isCompliant": false,
"currentVersion": "1.29",
"desiredVersion": "1.30",
"dueDate": "2025-03-23T00:00:00.000Z",
"createdAt": "2025-03-26T17:02:41.237Z",
"updatedAt": "2025-04-07T02:47:31.606Z",
"deletedAt": null,
"recommendedVersion": "1.32",
"extendedSupportAnnualCost": 4380,
"impendingDate": "2025-03-23T00:00:00.000Z",
"outdatedDate": "2026-03-23T00:00:00.000Z",
"activeExtendedSupport": true,
"tags": {
"environment": "staging",
"Terraform": "true"
},
"displayName": "Amazon EKS"
},
"..."
]
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}{
"error": {
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
If true - will return a 'displayType' field containing a prettified technology field
If empty - will return all fields (except for tags), if passed will only return selected field
Available options:
id, policyId, technology, name, componentId, urgency, effort, orgComplexity, priority, isCompliant, currentVersion, desiredVersion, recommendedVersion, status, extendedSupportAnnualCost, dueDate, createdAt, updatedAt Optional sorting options, if not passed will sort by creation date in ascending order, sorting by a non-unique value will sub-sort by a creation date in ascending order
Show child attributes
Show child attributes
Base64 token for pagination
Number of items to return per page
Required range:
1 <= x <= 1000