Make POST call to endpoint (/services/data/v58.0/named-credentials/external-credentials/
) with below JSON body to create external credential.
{
"authenticationProtocol": "Custom",
"customHeaders": [],
"developerName": "Test2",
"masterLabel": "Test",