A Salesforce Agent(force) API Utility
Salesforce's Agent API requires specific setup including Connected Apps, Named and External Credentials, and Integration Users, which can be repetitive and tedious, especially in temporary orgs. This utility automates the metadata creation and offers a UI for testing Agent API calls directly from Apex, saving time and simplifying multi-org compatibility. It supports JWT-based authentication and facilitates testing and debugging with features like session management and feedback submission. While not intended for production scalability, it provides a practical way to explore and test the API’s capabilities efficiently.
- Automate Connected App and Named Credential setup for Agent API with the utility.
- Use JWT Bearer Token flow to authenticate Agent API calls securely.
- Leverage the utility’s UI for testing session management and messaging.
- Configure multi-org connections for Agent API with named credentials and connected apps.
- Utilize provided Apex methods for programmatic Agent API interactions.
A utility to create all required API connection metadata in a few clicks combined with a UI to test the Agentforce API responses Salesforce released the Agent API just after the Spring ’25 release. It has been officially announced GA at the TDX25 keynote . To work with the API you need to set up a Connected App and Integration User on the org where your Agent is configured. In order to call the API from Apex we need a Named and External Credential with the required Permission Set and allowed user set up. This set up is not complex but it can all be a little bit tedious to do, especially in test / scratch orgs that are short lived. So I created a utility that can do this with a few click, so you can focus on testing rather than repeatedly having to set up connected apps and named credentials. See the “ Declaratively Connect Salesforce to Salesforce with the “new” Named and External Credentials JWT Bearer Flow ” article if you’re interested in the details of what I have automated.