29tools
New · MCP SuiteYour infrastructure now talks to AI agents.

Claude, Codex & co. manage DNS, domains and certificates directly, including DNS Doctor diagnostics.

Explore the MCP Suite
Recipe
about 12 minutes
v1.6.2
Download OpenAPI
Inventory TLS certificates and export artifacts
List all certificates, filter them by status, and export available certificate artifacts as PEM or ZIP for downstream systems.
Intermediateabout 12 minutesTLSInventoryExportPEMOperations
Duration
about 12 minutes
Level
Intermediate
Endpoints
3

This recipe combines three typical operational tasks: listing the full certificate inventory, selecting relevant entries, and downloading the available artifacts in an automated way.

Prerequisites

  • an API key with access to the TLS endpoints
  • a target system or directory for PEM or ZIP downloads
  • clear criteria that define which certificates should be exported
  • optionally, a downstream process that distributes the exported files

Step 1: Fetch the certificate inventory

Start with the full list of certificates that belong to the authenticated account.

bash
curl --request GET \
  --url 'https://api.regfish.com/tls/certificate' \
  --header 'x-api-key: YOUR_API_KEY'

The most relevant fields for further processing are:

  • id
  • common_name
  • status
  • product
  • certificate_pem_available

Step 2: Select export candidates

Not every certificate can be downloaded right away. Define a filter first, for example only certificates with a PEM artifact already available.

json
{
  "includeWhen": {
    "certificate_pem_available": true
  },
  "downloadFormat": "pem"
}

Step 3: Confirm detail state before download

Before exporting, you can fetch individual certificate details again. That is useful if you want to evaluate more status information or provider metadata.

bash
curl --request GET \
  --url 'https://api.regfish.com/tls/certificate/7K9QW3M2ZT8HJ' \
  --header 'x-api-key: YOUR_API_KEY'

Step 4: Download the certificate as PEM

For many deployment systems, the PEM artifact as plain text is enough.

bash
curl --request GET \
  --url 'https://api.regfish.com/tls/certificate/7K9QW3M2ZT8HJ/download/pem' \
  --header 'x-api-key: YOUR_API_KEY' \
  --output 'certificate-7K9QW3M2ZT8HJ.pem'

Step 5: Alternatively fetch a ZIP bundle

If a downstream system works better with bundles, you can request the ZIP artifact instead.

bash
curl --request GET \
  --url 'https://api.regfish.com/tls/certificate/7K9QW3M2ZT8HJ/download/zip' \
  --header 'x-api-key: YOUR_API_KEY' \
  --output 'certificate-7K9QW3M2ZT8HJ.zip'

Step 6: Run export as a batch job

In production setups, list, filter, and download are usually combined into a repeatable batch process.

bash
for id in 7K9QW3M2ZT8HJ 8R2XC7M4TH9PK 6Z3PH8T2MX7CR; do
  curl --request GET \
    --url "https://api.regfish.com/tls/certificate/${id}/download/pem" \
    --header 'x-api-key: YOUR_API_KEY' \
    --output "certificate-${id}.pem"
done

Practical notes for production workflows

  • do not rely only on naming patterns; use status and availability fields
  • write artifacts to a temporary directory first and move them only after a successful download
  • log certificate ID, common name, format, and export timestamp
  • keep export and distribution as separate steps so failures stay isolated
  • expect some certificates to be visible in the inventory before their download artifact is available

Result

This turns the TLS inventory into a structured export workflow. That is useful for audits, deployments, backups, and any centralized certificate management process.

Community

Diventa parte della comunità

L'API DNS Regfish è un'ottima soluzione per gli sviluppatori che desiderano automatizzare domini e zone DNS. Entra a far parte della community e beneficia dell'automazione DNS. L'API DNS è disponibile gratuitamente per ogni cliente Regfish.