Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

Named Query APIs for SOQL Queries

Use Named Query API to create custom Salesforce Object Query Language (SOQL) queries that you can expose in REST API calls. Decide what data you want to expose, then create Named Query APIs to return that data. You can create Named Query APIs in Setup or in Visual Studio Code (VS Code).

If you've enabled the beta to allow use of Named Query APIs as agent actions, you can create agent actions from Named Query APIs. To use Named Query APIs as agent actions, see the Agentforce Developer Guide.

If you've enabled the REST API OpenAPI Beta in your org, then you can download an OpenAPI document describing the REST API that the Named Query API is exposed on. See the OpenAPI beta documentation.

OpenAPI specification documents may not accurately represent Named Query APIs.

Note