# Activate template

## Activates a notification template.

> Activates the template, making it available for sending notifications. Only active templates can be used.

```json
{"openapi":"3.0.1","info":{"title":"Marketplace API","version":"5.0.5243-ga0bb7c09"},"servers":[{"url":"https://api.platform.softwareone.com"}],"paths":{"/public/v1/notifications/templates/{id}/activate":{"post":{"tags":["NotificationTemplates"],"summary":"Activates a notification template.","description":"Activates the template, making it available for sending notifications. Only active templates can be used.","parameters":[{"name":"id","in":"path","description":"A notification template ID.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationTemplate"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"NotificationTemplate":{"type":"object","properties":{"id":{"type":"string"},"audit":{"allOf":[{"$ref":"#/components/schemas/NotificationTemplateAudit"}],"description":"Represents audit information for a Mpt.Notifications.Models.NotificationTemplates.NotificationTemplate."},"$meta":{"allOf":[{"$ref":"#/components/schemas/PlatformMetadata"}],"nullable":true},"name":{"type":"string"},"revision":{"type":"integer","format":"int32"},"category":{"type":"object","allOf":[{"$ref":"#/components/schemas/CategoryRef"}]},"criteria":{"allOf":[{"$ref":"#/components/schemas/NotificationTemplateCriteria"}],"description":"Gets or sets the criteria for automatic triggering of this template based on events.","nullable":true},"defaultVariant":{"type":"object","allOf":[{"$ref":"#/components/schemas/TemplateVariantRef"}]},"description":{"type":"string","description":"Gets or sets the description of this template.","nullable":true},"lastUsed":{"type":"string","description":"Gets or sets the timestamp of when this template was last used to send a notification.","format":"date-time","nullable":true},"owner":{"type":"object","allOf":[{"$ref":"#/components/schemas/AccountRef"}]},"statistics":{"allOf":[{"$ref":"#/components/schemas/MessageStatistics"}],"description":"Gets or sets the usage statistics for this template."},"status":{"type":"string","description":"Gets or sets the current status of the template."},"variants":{"type":"array","items":{"$ref":"#/components/schemas/TemplateVariantRef"},"description":"Gets or sets the list of language-specific variants for this template."},"externalId":{"type":"string","description":"Gets or sets an external identifier for integration with external systems.","nullable":true}},"additionalProperties":false,"description":"Represents a reusable template that can be used to generate messages."},"NotificationTemplateAudit":{"type":"object","properties":{"created":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"updated":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"nullable":true},"activated":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"description":"Gets or sets the event information for when the template was activated.","nullable":true},"deleted":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"description":"Gets or sets the event information for when the template was deleted.","nullable":true},"disabled":{"allOf":[{"$ref":"#/components/schemas/PlatformObjectEvent"}],"description":"Gets or sets the event information for when the template was disabled.","nullable":true}},"additionalProperties":false,"description":"Represents audit information for a Mpt.Notifications.Models.NotificationTemplates.NotificationTemplate."},"PlatformObjectEvent":{"type":"object","properties":{"at":{"type":"string","format":"date-time","nullable":true},"by":{"type":"object","allOf":[{"$ref":"#/components/schemas/PlatformIdentityRef"}]}},"additionalProperties":false},"PlatformIdentityRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"}},"additionalProperties":false},"PlatformMetadata":{"type":"object","properties":{"omitted":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CategoryRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"revision":{"type":"integer","format":"int32"},"description":{"type":"string","description":"Gets or sets the description of the category."},"lastUsed":{"type":"string","description":"Gets or sets the timestamp of when this category was last used to send a notification.","format":"date-time","nullable":true}},"additionalProperties":false,"description":"Represents a notification category that can be used to organize and filter notifications."},"NotificationTemplateCriteria":{"type":"object","properties":{"accountTypes":{"type":"array","items":{"type":"string"},"description":"Gets or sets the list of account types for which this template should trigger."},"filterCondition":{"type":"string","description":"Gets or sets the RQL filter condition that must be satisfied for the template to trigger."},"objectType":{"type":"string","description":"Gets or sets the platform object type this template monitors."},"recipients":{"allOf":[{"$ref":"#/components/schemas/NotificationTemplateCriteriaRecipients"}],"description":"Gets or sets the custom Recipients condition. If specified, this RQL condition determines the recipients of the notification.","nullable":true}},"additionalProperties":false,"description":"Represents the criteria for automatically triggering a template based on platform events."},"NotificationTemplateCriteriaRecipients":{"type":"object","properties":{"selector":{"type":"string","description":"Gets or sets the RQL filter condition that must be satisfied for the template to trigger."}},"additionalProperties":false,"description":"Represents the recipients criteria for automatically triggering a template based on platform events."},"TemplateVariantRef":{"type":"object","properties":{"id":{"type":"string"},"revision":{"type":"integer","format":"int32"},"default":{"type":"boolean","description":"Gets or sets a value indicating whether this is the default variant for the parent template."},"languageCode":{"type":"string","description":"Gets or sets the language code for this variant."},"status":{"type":"string","description":"Gets or sets the current status of the variant."}},"additionalProperties":false,"description":"Represents a language-specific variant of a template."},"AccountRef":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"icon":{"type":"string","nullable":true},"revision":{"type":"integer","format":"int32"},"type":{"allOf":[{"$ref":"#/components/schemas/AccountType"}],"nullable":true},"status":{"allOf":[{"$ref":"#/components/schemas/AccountStatus"}],"nullable":true}},"additionalProperties":false},"AccountType":{"enum":["Client","Vendor","Operations"],"type":"string"},"AccountStatus":{"enum":["Active","Enabled","Disabled"],"type":"string"},"MessageStatistics":{"type":"object","properties":{"month":{"type":"integer","description":"Gets or sets the number of messages sent in the current month.","format":"int32"},"today":{"type":"integer","description":"Gets or sets the number of messages sent today.","format":"int32"},"week":{"type":"integer","description":"Gets or sets the number of messages sent in the current week.","format":"int32"}},"additionalProperties":false,"description":"Represents message statistics aggregated over different time periods."},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```
