Build Custom Agent Actions using Apex REST (Beta)
Use generative AI to quickly create an OpenAPI document for your Apex REST class and activate the API for use in Agentforce. Deploy the class, the OpenAPI document, and associated metadata to your org’s API catalog. Then create an agent action in Agent Builder in your org that’s based on methods in the class.
Salesforce's OpenAPI Specification (OAS) generation feature uses the Agentforce for Developers extension. Agentforce for Developers is an AI-powered extension built using CodeGen
and xGen-Code
, secure, custom AI models from Salesforce. This feature generates OpenAPI v3 Specifications for Apex classes that define a REST resource. You can then deploy the generated OAS to add it to the Salesforce API catalog. The API then becomes available as custom actions and can be used by Agentforce agents to enhance their capabilities.
See these Additional Terms of Use.
To give us your feedback, log in to Trailhead and then join the Agentforce for Developers Trailblazer Community. Report issues in the Einstein-GPT-for-Developers GitHub repository.
- Exposing Apex Classes as REST Web Services
- Apex REST Code Samples
- Salesforce Help: API Catalog
- Trailhead: Apex Fundamentals for Developers
- Trailhead: Apex Integration Services
- OpenAPI: OpenAPI Specification 3.0.0