Skip to main content
POST
/
certificates
/
query
Query certificates with filtering, sorting and pagination
curl --request POST \
  --url https://api.draftt.io/v1/certificates/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
    },
    "type": {
      "$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
    },
    "issuer": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "keyAlgorithm": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "renewalEligibility": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "domainName": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "created": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "issuedAt": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "validityStartDate": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$exists": true
    },
    "expirationDate": {
      "$eq": "<string>",
      "$ne": "<string>",
      "$gt": "<string>",
      "$gte": "<string>",
      "$lt": "<string>",
      "$lte": "<string>",
      "$like": "<string>",
      "$in": [
        "<string>"
      ],
      "$nin": [
        "<string>"
      ],
      "$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
    },
    "deletedAt": {
      "$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",
    "type": "asc",
    "status": "asc",
    "issuer": "asc",
    "keyAlgorithm": "asc",
    "renewalEligibility": "asc",
    "domainName": "asc",
    "created": "asc",
    "issuedAt": "asc",
    "validityStartDate": "asc",
    "expirationDate": "asc",
    "dueDate": "asc",
    "createdAt": "asc",
    "updatedAt": "asc",
    "deletedAt": "asc"
  },
  "pageToken": "<string>",
  "pageSize": 100
}
'
{
  "nextPageToken": "eyJ1bmlxdWVGaWVsZE5hbWUiOiJpZCIsInNvcnQiOnsiZXhwaXJhdGlvbkRhdGUiOnsiZGlyZWN0aW9uIjoiYXNjIn19fQ==",
  "items": [
    {
      "id": "12345",
      "integrationId": "456",
      "uniqueIdentifier": "cert-prod-web-2024",
      "type": "ssl",
      "status": "active",
      "issuer": "Let's Encrypt Authority X3",
      "keyAlgorithm": "RSA",
      "renewalEligibility": "eligible",
      "domainName": "example.com",
      "domains": [
        "example.com",
        "www.example.com",
        "api.example.com"
      ],
      "inUseBy": [
        "web-server-1",
        "load-balancer-2"
      ],
      "created": "2024-01-15T10:30:00.000Z",
      "issuedAt": "2024-01-15T10:30:00.000Z",
      "validityStartDate": "2024-01-15T10:30:00.000Z",
      "expirationDate": "2024-04-15T10:30:00.000Z",
      "dueDate": "2024-03-15T10:30:00.000Z",
      "details": {
        "serialNumber": "03E7B2B58A6E8B9C4D2F1A0E5C7B8D6F",
        "signatureAlgorithm": "SHA256withRSA"
      },
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-02-15T10:30:00.000Z",
      "deletedAt": null,
      "componentIds": [
        789,
        1234
      ],
      "displayType": "SSL Certificate"
    }
  ]
}

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 field

Available options:
id,
integrationId,
uniqueIdentifier,
type,
status,
issuer,
keyAlgorithm,
renewalEligibility,
domainName,
domains,
inUseBy,
created,
issuedAt,
validityStartDate,
expirationDate,
dueDate,
details,
createdAt,
updatedAt,
deletedAt,
componentIds
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