---
schema_version: "1"
id: 1e1ce43e65ef31758879089acf89cd4f9cfd2f2298e7e3f95f853b2658e3c91f
title: CspTrustedSite
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_tooling/tooling_api_objects_csptrustedsite.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_csptrustedsite.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 42066b584aa990839f7a06d5f76198d7f69112814d6db9b3ee8914701f46a674
description: Represents a trusted URL. For each CspTrustedSite, you can specify Content Security Policy (CSP) directives and permissions policy directives. Each CSP directive allows Lightning components, third-party APIs, and WebSocket connections to access a resource type from the trusted URL. If the Permissions-Policy HTTP header is enabled, each permissions policy directive grants the trusted URL access to a browser feature. In API version 58.0 and earlier, CspTrustedSite included only CSP directives and was referred to as CSP Trusted Sites in Salesforce Setup. Available in API version 39.0 and later.
---
# CspTrustedSite

Represents a trusted URL. For each CspTrustedSite, you can specify Content Security Policy (CSP) directives and permissions policy directives. Each CSP directive allows Lightning components, third-party APIs, and WebSocket connections to access a resource type from the trusted URL. If the Permissions-Policy HTTP header is enabled, each permissions policy directive grants the trusted URL access to a browser feature. In API version 58.0 and earlier, CspTrustedSite included only CSP directives and was referred to as CSP Trusted Sites in Salesforce Setup. Available in API version 39.0 and later.

## Supported SOAP Calls

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

## Supported REST HTTP Methods

GET

## Limitations

[SOQL Limitations](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/reference_objects_soql_limits.htm "Some Tooling API objects have SOQL limitations. These limitations apply to any Metadata Catalog query, which applies to all Custom Metadata Types and Metadata Catalog entities, not only the ones explicitly listed.")

[SOSL Limitations](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/reference_objects_sosl_limits.htm "Two Tooling API objects, EntityDefinition and FieldDefinition, have some SOSL limitations. ExternalString and MetadataComponentDependency (Beta) don’t support SOSL searches.")

## Fields

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



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

              <th class="featureTableHeader  " id="d71207e118">Field Type</th>

              <th class="featureTableHeader  " id="d71207e121">Description</th>

            </tr>

          </thead>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether this CspTrustedSite can access the user’s
                camera (<samp class="codeph nolang">true</samp>) or not (<samp class="codeph nolang">false</samp>). The default value is
                <samp class="codeph nolang">false</samp>.<p class="p">This field takes
                  effect only when the
                  <span class="keyword parmname">enablePermissionsPolicy</span> field equals
                  <samp class="codeph nolang">true</samp> and the
                  <span class="keyword parmname">grantCameraAccess</span> field equals <samp class="codeph nolang">TrustedUrls</samp> in the SecuritySettings metadata API
                  type.
                </p>
                <p class="p">This field is available in API version 59.0 and
                  later.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether this CspTrustedSite can access the user’s
                microphone (<samp class="codeph nolang">true</samp>) or not
                (<samp class="codeph nolang">false</samp>). The default value
                is <samp class="codeph nolang">false</samp>.<p class="p">This field takes
                  effect only when the
                  <span class="keyword parmname">enablePermissionsPolicy</span> field equals
                  <samp class="codeph nolang">true</samp> and the
                  <span class="keyword parmname">grantMicrophoneAccess</span> field equals
                  <samp class="codeph nolang">TrustedUrls</samp> in the
                  SecuritySettings metadata API
                  type.
                </p>
                <p class="p">This field is available in API version 59.0 and
                  later.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">CspTrustedSiteContext (enumeration of type string)</td>

              <td class="entry" headers="d71207e121" data-title="Description">Declares the scope of the CSP directives for the trusted URL.<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">All</samp>—Apply the
                    CSP directives to all supported context types.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">Communities</samp>—Apply the CSP directives to
                    Experience Builder sites only.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">FieldServiceMobileExtension</samp>—Apply the
                    CSP directives to the Field Service Mobile Extensions only.
                    Available in API version 47.0 and later.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">LEX</samp>—Apply the
                    CSP directives to Lightning Experience only.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">LightningOut</samp>—Reserved
                    for future use. Available in API version 64.0 and later
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">VisualForce</samp>—Apply the CSP directives to
                    custom Visualforce pages only. Available in API version 55.0
                    and later.
                  </li>

                </ul>
                <p class="p">For custom Visualforce pages, content is restricted to
                  trusted URLs only if the page’s <samp class="codeph nolang">cspHeader</samp> attribute is set to <samp class="codeph nolang">true</samp>.</p>
                <p class="p">This field is
                  available in API version 44.0 and later.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">string</td>

              <td class="entry" headers="d71207e121" data-title="Description">The description of this trusted URL.</td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">string</td>

              <td class="entry" headers="d71207e121" data-title="Description">Required. The URL for this CspTrustedSite.<a name="ul_nmd_kwn_fkc"><!-- --></a>
                <ul class="ul bulletList" id="ul_nmd_kwn_fkc">
                  <li class="li">This field must include a domain name and can include a
                    port. For example, <samp class="codeph nolang">https://example.com</samp> or <samp class="codeph nolang">https://example.com:8080</samp>.
                    To reduce repetition, you can use the wildcard character
                    <samp class="codeph nolang">*</samp> (asterisk). For
                    example, <samp class="codeph nolang">*.example.com</samp>.<p class="p">Don't include placeholders or
                      invalid characters. For example, don't use <samp class="codeph nolang">malformed^url.example.com</samp>, and <samp class="codeph nolang">https://{subdomain}.example.com</samp>. </p>
                  </li>

                  <li class="li">For a third-party API, the URL must begin with https://. For
                    example, <samp class="codeph nolang">https://example.com</samp>.</li>

                  <li class="li">For a WebSocket connection, the URL must begin with wss://.
                    For example, <span class="ph filepath">wss://example.com</span>.</li>

                  <li class="li">For a Chrome extension, use the 32-character extension ID in
                    the format<samp class="codeph nolang">
                      chrome-extension://abcdefghijklmnopabcdefghijklmnop</samp>.
                    The ID can contain only lowercase letters a–p. Wildcards
                    aren’t supported in Chrome extension URIs.</li>

                </ul>
                <p class="p">Before February 2025, it was possible to save a malformed
                  URL. Malformed URLs are excluded from generated CSP HTTP
                  headers. To keep your Trusted URLs list accurate, remove any
                  malformed entries. You can use an Apex class to find all
                  malformed URLs. See the knowledge article, <a class="xref" href="https://help.salesforce.com/s/articleView?id=005317938&amp;type=1&amp;language=en_US" target="_blank">Identify Malformed Trusted
                    URLs</a>.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether this CspTrustedSite is active (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). The default value is <samp class="codeph nolang">true</samp>.</td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether Lightning components, third-party APIs, and
                WebSocket connections can load URLs using script interfaces from
                this trusted URL (<samp class="codeph java">true</samp>) or not
                (<samp class="codeph java">false</samp>). This field has a
                default value of <samp class="codeph java">false</samp>.<p class="p">This
                  field is available in API version 48.0 and later.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether Lightning components, third-party APIs, and
                WebSocket connections can load fonts from this trusted URL (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). This field is available in
                API version 48.0 and later.</td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether Lightning components, third-party APIs, and
                WebSocket connections can load resources contained in <samp class="codeph nolang">&lt;iframe&gt;</samp> elements from this
                trusted URL (<samp class="codeph java">true</samp>) or not
                (<samp class="codeph java">false</samp>). This field has a
                default value of <samp class="codeph java">false</samp>.<p class="p">This
                  field is available in API version 48.0 and later.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether Lightning components, third-party APIs, and
                WebSocket connections can load images from this trusted URL (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). This field has a default
                value of <samp class="codeph java">false</samp>.<p class="p">This field is
                  available in API version 48.0 and later.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether Lightning components, third-party APIs, and
                WebSocket connections can load audio and video from this trusted URL
                (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). This field has a default
                value of <samp class="codeph java">false</samp>.<p class="p">This field is
                  available in API version 48.0 and later.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">boolean</td>

              <td class="entry" headers="d71207e121" data-title="Description">Indicates whether Lightning components, third-party APIs, and
                WebSocket connections can load style sheets from this trusted URL
                (<samp class="codeph java">true</samp>) or not (<samp class="codeph java">false</samp>). This field has a default
                value of <samp class="codeph java">false</samp>.<p class="p">This field is
                  available in API version 48.0 and later.</p>
              </td>

            </tr>

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

              <td class="entry" headers="d71207e118" data-title="Field Type">string</td>

              <td class="entry" headers="d71207e121" data-title="Description">Reserved for future use.</td>

            </tr>

          </tbody>

        </table>

## Usage

For each CSPTrustedSite, at least one field starting with grantAccess or isApplicableTo must be set to true.

In API versions 50.0 to 58.0, if all isApplicable fields are false, the isApplicableToImgSrc field is set to true. In API version 49.0 and earlier, if all isApplicable fields are false, those fields all default to true.

To ensure smooth integration across Salesforce products, Salesforce includes URLs in each of the CSP directives that correspond to the isApplicable fields, even though those URLs aren’t defined as CspTrustedSite components. Salesforce regularly updates those URLs based on the latest requirements.