---
title: "Working with campaign templates programmatically"
slug: "working-with-campaign-templates-programmatically"
abstract: "Use campaign templates to streamline the campaign creation process."
---
# Working with campaign templates programmatically

The topic describes how to work with marketing automation campaign templates programmatically.

Campaign templates are managed by `Sitecore.Marketing.Automation.Definitions.AutomationCampaignTemplates.AutomationCampaignTemplateDefinitionManager` class. They are stored in the master database under the following path:

*/sitecore/system/Marketing Control Panel/Marketing Automation Templates* managed by the `Sitecore.Marketing.Automation.Definitions.AutomationCampaignTemplates.AutomationCampaignTemplateDefinitionManager` class

- Task:
- Access the automation campaign template manager.The `AutomationCampaignTemplateDefinitionManager ` is available from the sitecore DI container.: *Constructor Injection*
- : *ServiceLocator*
- Define an automation campaign template.:
- Save an automation campaign template.:
- Update an existing automation campaign template.:
- Delete an automation campaign template.:
- Retrieve an automation campaign template.:
- Retrieve an automation campaign template using an alias.:
- Retrieve all automation campaign templates.:

> [!note]
> You cannot activate an automation campaign template programatically. If the *ActivateAsync* method of the the `AutomationCampaignTemplateDefinitionManager` is called, or if the the *SaveAsync* is called and the activate parameter is set to true, a NotSupportedException occurs.