Get expiring certificates
const url = 'http://localhost:3000/api/v1/certificates/expiring?days=30&page=1&limit=20';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:3000/api/v1/certificates/expiring?days=30&page=1&limit=20' \ --header 'X-API-Key: <X-API-Key>'Retrieves certificates that are expiring within a specified number of days.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Example
30Number of days to look ahead for expiring certificates
Page number (1-based)
Number of items per page
Header Parameters
Section titled “Header Parameters”UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.
Responses
Section titled “Responses”Expiring certificates retrieved successfully
object
List of certificates
object
Certificate UUID
Certificate type
Certificate subject (Common Name)
Certificate issuer
Certificate SHA-256 fingerprint
Certificate validity start date
Certificate expiration date
Certificate status
False for a legacy device certificate whose notBefore, notAfter and issuer were not read from a certificate. Its dates are placeholders and must not be shown or alerted on.
Device ID (only for device certificates)
Device name (only for device certificates)
Certificate creation date
Certificate serial number (hex)
Public key algorithm and size
Signature algorithm
Subject Alternative Names
PEM-encoded public certificate (CA certs only)
Total number of certificates matching the filter
Current page number
Number of items per page
Total number of pages
Example
{ "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "type": "device", "subject": "CN=device-001.example.com", "issuer": "CN=Margo Root CA", "fingerprint": "A1:B2:C3:D4:E5:F6...", "notBefore": "2024-01-01T00:00:00.000Z", "notAfter": "2025-01-01T00:00:00.000Z", "status": "valid", "validityKnown": true, "deviceId": "550e8400-e29b-41d4-a716-446655440001", "deviceName": "Production Gateway 1", "createdAt": "2024-01-01T00:00:00.000Z" } ], "total": 150, "page": 1, "limit": 20, "totalPages": 8}Unauthorized - Invalid or missing authentication
Forbidden - Insufficient permissions