Scripts and automation

Use DomainWarn in scripts, CI and workflows: query critical domains with curl and jq, stop deploys, dedicated n8n nodes, webhooks for Zapier and Make.

On this page

Scripts, CI and automation (n8n, Zapier, Make)

In scripts and CI pipelines the API itself is enough: a token from Settings → API in the Authorization: Bearer header, the rest is curl and jq. The responses are the same JSON structures the dashboard uses.

For a deploy job the question is usually whether anything is open: status=critical on the domain list, or one of the free checks, which needs no token at all. To make the step fail, evaluate the number of findings – jq turns that into an exit code.

Writing calls (create a domain, check now) need a token with write scope; reading ones are enough for everything else.

CI step
export DOMAINWARN_TOKEN=dw_…
BASE=https://api.domainwarn.com/api/v1/orgs/my-agency

# critical domains; fails the step if there are any
curl -sf -H "Authorization: Bearer $DOMAINWARN_TOKEN" "$BASE/domains?status=critical" \
  | jq -e '.data | length == 0'

# before the deploy: check the certificate, without a token
curl -sf "https://api.domainwarn.com/api/v1/tools/ssl?domain=client.example" \
  | jq -e '.data.issues == 0'

Zapier and Make talk to the same API through their HTTP module with Authorization: Bearer <TOKEN>; for the other direction – DomainWarn telling the scenario about something – there are webhooks as a notification channel. n8n has dedicated nodes (below).

See also: API documentation

n8n: trigger and node

The community package n8n-nodes-domainwarn ships two nodes. The DomainWarn Trigger starts a workflow on incidents (opened, escalated, reminder, resolved), on changes such as new DNS records and when an SLA target is at risk; with “Only Expiry Warnings” only on expiry warnings for certificates, domains, DNSSEC signatures and security.txt. The DomainWarn node lists, creates, pauses and resumes domains, checks all monitors of a domain right away, lists and acknowledges incidents and runs any free check for any domain.

The trigger needs no setup in DomainWarn: when you activate the workflow it creates a signed webhook through the API (it shows up under Settings → Notifications → Channels, labelled with the token), and deletes it again on deactivation. It verifies every delivery by its HMAC signature and timestamp and rejects forged deliveries or ones older than five minutes. Minimum severity, quiet hours and maintenance windows apply as for every channel, and the subscription counts against the plan’s channel limit.

  1. In n8n, install the package n8n-nodes-domainwarn under Settings → Community nodes (self-hosted n8n; on n8n Cloud once n8n has approved the package).
  2. In DomainWarn, create a token under Settings → API – with write access if you use the trigger or changing actions.
  3. In n8n, create credentials of type “DomainWarn API” with the token; the organization follows from the token.
  4. Add the trigger to a workflow, pick the events and minimum severity and activate the workflow. n8n must be reachable on a public https address for this.

When the token is revoked or expires, the subscription ends as well; if the person who created the token leaves the organization, their subscriptions receive nothing anymore.

See also: API documentation