Retrieve Apex Type Information with the Symbols Resource (Beta)
This Page
All Documentation
Use the Apex Symbol API to retrieve detailed metadata for built-in, custom, packaged, and dynamic Apex types, including classes, interfaces, enums, methods, and triggers. Available in API version 68.0 and later. This resource requires the Author Apex org permission and the View Setup user permission.
Syntax
Apex Symbol API is a pilot or beta service that is subject to the Beta Services Terms at Agreements and Terms or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer’s sole discretion.
Important
URI: /services/data/vXX.X/tooling/symbols/
HTTPS Method: GET
Authentication: Authorization: Bearer token
Format: JSON
Request Query Parameters
category
Type: String
Description: Required. The category of Apex types to retrieve.
Possible values:
builtin-standard Apex types, such as types in the System, Database, and Messaging namespaces.
database-custom and packaged Apex types.
dynamic-dynamic Apex types.
namespace
Type: String
Description: Optional. Filters the results to a specific namespace. To retrieve only types in the local org namespace, pass an empty string (namespace=). If this parameter is omitted, Apex types from all namespaces in the category are returned.
name
Type: String
Description: Optional. Filters the results to the specified Apex type name. If both namespace and name are specified, the results must match both conditions.
Request Body Properties
None.
Response Body Properties
typeStubs
Type: Object[]
Description: An array of Apex types. Each object describes one Apex class, interface, enum, or trigger, including members such as fields, properties, methods, annotations, and documentation when available.
Type Stubs Array
Each object in the typeStubs array can include these properties.
name
Type: String
Description: The developer name of the Apex type stub.
namespacePrefix
Type: String
Description: The namespace of the Apex type, or null if the type doesn’t have a namespace.
kind
Type: String
Description: The kind of Apex type. Possible values are CLASS, INTERFACE, ENUM, and TRIGGER.
modifiers
Type: String[]
Description: The modifiers applied to the type, such as public, global, virtual, or abstract.
annotations
Type: Object[]
Description: The annotations applied to the type, such as AuraEnabled, IsTest, or NamespaceAccessible.
superClass
Type: Object
Description: A type reference for the superclass, or null if the type doesn’t have a superclass.
interfaces
Type: Object[]
Description: Type references for interfaces implemented by the type.
fields
Type: Object[]
Description: The fields declared on the type. A field is a variable declared at the type level instead of inside a method.
properties
Type: Object[]
Description: The properties declared on the type.
methods
Type: Object[]
Description: The methods and constructors declared on the type.
innerTypes
Type: Object[]
Description: Nested Apex types declared within the type. Each nested type uses the same structure as a top-level type stub.
triggerOperations
Type: String[]
Description: For triggers, the trigger operations, such as BEFORE UPDATE. The value is null for non-trigger types.
documentation
Type: String
Description: Documentation for the type. For built-in types, this property can include official usage guidance. For custom types, this property can include ApexDoc comments. In API version 68.0, ApexDoc comments from managed packages aren’t returned.
triggerObjectType
Type: Object
Description: For triggers, a type reference for the sObject that the trigger is defined on. The value is null for non-trigger types.
compileError
Type: String
Description: A compilation error message if symbol extraction encountered a compile error for the type; otherwise, null.
Annotations Array
Each object in an annotations array can include these properties.
name
Type: String
Description: The annotation name.
parameters
Type: Object[]
Description: The annotation parameters.
documentation
Type: String
Description: Documentation for the annotation, if available.
Annotation Parameters Array
Each object in an annotation parameters array can include these properties.
name
Type: String
Description: The parameter name.
type
Type: Object
Description: A type reference for the parameter type.
value
Type: String
Description: The parameter value.
Fields Array
Each object in the fields array can include these properties.
name
Type: String
Description: The field name.
type
Type: Object
Description: A type reference for the field type.
modifiers
Type: String[]
Description: The field modifiers.
annotations
Type: Object[]
Description: The field annotations.
documentation
Type: String
Description: Documentation for the field, if available.
definingType
Type: Object
Description: A type reference for the Apex type that originally declares this field. This property is set only for inherited fields and is omitted when the field is declared directly on the enclosing type.
Properties Array
Each object in the properties array can include these properties.
name
Type: String
Description: The property name.
type
Type: Object
Description: A type reference for the property type.
modifiers
Type: String[]
Description: The property modifiers.
annotations
Type: Object[]
Description: The property annotations.
getter
Type: Object
Description: Present if the property has a get accessor. The object includes a modifiers array and a documentation property.
setter
Type: Object
Description: Present if the property has a set accessor. The object includes a modifiers array and a documentation property.
documentation
Type: String
Description: Documentation for the property, if available.
definingType
Type: Object
Description: A type reference for the Apex type that originally declares this property. This property is set only for inherited properties and is omitted when the property is declared directly on the enclosing type.
Methods Array
Each object in the methods array can include these properties.
name
Type: String
Description: The method or constructor name.
isConstructor
Type: Boolean
Description: true if the member is a constructor; otherwise, null.
returnType
Type: Object
Description: A type reference for the return type. The value is null for constructors.
modifiers
Type: String[]
Description: The method modifiers.
annotations
Type: Object[]
Description: The method annotations.
parameters
Type: Object[]
Description: The method parameters.
documentation
Type: String
Description: Documentation for the method, if available.
definingType
Type: Object
Description: A type reference for the Apex type that originally declares this method. This property is set only for inherited methods and is omitted when the method is declared directly on the enclosing type.
Method Parameters Array
Each object in a method parameters array can include these properties.
name
Type: String
Description: The parameter name.
type
Type: Object
Description: A type reference for the parameter type.
annotations
Type: Object[]
Description: The parameter annotations.
documentation
Type: String
Description: Documentation for the parameter, if available.
Type Reference Properties
Several response properties use a nested type reference object instead of returning a type as a string. This structure separates the type into parts that developer tools can consume.
Type references appear in these properties:
superClass
Objects in the interfaces array
The type property of a field or property
A method’s returnType property
The definingType property of an inherited field, method, or property
A parameter’s type property
triggerObjectType
Each type reference object can include these properties.
namespacePrefix
Type: String
Description: The namespace of the referenced type, or null if the type doesn’t have a namespace.
name
Type: String
Description: The name of the referenced type.
typeParameters
Type: Object[]
Description: Type references for generic type arguments, such as String in List<String>. The value is null if the type isn’t parameterized.
Usage
Use the Apex Symbol API to build tools that:
Provide code completion with full generic type support. For example, List<Account> displays with readable type parameters instead of internal encoding.
Display official documentation for built-in types, including usage guidance and examples.
Display ApexDoc comments for custom types.
Show constructor signatures with parameter types, annotations, and modifiers.
Identify trigger operations, such as before insert and after update, without parsing source code.
Access type information across all standard Apex namespaces, such as the System, Database, and Messaging namespaces.
Considerations
The API enforces a concurrency limit of one request per org. If a request is in progress and a second request is made for the same org, the second request fails. Avoid parallel calls to this API from the same org.
In API version 68.0, ApexDoc comments from managed packages aren’t returned. Packaged ApexDoc comments for global identifiers are planned for a later API version.
Example
Example Request: Retrieve the built-in ApexPages type in the System namespace.