Loading

System.CalloutException: The named callout URL is malformed After Summer '26 Upgrade

Publish Date: May 19, 2026
Description

After upgrading to Summer '26, Apex code that performs callouts using Named Credentials may throw the following exception:

Error: System.CalloutException: The named callout URL: 'callout:.__<NamedCredentialName>/...' is malformed

 

This error occurs when the "callout:" URL is constructed with a leading period (.) to represent an empty or null namespace, such as:

'callout:' + '.' + '__' + apiInfo.namedCredentialsApiName

 

The pattern "callout:.__<NamedCredentialName>" was accepted in Spring '26 but is no longer valid as of Summer '26.

Resolution

Update your Apex code to use an empty string ("") instead of "."when there is no namespace prefix. The correct pattern for a callout with no namespace is:

 

Before (incorrect):

      String url = 'callout:'

  1. + (apiInfo.namedCredentialsNamespacePrefix == null ? '.' : apiInfo.namedCredentialsNamespacePrefix)
  2. + '__'
  3. + apiInfo.namedCredentialsApiName;

After (correct):

     String url = 'callout:'

  1. + (apiInfo.namedCredentialsNamespacePrefix == null ? '' : apiInfo.namedCredentialsNamespacePrefix + '__')
  2. + apiInfo.namedCredentialsApiName;


Note:
 When no namespace prefix is present, the "__" separator should also be omitted. The correct form is simply "callout:<NamedCredentialName>".

Knowledge Article Number

005384626

 
Loading
Salesforce Help | Article