Access comprehensive Apex type information with the Apex Symbol API (beta). This Tooling API REST resource returns detailed metadata for built-in, custom, and dynamic Apex types, such as classes, interfaces, methods, and triggers. Use this API to power code completion in IDEs, provide context for AI agents generating Apex code, or ground setup agents answering admin questions about code.
Where: This feature is available in API version 68.0 and later. This feature is available in Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.
Why: The Apex Symbol API provides comprehensive Apex type metadata that enables richer experiences across development tools and AI-powered workflows. By exposing the same type information that the Apex compiler uses, the Apex Symbol API bridges the gaps in the existing /completions Tooling API endpoint and SymbolTable Tooling API object.
How: To retrieve Apex type information directly from the Tooling API REST resource,
send a GET request to the /services/data/vXX.0/tooling/symbols endpoint.
The endpoint requires the category query parameter, which takes one of these
values.
builtin: standard Apex typesdatabase: custom and packaged Apex typesdynamic: dynamic Apex types
For more targeted queries, use the optional namespace or
name query parameters. Filtering improves performance for large orgs and
provides a better experience for consumers that only need information about specific
namespaces, classes, or other Apex types.
For example, this request queries for the ApexPages class, which contains
built-in Apex types in the System namespace:
/services/data/v68.0/tooling/symbols?category=builtin&namespace=System&name=ApexPages
Here’s an excerpt of the JSON response for this request.
{
"typeStubs": [
{
"name": "ApexPages",
"namespacePrefix": "System",
"kind": "CLASS",
"modifiers": [
"global"
],
"annotations": [],
"superClass": null,
"interfaces": [],
"fields": [],
"properties": [],
"methods": [
{
"name": "addMessage",
"isConstructor": null,
"returnType": {
"namespacePrefix": null,
"name": "void",
"typeParameters": null
},
"modifiers": [
"global",
"static"
],
"annotations": [],
"parameters": [
{
"name": "message",
"type": {
"namespacePrefix": "ApexPages",
"name": "Message",
"typeParameters": null
},
"annotations": [],
"documentation": ""
}
],
"documentation": "Add a message to the current page context."
}
],
"innerTypes": [],
"triggerOperations": null,
"documentation": "Use ApexPages to add and check for messages associated...",
"triggerObjectType": null,
"compileError": null
}
]
}