Update or Delete an OAuth Named Credential

Here are some examples of how you can update or delete a credential from Apex. These code examples reference and build on the Apex code in Create an OAuth Named Credential which creates a named credential that connects to GitHub.

In this example, the auth provider authorization URL is updated.

In this example, the external credential’s scope for GitHub access is updated to full.

In this example, the named credential’s callout URL is updated.