Skip to main content
POST
/
component
/
query
Query components with filtering, sorting and pagination
curl --request POST \
  --url https://api.draftt.io/v1/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
    },
    "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": [
    "id"
  ],
  "sort": {
    "id": "asc",
    "integrationId": "asc",
    "uniqueIdentifier": "asc",
    "region": "asc",
    "vendor": "asc",
    "technology": "asc",
    "type": "asc",
    "version": "asc",
    "hasAvailableDraftts": "asc",
    "createdAt": "asc",
    "updatedAt": "asc"
  },
  "pageToken": "<string>",
  "pageSize": 100
}
'
{
  "nextPageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsidXJnZW5jeSI6eyJvcmRlciI6MCwiZGlyZWN0aW9uIjoiZGVzYyJ9LCJpZCI6eyJvcmRlciI6MSwiZGlyZWN0aW9uIjoiYXNjIn19LCJzb3J0VmFsdWVzIjp7InVyZ2VuY3kiOjUuNDM0NzgyNjA4Njk1NjUyLCJpZCI6IjUwMDg1In19",
  "items": [
    {
      "id": "456654",
      "integrationId": "6",
      "uniqueIdentifier": "arn:aws:rds:us-east-1:1234567:db:rds-dev-1",
      "region": "us-east-1",
      "vendor": "aws",
      "technology": "rds",
      "type": "rds-postgres",
      "version": "14.10",
      "hasAvailableDraftts": true,
      "createdAt": "2024-05-06T11:25:50.750Z",
      "updatedAt": "2024-09-09T14:36:11.531Z",
      "tags": {
        "Environment": "dev-us-east-1",
        "Terraform": "true"
      },
      "customTags": {
        "CostCenter": "engineering",
        "Owner": "platform-team"
      }
    },
    "..."
  ]
}

Authorizations

Authorization
string
header
required

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

Body

application/json
filter
object
select
enum<string>[]

If empty - will return all fields, if passed will only return selected fields

Available options:
id,
integrationId,
uniqueIdentifier,
region,
vendor,
technology,
type,
version,
hasAvailableDraftts,
createdAt,
updatedAt,
tags,
customTags
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