Loading
Prepare for Email to Become the Default Login ExperienceRead More
Intermittent freezing when using using certain browser versionsRead More
Secure Your Salesforce Org
Create and Edit Custom Headers

Create and Edit Custom Headers

Use custom headers to make unique secure connections to external data sources.

Required Editions

Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience
Available in: all editions
User Permissions Needed
To view named credentials: View Setup and Configuration
To create, edit, or delete named credentials: Manage Named Credentials or Customize Applications

Before you create custom headers, note the following.

  • You can use custom headers in named credentials and external credentials. If you create custom headers for both, a single callout combines them.
  • Headers are sorted by source and sequence number. Headers from named credentials are placed before headers from external credentials.
  • Headers from named credentials overwrite headers from external credentials if the names duplicate.
  • Headers are allowed to have duplicate header names if they’re from the same source.

To create custom headers:

  1. From Setup, use the Quick Find box to find and select Named Credentials.
  2. Click either Named Credentials or External Credentials.
  3. If you’re creating a custom header, click New. If you’re editing an existing custom header, select Edit from the Actions menu dropdown for that header.
  4. Fill in the fields for the custom header.
    FieldDescription
    Name The name of the custom header for this credential.
    Value

    The value of the header, evaluated as a formula. For more on setting custom header values, see Use API Keys in Custom Headers with Named Credentials, Use Custom Headers for Basic Authentication with Named Credentials, and Use Named Credential Formula Functions in Custom Headers.

    If you’re using a formula in a custom header and you’ve chosen Named Principal as your identity type, don’t use $User in the formula.

    Sequence Number A number that determines the order in which headers are sent out in the callout. Headers with lower numbers are sent out first.
  5. Save the custom header.

By default, Salesforce generates a standard authorization header for each callout to a named-credential-defined endpoint. After you create a custom header, disable Generate Authorization Header in the associated named credential.

 
Loading
Salesforce Help | Article