Manage an OAuth Named Credential
Here are some examples of things that you can do with named and external credentials.
- Refresh a token
- Delete user external credentials
Here’s how to programmatically refresh a token.
This method deletes the user external credentials, which store the encrypted access tokens used for named credential callouts. It doesn't delete the external credential itself. Apex can be used only to create a named credential, not edit or delete one.
- Apex Reference Guide: deleteCredential
- Blog: Understanding Named Credentials