Create Named Credential
sf_create_named_credentialCreate a named credential to securely store endpoint and authentication details for callouts from Apex or Flows, preventing hardcoded credentials.
Instructions
Creates a Named Credential for making authenticated callouts to external systems from Apex or Flows. Named Credentials store the endpoint URL and authentication details securely, so developers don't hardcode credentials. Supports NoAuthentication, Basic (username/password), OAuth, and more. Use with sf_create_remote_site_setting to also allow the URL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | Display label | |
| endpoint | Yes | Endpoint URL, e.g. 'https://api.example.com' | |
| fullName | Yes | Named credential API name, e.g. 'My_External_API' | |
| password | No | Password for Password protocol (encrypted at rest) | |
| protocol | No | Authentication protocol | NoAuthentication |
| username | No | Username for Password protocol | |
| allowCallout | No | Allow callouts using this credential | |
| allowFormula | No | Allow formulas in HTTP body (enables merge fields) | |
| principalType | No | NamedUser: shared credentials. PerUserPrincipal: per-user OAuth. Anonymous: no auth. | NamedUser |