Skip to content

Daily

Check SSL expiry for domains in Notion and warn on Telegram

Every domain in your Notion database is checked daily, its expiry date is updated, and you get a Telegram message for any expiring within 14 days.

Runs
Daily
Apps
Notion, Telegram
AI
Not needed
Access
Notion read+write; bot token

Send this to your assistant

Create a ClickRuntime automation: every day, check SSL expiry for each domain in my Notion Domains database, update the expiry date, and message me on Telegram about any expiring within 14 days.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A small hosting and maintenance business keeps its client domains in a Notion database, alongside the client, the host and the renewal notes. Certificate expiry dates in that database are typed in by hand and quickly go stale. When a renewal fails, the database still says everything is fine.

This automation checks each domain's certificate every day, writes the real expiry date back into Notion, and sends a Telegram message when any is within 14 days of expiring. Your database stays accurate and you get time to act.

What you get out of it

  • Expiry dates you can trust

    The dates in Notion come from the live certificate, not from memory. Anyone reading the database sees the truth.

  • Warnings with time to act

    Two weeks' notice is enough to sort out a failed renewal with a client's host. No more weekend emergencies.

  • Keeps your client records in one place

    Domains stay next to the rest of your client information in Notion. There is no separate spreadsheet or tool to maintain.

  • Alerts reach you anywhere

    A Telegram message arrives on your phone wherever you are. You know about a problem without logging into anything.

How it works

What happens, step by step

  1. Once a day, ClickRuntime reads every domain in your Notion Domains database.

  2. It looks up the most recent certificate issued for each domain in the public certificate logs and reads when it expires.

  3. It writes that date into the Expires field of the domain's Notion entry.

  4. If any certificate expires within 14 days, or no certificate is found for a domain, you get one Telegram message listing them.

Before it runs live

  • Connect Notion and share the database you want it to use
  • Connect Telegram

What you get

RunsDaily
Check SSL expiry for domains in Notion and warn on Telegramtoday, 9:00Succeeded
Telegram · Ops bot🔒 SSL expiring soon: www.acme-dental.com: 6 days left

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Notion and Telegram steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
ssl_certificate_checks_for_domains_in_notion.pyexample
from datetime import datetime, timezone
from clickruntime import on_trigger, credentials, http

DOMAINS_DB, CHAT_ID = "your-notion-database-id", "your-telegram-chat-id"

def expiry(domain):
    entries = http.get("https://crt.sh/", params={"q": domain, "output": "json"}, timeout=30).json()
    dates = [e["not_after"] for e in entries if domain in e.get("name_value", "").splitlines()]
    return datetime.fromisoformat(max(dates)).replace(tzinfo=timezone.utc)

@on_trigger
def run(event):
    notion = {"Authorization": f"Bearer {credentials.connection('notion', 'work')}", "Notion-Version": "2022-06-28"}
    pages = http.post(f"https://api.notion.com/v1/databases/{DOMAINS_DB}/query", headers=notion, json={"page_size": 100}).json()["results"]
    warnings = []
    for p in pages:
        title = p["properties"]["Name"]["title"]
        domain = title[0]["plain_text"].strip() if title else ""
        if not domain:
            continue
        try:
            expires = expiry(domain)
        except Exception:
            warnings.append(f"{domain}: no certificate found")
            continue
        http.patch(f"https://api.notion.com/v1/pages/{p['id']}", headers=notion, json={"properties": {"Expires": {"date": {"start": expires.date().isoformat()}}}})
        days = (expires - datetime.now(timezone.utc)).days
        if days < 14:
            warnings.append(f"{domain}: {days} days left")
    if warnings:
        token = credentials.secret("TELEGRAM_BOT_TOKEN")
        http.post(f"https://api.telegram.org/bot{token}/sendMessage", json={"chat_id": CHAT_ID, "text": "🔒 SSL expiring soon:\n" + "\n".join(warnings)})
    return {"checked": len(pages), "warnings": len(warnings)}

FAQ

Common questions

What does the Notion database need?
A title property with the domain name and a date property called Expires. Other properties, such as client or host, are left untouched.
What if no certificate is found for a domain?
It is included in the Telegram warning so you can check whether the name is spelled correctly or the domain has lapsed.
Can I use a different warning window?
Yes. 14 days is a sensible default, but you can choose 30 days for certificates you renew by hand.
What permissions does it need?
Notion read+write; bot token. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Check SSL expiry for domains in Notion and warn on Telegram” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.