Here's how you can build site templates for Oh Dear

Published on July 16, 2025 by Sean White

When you're managing a handful of client sites, setting things up manually is fine. Though if you're managing dozens of them, you're going to think twice about your approach.

For agencies, development teams and platforms who are responsible for loads of websites, having to repeat the same configuration over and over is not only inefficient but also more prone to errors. That’s where this blog post comes in handy.

While Oh Dear doesn’t offer templates via the UI (yet) you can achieve pretty powerful templating patterns using tags, notification channels and the API.

Here’s how you can achieve this:

1. Build a Template Site

Start by creating a site in Oh Dear that contains all your default settings. You can do this via the API but it's probably worth doing this via the UI and seeing what's available. Everything you can do in the UI you can do via the API.

For example, by default you might want to:

  • Uptime and performance checks enabled
  • SSL certificate check enabled with a 30-day expiry threshold
  • Broken link crawler active

Save the site and tag it with template and anything else you might want to identify it with if you have multiple types of sites to share config.

For example, you might have template:marketing, template:app and template:internal.

2. Create Notification Channels

Before we get too far into the API, let's consider how we want notification channels to work. We have multiple blog posts on this topic, so we won't go into too much detail here but tag-level notifications are great, extendible way to route client alerts and team-level tags are great for keeping your dev team informed across every site.

This decouples notification logic from individual sites and makes future updates super easy!

3. Use the API to Clone from Template

When onboarding a new client site, skip the UI. Use the API to:

  • Fetch your template site
  • Copy over settings (checks, thresholds, tags, notifications)
  • Apply any client-specific overrides (tags, server location, client report delivery address, etc.)

This ensures consistency without requiring manual duplication. Let's get stuck in:

const response = await fetch('https://ohdear.app/api/sites', {
	headers: {
		'Authorization': 'Bearer ' + process.env.OH_DEAR_API_KEY,
		'Content-Type': 'application/json'
	}
});

const sites = await response.json();

const templateSite = sites.data.find(site => site.tags.includes('template:marketing'));


const keysToRemove = [
	'id', 'team_id', 'url', 'label', 'checks',
];

// Remove keys that we don't want to copy over
const rawData = Object.fromEntries(

  
Object.entries(templateSite).filter(([key]) => !keysToRemove.includes(key))
);

// Get the check types that are enabled for the template site
const templateCheckTypes = templateSite.checks.filter(check => check.enabled).map(check => check.type);

// Check settings are found under each check instance in the response
// Here's a way to go through each check and pluck the settings and merge them into a single object
const checkSettings = templateSite.checks.map(check => check.settings).reduce((acc, obj) => ({ ...acc, ...obj }), {});

// Build the new site payload
const urls = [
"https://example.com/from-template-1",
"https://example.com/from-template-2",
"https://example.com/from-template-3",
]

  

for (const url of urls) {

const data = {
	"url": url,
	"team_id": templateSite.team_id,
	...rawData,
	...checkSettings,
	checks: templateCheckTypes
}

  

const created = await fetch('https://ohdear.app/api/sites', {
	method: 'POST',
	headers: {
		'Authorization': 'Bearer ' + process.env.OH_DEAR_API_KEY,
		'Content-Type': 'application/json'
	},
	body: JSON.stringify(data)
})

Wrap this up into a function and you've got yourself a nice little script to clone a template site. Alternatively, you could store a local JSON object with all the default site settings and use the add-a-site-with-custom-settings end point directly. On one hand this allow your non-tech team members to update the template site in Oh Dear but at the same time keeping the entire payload in a file means you can keep it in version control and share it with your team.

4. Mass Update All Sites via the API

Need to roll out a new policy across all sites (e.g. enable certificate checking with a new threshold)?

Use the API to:

  • Fetch all sites (optionally filter by tag, URL, internal notes etc)
  • Update only the checks you care about
  • Apply the new certificate expiration threshold across the board

This is especially helpful if you're enforcing compliance or want to roll out new monitoring best practices without point and click effort.

const response = await fetch('https://ohdear.app/api/sites', {
	headers: {
		'Authorization': 'Bearer ' + process.env.OH_DEAR_API_KEY,
		'Content-Type': 'application/json'
	}
});

const sites = await response.json();

for (const site of sites.data){

const checks = site.checks
	.filter(check => check.enabled)
	.map(check => check.type)
	.concat([ 
		"certificate_health", // enable certificate health check in all environments
		site.tags.includes('env:production') ? "lighthouse" : null // enable lighthouse check for production sites
])
.filter(Boolean);

const update = await fetch('https://ohdear.app/api/sites/' + site.id, {
	method: 'PUT',
	headers: {
		'Authorization': 'Bearer ' + process.env.OH_DEAR_API_KEY,
		'Content-Type': 'application/json'
	},
	
	body: JSON.stringify({
		"checks": checks,
		// check settings
		"certificate_health_check_expires_soon_threshold_in_days": 10,
		"lighthouse_check_continent": "europe",
		"lighthouse_cpu_slowdown_modifier": 0
	})
});
	
	console.log({
		site: site.id,
		url: site.url,
		status: update.status,
	});
}

Hopefully, this can help you get started with templating in Oh Dear. If you have any questions or feedback, please let us know.

Start using Oh Dear today!

  • Access to all features
  • Cancel anytime
  • No credit card required
  • First 30 days free

More updates

Want to get started? We offer a no-strings-attached 30 day trial. No credit card required.

Start monitoring

You're all set in
less than a minute!