NamedCredential

Represents a named credential, which specifies the URL of a callout endpoint and its required authentication parameters in one definition. A named credential can be specified as an endpoint to simplify the setup of authenticated callouts. This object is available in API version 33.0 and later.

Supported Calls

describeSObjects()query()retrieve()

Fields

Field Name Details
AuthProviderId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
Salesforce ID of the authentication provider, which defines the service that provides the login process and approves access to the external system.

Only users with the “Customize Application” and “Manage AuthProviders” permissions can view this field.

This field is available in API version 39.0 and later.

CalloutOptionsAllowMergeFieldsInBody
Type
boolean
Properties
Filter
Description
For Apex callouts, indicates whether the code can use merge fields to populate HTTP request bodies with org data.

This field is available in API version 35.0 and later.

CalloutOptionsAllowMergeFieldsInHeader
Type
boolean
Properties
Filter
Description
For Apex callouts, indicates whether the code can use merge fields to populate HTTP headers with org data.

This field is available in API version 35.0 and later.

CalloutOptionsGenerateAuthorizationHeader
Type
boolean
Properties
Filter
Description
Indicates whether Salesforce automatically generates a standard authorization header for each callout to the named credential–defined endpoint.

This field is available in API version 35.0 and later.

DeveloperName
Type
string
Properties
Filter, Group, Sort
Description
The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object’s name in a managed package and the changes are reflected in a subscriber’s organization.
Endpoint
Type
textarea
Properties
Nillable
Description
The root URL of the endpoint.
Language
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The language of the MasterLabel.
MasterLabel
Type
string
Properties
Filter, Group, Sort
Description
The master label for the named credential. This display value is the internal label that doesn’t get translated.
NamespacePrefix
Type
string
Properties
Filter, Group, Nillable, Sort
Description
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 namespacePrefix__componentName notation.
PrincipalType
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
Tracks users who are accessing the external system. Anonymous implies that a user identity isn’t specified for external system access. Named Principal uses one user identity for all users to access the external system.

Usage

Use the NamedCredential object to query named credentials in your organization.

See Also