Skip to main content
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 '
{
  "filter": {
    "$and": "<array>",
    "$or": "<array>",
    "id": {
      "$eq": 123,
      "$ne": 123,
      "$gt": 123,
      "$gte": 123,
      "$lt": 123,
      "$lte": 123,
      "$in": [
        123
      ],
      "$nin": [
        123
      ],
      "$exists": true
    },
    "policyId": {
      "$eq": 123,
      "$ne": 123,
      "$gt": 123,
      "$gte": 123,
      "$lt": 123,
      "$lte": 123,
      "$in": [
        123
      ],
      "$nin": [
        123
      ],
      "$exists": true
    },
    "technology": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "name": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "componentId": {
      "$eq": 123,
      "$ne": 123,
      "$gt": 123,
      "$gte": 123,
      "$lt": 123,
      "$lte": 123,
      "$in": [
        123
      ],
      "$nin": [
        123
      ],
      "$exists": true
    },
    "urgency": {
      "$eq": 123,
      "$ne": 123,
      "$gt": 123,
      "$gte": 123,
      "$lt": 123,
      "$lte": 123,
      "$in": [
        123
      ],
      "$nin": [
        123
      ],
      "$exists": true
    },
    "effort": {
      "$eq": 123,
      "$ne": 123,
      "$gt": 123,
      "$gte": 123,
      "$lt": 123,
      "$lte": 123,
      "$in": [
        123
      ],
      "$nin": [
        123
      ],
      "$exists": true
    },
    "orgComplexity": {
      "$eq": 123,
      "$ne": 123,
      "$gt": 123,
      "$gte": 123,
      "$lt": 123,
      "$lte": 123,
      "$in": [
        123
      ],
      "$nin": [
        123
      ],
      "$exists": true
    },
    "priority": {
      "$eq": 123,
      "$ne": 123,
      "$gt": 123,
      "$gte": 123,
      "$lt": 123,
      "$lte": 123,
      "$in": [
        123
      ],
      "$nin": [
        123
      ],
      "$exists": true
    },
    "isCompliant": {
      "$eq": true,
      "$ne": true,
      "$exists": true
    },
    "currentVersion": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "desiredVersion": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "recommendedVersion": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "status": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "extendedSupportAnnualCost": {
      "$eq": 123,
      "$ne": 123,
      "$gt": 123,
      "$gte": 123,
      "$lt": 123,
      "$lte": 123,
      "$in": [
        123
      ],
      "$nin": [
        123
      ],
      "$exists": true
    },
    "activeExtendedSupport": {
      "$eq": true,
      "$ne": true,
      "$exists": true
    },
    "dueDate": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "createdAt": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "updatedAt": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    }
  },
  "componentData": {
    "filter": {
      "$and": "<array>",
      "$or": "<array>",
      "id": {
        "$eq": 123,
        "$ne": 123,
        "$gt": 123,
        "$gte": 123,
        "$lt": 123,
        "$lte": 123,
        "$in": [
          123
        ],
        "$nin": [
          123
        ],
        "$exists": true
      },
      "integrationId": {
        "$eq": 123,
        "$ne": 123,
        "$gt": 123,
        "$gte": 123,
        "$lt": 123,
        "$lte": 123,
        "$in": [
          123
        ],
        "$nin": [
          123
        ],
        "$exists": true
      },
      "uniqueIdentifier": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "region": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "vendor": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "technology": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "type": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "version": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "hasAvailableDraftts": {
        "$eq": true,
        "$ne": true,
        "$exists": true
      },
      "createdAt": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "updatedAt": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "tags$.*": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      },
      "customTags$.*": {
        "$eq": "<string>",
        "$ne": "<string>",
        "$gt": "<string>",
        "$gte": "<string>",
        "$lt": "<string>",
        "$lte": "<string>",
        "$like": "<string>",
        "$in": [
          "<string>"
        ],
        "$nin": [
          "<string>"
        ],
        "$exists": true
      }
    },
    "select": [
      "tags"
    ]
  },
  "calculateDisplayNames": true,
  "select": [
    "id"
  ],
  "sort": {
    "id": "asc",
    "policyId": "asc",
    "technology": "asc",
    "name": "asc",
    "componentId": "asc",
    "urgency": "asc",
    "effort": "asc",
    "orgComplexity": "asc",
    "priority": "asc",
    "isCompliant": "asc",
    "currentVersion": "asc",
    "desiredVersion": "asc",
    "recommendedVersion": "asc",
    "status": "asc",
    "extendedSupportAnnualCost": "asc",
    "activeExtendedSupport": "asc",
    "dueDate": "asc",
    "createdAt": "asc",
    "updatedAt": "asc"
  },
  "pageToken": "<string>",
  "pageSize": 100
}
'
{
  "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"
    },
    "..."
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

policyId
integer
required

Body

application/json
filter
object
componentData
object
calculateDisplayNames
boolean

If true - will return a 'displayType' field containing a prettified technology field

select
enum<string>[]

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
sort
object

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

pageToken
string

Base64 token for pagination

pageSize
integer
default:100

Number of items to return per page

Required range: 1 <= x <= 1000

Response

Success

items
object[]
required
nextPageToken
string | null

Token for fetching the next page of results