How to validate a package xml using Metadata API? Similar to what we do with changesets. First we validate, then we deploy. If I need to validate a list of apex classes and vf pages, how can I do so using metadata API?

1 Answer 1


If you're using ANT, you need to set checkOnly=true in your build.xml file.

If you're using the sfdx tool with mdapi:deploy, you can pass the --checkonly flag:


If you're calling the Metadata API yourself, the DeployOptions on your deploy() call need to have checkOnly set to true:


  • Yes, I was working with metadata APIs and the checkOnly = true works. Thanks! Mar 7, 2018 at 10:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .