Skip to content

Daily

Get Telegram warnings before SSL certificates expire

Each day the domains in your sheet are checked, the days left on each certificate are written next to them, and you get a Telegram message for any under 14 days.

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

Send this to your assistant

Create a ClickRuntime automation: every day, check the SSL certificate expiry for the domains in my sheet, write the days left next to each, and message me on Telegram for any under 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 web developer runs sites for several clients, some on hosts with automatic renewal and some with certificates installed by hand years ago. Renewal sometimes fails quietly: a changed DNS record, an expired card, a server that stopped running its renewal job. The first sign is a browser warning that scares away a client's customers.

This automation checks every domain in your sheet once a day, writes the number of days left beside each one, and sends you a Telegram message when any certificate is within 14 days of expiry. You get two weeks to fix renewal instead of finding out from a client.

What you get out of it

  • Time to fix renewals calmly

    A two-week warning gives room to chase a hosting provider or renew a certificate by hand. Fixing it on your schedule beats an emergency after visitors see a security warning.

  • One list for every domain

    Certificates from different hosts and providers sit in one sheet with their days left. You can sort by the column to see what needs attention first.

  • Catches silent renewal failures

    Automatic renewal usually works, which is why nobody notices when it stops. A daily outside check catches the failure while there is still time.

  • Protects your clients' trust

    An expired certificate makes a site look unsafe and stops sales. Preventing it is a small, visible part of the service you provide.

How it works

What happens, step by step

  1. Once a day, ClickRuntime reads the list of domains from your sheet.

  2. It looks up the most recent certificate issued for each domain in the public certificate logs and reads its expiry date.

  3. It writes the number of days left next to each domain.

  4. If any certificate has fewer than 14 days left, or no certificate is found for a domain, you get one Telegram message listing them.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Telegram

What you get

RunsDaily
Get Telegram warnings before SSL certificates expiretoday, 9:00Succeeded
Telegram · Ops bot🔒 SSL expiring soon: shop.contoso-bakery.com: 9 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 Google Sheets 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_expiry_warnings_to_telegram.pyexample
from datetime import datetime, timezone
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http

SHEET_ID = "your-spreadsheet-id"
CHAT_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)

def days_left(domain):
    return (expiry(domain) - datetime.now(timezone.utc)).days

@on_trigger
def run(event):
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets()
    domains = [r[0].strip() for r in sheets.values().get(spreadsheetId=SHEET_ID, range="Domains!A2:A").execute().get("values", []) if r]
    column, warnings = [], []
    for d in domains:
        try:
            left = days_left(d)
        except Exception:
            left = "no certificate found"
        column.append([left])
        if left == "no certificate found" or left < 14:
            warnings.append(f"{d}: {left}" + ("" if left == "no certificate found" else " days left"))
    sheets.values().update(spreadsheetId=SHEET_ID, range=f"Domains!B2:B{len(domains) + 1}", valueInputOption="RAW", body={"values": column}).execute()
    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(domains), "warnings": len(warnings)}

FAQ

Common questions

Which domains can I put in the sheet?
Any public domain that serves HTTPS, including subdomains such as shop or api. Put one domain per row without the https:// prefix.
Can I change the 14-day threshold?
Yes. Some people prefer 30 days for certificates renewed by hand and 7 days for ones that renew automatically.
What if no certificate is found for a domain?
The row is marked as no certificate found and you are told on Telegram, since a misspelled or lapsed domain is worth checking too.
What permissions does it need?
Sheets read+write; Telegram 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 “Get Telegram warnings before SSL certificates expire” from your assistant

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