---
schema_version: "1"
id: 8f3b67a7c542afe303814585075daa1bbed30991f0e6d0243376dd9f02a8aaea
title: ApexEmailNotification
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_apexemailnotification.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apexemailnotification.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d5267be7d9c1a90f5e020e5099c847bd205a1d689feb6b3076aac2d1ab266f5a
description: Stores a Salesforce user ID or external email address to be notified when unhandled Apex exceptions occur. This object is available in API version 35.0 and later.
---
# ApexEmailNotification

Stores a Salesforce user ID or external email address to be notified when unhandled Apex exceptions occur. This object is available in API version 35.0 and later.

![Important](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/images/icon_note_important.png)

#### Important

System-generated emails from an unverified email-sending domain aren’t delivered, even if the From email address is verified. See [Requirements to Send Email from Salesforce](https://help.salesforce.com/s/articleView?id=xcloud.security_email_verification_requirements.htm&language=en_US&type=5).

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/images/icon_note.png)

#### Note

Each ApexEmailNotification contains either an email or a user ID, but not both.

## Supported SOAP API Calls

create(), delete(), describeSObjects(), query(), retrieve(), update(),upsert()

## Supported REST API Methods

DELETE, GET, HEAD, PATCH, POST, Query

## Fields

| Field | Details |
| --- | --- |
| Email | 
Type

string

Properties

Create, Filter, Group, idLookup, Nillable, Sort, Update

Description

The external email address to which the notification is sent. Mutually exclusive with the UserId field.



 |
| UserId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

ID of the user to which the notification is sent. Mutually exclusive with the Email field.

This is a relationship field.

Relationship Name

User

Relationship Type

Lookup

Refers To

User



 |

## Usage

To notify users of your org at the email addresses they have on record, use UserId. To notify external users or alternate email addresses, use Email.

#### See Also

- [_Apex Developer Guide_: Exceptions in Apex](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/apex_exception_definition.htm#unhandled_exception_emails "Apex Developer Guide: Exceptions in Apex - HTML (New Window)")