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:
- From Setup, in the Quick Find box, enter Named Credentials, and then select Named Credentials.
- Click either Named Credentials or External Credentials.
- 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.
- Fill in the fields for the custom header.
Field Description 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
$Userin 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. - 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.

