---
schema_version: "1"
id: a43de7a5344d8411872945aec42eafccb095fd55cad9c946b8ed8ab80dead141
title: Use Custom Headers with Credentials
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/nc_cred_custom_headers.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.nc_cred_custom_headers.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4071373c04d0a40268ae8c39bb88b9eaa98d123878ca73e6493c67fbf6542f32
description: Add custom headers to external credentials to cover more use cases and security requirements. With custom headers, you can set your own parameters for authentication.
products:
  - Security
release: "264"
---
# Use Custom Headers with Credentials

Add custom headers to external credentials to cover more use cases and security requirements. With custom headers, you can set your own parameters for authentication.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: all editions</td></tr></tbody></table>

Custom headers are a way for a remote system to define parameters it needs as input to respond to a request. Using a custom header is similar to having a function in a piece of code and defining input parameters or arguments that allow the caller to provide input.

You can add custom headers to named credentials and external credentials. In most cases, it’s best to associate headers with the external credential, rather than the named credential, because external credentials are meant to encapsulate authentication details. For example, define custom authorization headers in an external credential to use consistent authentication across all named credential endpoints using the same external credential.

- **[Use Cases for Custom Headers with Named Credentials](https://help.salesforce.com/s/articleView?id=xcloud.nc_custom_header_use_cases.htm&release=264.0.0&type=5)**  
    Custom headers are most often used for security or authentication purposes. The HTTP standard includes a commonly used, dedicated Authorization header. However, many use cases require something else. Two common use cases are per-user callouts and API keys.
- **[Create and Edit Custom Headers](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_custom_headers.htm&release=264.0.0&type=5)**  
    Use custom headers to make unique secure connections to external data sources.
- **[Use API Keys in Custom Headers with Named Credentials](https://help.salesforce.com/s/articleView?id=xcloud.nc_custom_headers_and_api_keys.htm&release=264.0.0&type=5)**  
    Web services often define their own authentication protocols using custom headers. For those cases, you can create a custom header for a named or external credential and use API keys as a password.
- **[Use Named Credential Formula Functions in Custom Headers](https://help.salesforce.com/s/articleView?id=xcloud.nc_named_creds_formula_functions.htm&release=264.0.0&type=5)**  
    Formula functions can be used in the value field of a custom header of a named credential or external credential.
- **[Use Custom Headers for Basic Authentication with Named Credentials](https://help.salesforce.com/s/articleView?id=xcloud.nc_custom_headers_basic_auth.htm&release=264.0.0&type=5)**  
    Create an external credential with a custom header that uses HTTP Basic authentication.

#### See Also

- [Named Credentials](https://help.salesforce.com/s/articleView?id=xcloud.named_credentials_about.htm&release=264.0.0&type=5 "Intended to secure and simplify authenticated API callouts to external systems, a named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. To streamline your Apex code and simplify the setup of authenticated callouts, specify a named credential as the callout endpoint.")
- [Create Named Credentials and External Credentials](https://help.salesforce.com/s/articleView?id=xcloud.nc_named_creds_and_ext_creds.htm&release=264.0.0&type=5 "To simplify the setup of authenticated callouts, create an external credential to specify an authentication protocol and then specify a named credential as the callout endpoint. Add custom headers to cover more use cases and security requirements. Use a permission set or profile to grant access so that users can make authenticated callouts. You can create and configure named credentials programmatically or through the Salesforce UI.")
- [_Apex Developer Guide_: Custom Headers and Bodies of Apex Callouts That Use Named Credentials](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_named_credentials_custom_headers_bodies.htm)