---
schema_version: "1"
id: 77396d6e4548738db2a55ee48768de6b9ac92a056fc80a9578874a87d60f2d27
title: TransactionSecurityPolicy
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_transactionsecurity.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_transactionsecurity.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: aeae078cfac229a43655c9b4b760bb7be09af35f1febd6619b03a4d70a3f8311
description: Represents a transaction security policy definition.
---
# TransactionSecurityPolicy

Represents a transaction security policy definition.

This object is available in Tooling API version 35.0 and later.

## Supported Calls

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

## Supported REST Methods

Query, DELETE, GET, PATCH, POST

## Fields

<table class="featureTable sort_table" summary="">


          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d324898e103">Field</th>

              <th class="featureTableHeader  " id="d324898e106">Details</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">ActionConfig</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">textarea</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Create, Update</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Describes the action to take when the matching Transaction
                    Security policy is triggered. Also indicates the type of
                    notifications selected and the ID of the intended recipient. The
                    recipient must be active and assigned the Modify All Data and View
                    Setup user permissions. Multiple actions can be taken. The actions
                    available depend on the <span class="keyword parmname"><a class="xref" href="#txnsec_eventtypefield">EventType</a></span> field.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">ApexPolicyId</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Represents the Apex <samp class="codeph nolang">TxnSecurity.PolicyCondition</samp> or <samp class="codeph nolang">TxnSecurity.EventCondition</samp>
                    interface for this policy.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">BlockMessage</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The custom message a user receives when their action is blocked by
                    a policy. Used in Real-Time Event Monitoring only. Maximum of 1000
                    characters. This field appears as null when the default message
                    option is selected and is available only when
                    <span class="keyword parmname">EventName</span> is set to <samp class="codeph nolang">ApiEvent</samp>, <samp class="codeph nolang">ListViewEvent</samp>, and <samp class="codeph nolang">ReportEvent</samp>. Available in API
                    version 49.0 and later.
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">CustomEmailContent</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Nillable, Sort,</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The administrator-created custom email content sent when a policy
                    is triggered. Used in Real-Time Event Monitoring only. Maximum of
                    1333 characters. This field is null when the Custom Email Content
                    setting is selected in the UI but no message content is entered.
                    Available in API version 54.0 and later.<p class="p">Custom messages aren’t
                      translatable.</p>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">Description</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The description entered for this policy. This field available in
                    API 39.0 and later.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">DeveloperName</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group,
                    Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The API, or program name, for this policy.</dd>

                  <dd class="dd">
                    <div class="box message info">
                      <div class="inner">
                        <div class="bd">
                          <div class="media">
                            <img class="img mtm" src="https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/images/icon_note.png" alt="Note">
                            <div class="mediaBd">
                              <h4 class="mbs">Note</h4>
                              <p>Only users with View DeveloperName OR View Setup and
                                Configuration permission can view, group, sort, and filter this
                                field.</p>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>

                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">EventName</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Restricted picklist, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Used in Real-Time Event Monitoring only. Indicates the name of the
                    event the policy monitors. This field is available in API 31.0 and
                    later. Valid values are:<ul class="ul bulletList">
                      <li class="li">
                        <samp class="codeph nolang">ApiEvent</samp>—Tracks
                        these user-initiated read-only API calls: <samp class="codeph nolang">query()</samp>, <samp class="codeph nolang">queryMore()</samp>, and <samp class="codeph nolang">count()</samp>. Captures API
                        requests through SOAP API and Bulk API for the Enterprise and
                        Partner WSDLs. Tooling API calls and API calls originating
                        from a Salesforce mobile app aren’t captured.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">CredentialStuffingEventStore</samp>—Tracks when
                        a user successfully logs into Salesforce during an identified
                        credential stuffing attack. Credential stuffing refers to
                        large-scale automated login requests using stolen user
                        credentials.This value is available in API 49.0 and
                        later.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">FileEventStore</samp> (beta)—Tracks when a user
                        downloads, previews, or uploads a file. FileEventStore is a
                        big object that stores the event data of FileEvent. This
                        object is available in API version 57.0 and later.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">ListViewEvent</samp>—Tracks when users access data
                        with list views using Lightning Experience, Salesforce
                        Classic, or the API. It doesn’t track list views of Setup
                        entities.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">LoginAnomalyEventStore</samp>—Stores the
                        records of data access anomalies that are caused by
                        potentially malicious login actions.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">LoginAsEvent</samp>—Tracks the login
                        activity of admins who log in to Salesforce as other
                        users. This object is available in API version 46.0 and
                        later.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">LoginEvent</samp>—LoginEvent tracks the login
                        activity of users who log in to Salesforce.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">PermissionSetEventStore</samp>—Tracks changes to
                        permission sets and permission set groups.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">ReportAnomalyEventStore</samp>—Tracks anomalies in
                        how users run or export reports, including unsaved reports.
                        This value is available in API 49.0 and later.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">ReportEvent</samp>—Tracks when reports are
                        run in your org.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">SessionHijackingEventStore</samp>—Tracks when
                        unauthorized users gain ownership of a Salesforce user’s
                        session with a stolen session identifier. To detect such an
                        event, Salesforce evaluates how significantly a user’s
                        current browser fingerprint diverges from the previously
                        known fingerprint using a probabilistically inferred
                        significance of change. This value is available in API 49.0
                        and later.
                      </li>

                    </ul>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">EventType</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Restricted picklist, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Used in Legacy Transaction Security only. Indicates the type of
                    event the policy monitors. Valid values are:<ul class="ul bulletList">
                      <li class="li">
                        <samp class="codeph nolang">AccessResource</samp>—Notifies you when the
                        selected resource has been accessed.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">AuditTrail</samp>—Reserved for future use.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">DataExport</samp>—Notifies you when any API query
                        is made, such as from the Data Loader API client, or when a
                        Report export occurs.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">Entity</samp>—Notifies
                        you on use of an object type such as an authentication
                        provider or chatter post.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">Login</samp>—Notifies
                        you when a user logs in.
                      </li>

                    </ul>
                    <div class="box message info">
                      <div class="inner">
                        <div class="bd">
                          <div class="media">
                            <img class="img mtm" src="https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/images/icon_note.png" alt="Note">
                            <div class="mediaBd">
                              <h4 class="mbs">Note</h4>
                              <p>As of Summer '20, Legacy Transaction Security is a
                                retired feature in all Salesforce orgs.</p>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">ExecutionUserId</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">reference</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Used in Legacy Transaction Security only. The ID of an active user
                    who is assigned the Modify All Data and View Setup user
                    permissions.<div class="box message info">
                      <div class="inner">
                        <div class="bd">
                          <div class="media">
                            <img class="img mtm" src="https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/images/icon_note.png" alt="Note">
                            <div class="mediaBd">
                              <h4 class="mbs">Note</h4>
                              <p>As of Summer '20, Legacy Transaction Security
                                is a retired feature in all Salesforce orgs.</p>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">FullName</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Create, Group, Nillable</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The full name of the associated object in the Metadata API. Use to
                    avoid race conditions on create, before you have IDs.</dd>

                  <dd class="dd">Query this field only if the query result contains no more than
                    one record. Otherwise, an error is returned. If more than one
                    record exists, use multiple queries to retrieve the records. This
                    limit protects performance.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">ManageableState</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">ManageableState enumerated list</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Restricted picklist, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates the manageable state of the specified component that is
                    contained in a package: <ul class="ul bulletList">
                      <li class="li"><samp class="codeph nolang">beta</samp></li>

                      <li class="li"><samp class="codeph nolang">deleted</samp></li>

                      <li class="li"><samp class="codeph nolang" id="option_deprecated"><a name="option_deprecated"><!-- --></a>deprecated</samp></li>

                      <li class="li"><samp class="codeph nolang">deprecatedEditable</samp></li>

                      <li class="li"><samp class="codeph nolang">installed</samp></li>

                      <li class="li"><samp class="codeph nolang">installedEditable</samp></li>

                      <li class="li"><samp class="codeph nolang">released</samp></li>

                      <li class="li"><samp class="codeph nolang">unmanaged</samp></li>

                    </ul>
                  </dd>


                </dl>

                <p class="p">This field is available in API version 38.0 and later.</p>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">MasterLabel</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The policy’s name.<div class="box message confirm">
                      <div class="inner">
                        <div class="bd">
                          <div class="media">
                            <img class="img mtm" src="https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/images/icon_note_important.png" alt="Important">
                            <div class="mediaBd">
                              <h4 class="mbs">Important</h4>
                              <p>Where possible, we
                                changed noninclusive terms to align with our company value of
                                Equality. We maintained certain terms to avoid any effect on
                                customer implementations.</p>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">Metadata</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">mns:TransactionSecurityPolicy</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Create, Nillable, Update</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The policy’s metadata. See the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/meta_transactionsecurity.htm" target="_blank">Metadata API
                      Developer Guide</a> for details.</dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">NamespacePrefix</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The namespace prefix associated with this object. Each Developer
                    Edition organization that creates a managed package has a unique
                    namespace prefix. Limit: 15 characters. You can refer to a
                    component in a managed package by using the <samp class="codeph nolang"><var class="keyword varname">namespacePrefix</var>__<var class="keyword varname">componentName</var></samp>
                    notation. <p class="p">The namespace prefix can have one of the following
                      values:</p>
                    <ul class="ul bulletList">
                      <li class="li">In Developer Edition organizations, the namespace prefix is
                        set to the namespace prefix of the organization for all
                        objects that support it. There is an exception if an object
                        is in an installed managed package. In that case, the object
                        has the namespace prefix of the installed managed package.
                        This field’s value is the namespace prefix of the Developer
                        Edition organization of the package developer.</li>

                      <li class="li">In organizations that are not Developer Edition
                        organizations, <span class="keyword parmname">NamespacePrefix</span> is only
                        set for objects that are part of an installed managed
                        package. There is no namespace prefix for all other
                        objects.</li>

                    </ul>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">ResourceName</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">string</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Nillable, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Used in Legacy Transaction Security only. A resource used to
                    narrow down the conditions under which the policy triggers. For
                    example, with a <samp class="codeph nolang">DataExport</samp>
                    event, you can select a resource Lead to specifically monitor
                    export activity occurring on your Lead entities. The resources
                    available depend on the <span class="keyword parmname"><a class="xref" href="#txnsec_eventtypefield">EventType</a></span>
                    field.<div class="box message info">
                      <div class="inner">
                        <div class="bd">
                          <div class="media">
                            <img class="img mtm" src="https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/images/icon_note.png" alt="Note">
                            <div class="mediaBd">
                              <h4 class="mbs">Note</h4>
                              <p>As of Summer '20, Legacy Transaction Security is a
                                retired feature in all Salesforce orgs.</p>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">State</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Restricted picklist, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">Indicates whether the policy is active. Valid values are:<ul class="ul bulletList">
                      <li class="li"><samp class="codeph nolang">Disabled</samp></li>

                      <li class="li"><samp class="codeph nolang">Enabled</samp></li>

                    </ul>
                  </dd>


                </dl>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d324898e103" data-title="Field"><span class="keyword parmname">Type</span></td>

              <td class="entry" headers="d324898e106" data-title="Details">
                <dl class="dl detailList">

                  <dt class="dt dlterm">Type</dt>

                  <dd class="dd">picklist</dd>



                  <dt class="dt dlterm">Properties</dt>

                  <dd class="dd">Filter, Group, Restricted picklist, Sort</dd>



                  <dt class="dt dlterm">Description</dt>

                  <dd class="dd">The type of validation that the policy uses. The valid values are:<ul class="ul bulletList">
                      <li class="li">
                        <samp class="codeph nolang">CustomApexPolicy</samp>— Created with Apex
                        editor.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">CustomConditionBuilderPolicy</samp>— Created
                        with Condition Builder
                      </li>

                    </ul>
                    The default value is <samp class="codeph nolang">CustomApexPolicy</samp>.</dd>


                </dl>

              </td>

            </tr>

          </tbody>

        </table>