Difference between Tooling API and Metadata API

Tooling API is for developers. Metadata API is for admins/devops.

Tooling lets me work with developer artifacts (Apex classes, triggers, tests, logs) in real time.
Metadata lets me retrieve and deploy configuration (objects, fields, layouts, flows) as XML packages between orgs.”

Example:

  • Tooling API: In VS Code, when I open an Apex class and click “Save to Org”, it uses Tooling API to push the code and run tests.

  • Metadata API: When I move a Custom Object and its layout from sandbox to production, I run an sfdx force:mdapi:deploy which uses Metadata API.

Punch line:

“Tooling = edit/test developer code.
Metadata = deploy/retrieve org configuration.”


❓ Cross-question:

“If you need to deploy a new Flow and its custom fields, which API would you use?”

✅ You:

“Metadata API — because Flows and fields are configuration metadata, not developer code.”


❓ Cross-question:

“If you need to run Apex tests and retrieve code coverage?”

✅ You:

“Tooling API — only it exposes test execution and code coverage data.”


❓ Cross-question:

“Why wouldn’t you use Tooling API for deployments?”

✅ You:

“Because Tooling API isn’t designed to move configuration between orgs; it’s for working with developer assets inside an org. Metadata API is optimized for packaging and deploying config.”


0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post