CustomNotificationType defines the delivery channels and optional mobile actions for a custom notification type. It is reusable configuration, not an individual notification message. Deploying it does not send a notification or set recipients, message content, or the record or page opened when someone clicks the notification.
Keep this metadata definition separate from the runtime CustomNotificationType object, which Apex can query, and Messaging.CustomNotification, which sending code uses to construct and send a message.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The component's metadata identity, inherited from Metadata. |
customNotifTypeName |
Required notification type name. Maximum length: 80 characters. |
masterLabel |
Required label for the notification type. |
desktop |
Required boolean. true enables the desktop delivery channel; false disables it. |
mobile |
Required boolean. true enables the mobile delivery channel; false disables it. |
slack |
Reserved for future use. It is not a supported Slack delivery switch. |
actionGroups |
Optional Beta structure containing mobile action groups, which let users take actions directly from mobile notifications. |
groupName |
Required unique name of a group inside actionGroups. |
actionName |
Required identifier for an action inside a group's actions collection. It must be unique within that group. |
actionLabel |
Required text shown for the action in the push notification. |
actionTarget |
Name of the Apex class implementing a nested mobile action. This is not the notification's click-through record or page. |
actionType |
Required action type. Allowed values are NotificationApiAction, a server-side action requiring the client to make an action API call, and Share, a client-side action that shares notification content to a channel. |
Behavior and Constraints
Delivery channels are independent
desktop and mobile independently enable their respective channels. Both can be enabled together, but that combination is not an implied default: both fields are required booleans.
Mobile actions are nested configuration
Each entry in actionGroups is a CustomNotificationActionGroup. Its actions collection contains CustomNotificationActionDefinition entries. These are structures within the notification type, not separately deployable components.
The group name uniquely identifies the group, while each action name only needs to be unique within its group. The action label supplies the text users see. The actionType distinguishes a server-side API action from a client-side share action; actionTarget identifies an Apex implementation rather than a navigation destination.
Sending uses the runtime record ID
A community Apex example updated in 2025 queries the runtime CustomNotificationType object by DeveloperName, then passes the returned record Id to setNotificationTypeId(). The sending code separately sets the title, body, navigation target, and recipients. A developer name is therefore not interchangeable with the record ID expected by that sending method.
Deployment and Retrieval
In a Metadata API package, notification type definitions use the .notiftype suffix and reside in the notificationtypes directory. The component inherits fullName as its metadata identity. The required customNotifTypeName supplies the notification type name, and masterLabel supplies its label.
Wildcard retrieval is not supported. CustomNotificationType does not support * in package.xml. Retrieval and deployment manifests must explicitly enumerate the required members under CustomNotificationType.
Mobile action groups and action definitions travel within their parent notification type. When inspecting dependencies, distinguish any Apex implementation named by actionTarget from configuration that selects the notification type through NotificationTypeConfig.notificationType. Neither relationship makes a mobile action definition a separate deployment identity.
Relationships
The outgoing connection identifies code implementing a mobile action. The incoming connection identifies configuration that selects a custom notification type. Neither connection sets the recipients or content of an individual message.
References
-
ApexClass:actionTarget, nested insideactionGroupsandactions.
Referenced By
-
NotificationTypeConfig:notificationType.
Reported Issues
-
A sending-permission problem can look like an unsupported action. A 2021 community report associated the REST action error
Unsupported action type: CUSTOM_NOTIFICATION_ACTIONwith the caller lacking the "Send Custom Notifications" permission. For that error, investigate the caller's permission rather than treating it as proof that the notification type definition is unsupported. See the REST action permission report. -
A successful
send()call does not prove that a recipient saw a notification. In a 2025 sandbox discussion, hourly notifications sent by scheduled Apex reportedly stopped appearing without exceptions. A response proposed two capacity explanations: an org-wide limit of 10,000 notification actions per hour, with excess actions' notifications lost rather than deferred and sending resuming the next hour; and a per-user notification-tray capacity of 10,000 notifications. The response described a purge above 7,500 entries that reduces the tray to 5,000 and runs at most once daily. These were possible explanations, not a confirmed diagnosis of the incident. They concern runtime delivery and recipient state, not an activation setting onCustomNotificationType. See the missing-notification discussion.
Common Questions
Can I retrieve all CustomNotificationType components with a wildcard?
No. This type does not support * in package.xml. List each required member explicitly in the manifest.
Does deploying CustomNotificationType send a notification?
No. Deployment creates or updates reusable notification configuration. Sending code separately supplies the message title, body, recipients, and navigation target.
Do I pass the developer name or record ID to setNotificationTypeId()?
Pass the runtime notification type record ID. The community Apex example queries CustomNotificationType by DeveloperName and uses the returned Id.
Does actionTarget control where a notification click takes the user?
No. The nested actionTarget names the Apex class implementing a mobile action. The sending code supplies the notification's navigation target separately.
Why are custom notifications missing even though send() throws no error?
A successful call is not proof of recipient visibility. In the reported sandbox incident, hourly action capacity and the recipient's notification-tray capacity were proposed as possible causes, but neither was confirmed as the diagnosis. Those conditions concern runtime delivery, not a metadata activation setting.