I'm trying to create a developer tool that involves creating a scratch org programmatically. Is there a way to create a scratch org directly via the Salesforce API without using the sfdx CLI tool?

If so, which endpoint(s) can be used to create a scratch org?

Is the API that the sfdx CLI tool uses publicly accessible/documented?


You can use the ScratchOrgInfo object in the SOAP API to create and delete Scratch Orgs. This means you'll need a WSDL and some language that supports SOAP in order to do this.


The source code for sfdx is available via GitHub. Take a look there to see how it functions. No guarantee you'll find everything you need, but it's a good starting point.

Note that this was announced by Salesforce earlier this year.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.