Newer Version Available
When to Use Tooling API
Tooling API facilitates the development of any organization-based user interface or user experience that requires create, read, update, or delete operations to Salesforce metadata. By contrast, Metadata API facilitates the migration of Salesforce metadata from one organization to another.
Perform CRUD Operations on Salesforce Metadata
To perform the following tasks, use Tooling API:
- Manage working copies of Apex classes and triggers and Visualforce pages and components using the ApexClassMember, ApexTriggerMember, ApexPageMember, ApexComponentMember, and MetadataContainer objects.
- Manage working copies of static resource files using the StaticResource object.
- Check for updates and errors in working copies of Apex classes and triggers and Visualforce pages and components using the ContainerAsyncRequest object.
- Commit changes to your organization using the ContainerAsyncRequest object.
- Set heap dump markers using the ApexExecutionOverlayAction object.
- Overlay Apex code or SOQL statements on an Apex execution using the ApexExecutionOverlayAction object.
- Execute anonymous Apex. For sample code, see Use Tooling API with SOAP and Use Tooling API with REST.
- To generate log files for yourself or for other users, set checkpoints with the TraceFlag object.
- Access debug log and heap dump files using the ApexLog and ApexExecutionOverlayResult objects.
- Manage custom fields on custom objects using the CustomField object.
- Access code coverage results using the ApexCodeCoverage, ApexOrgWideCoverage, and ApexCodeCoverageAggregate objects.
- Execute tests, and manage test results using the ApexTestQueueItem and ApexTestResult objects.
- Manage validation rules and workflow rules using the ValidationRule and WorkflowRule objects.
Select the Right Protocol for Your Application
Tooling API provides supports both SOAP and REST.
- Use REST API if you’re using a language that isn’t strongly typed, like JavaScript. See Use Tooling API with REST.
- Use SOAP API if you’re using a strongly typed language like Java that generates Web service client code. See Use Tooling API with SOAP.