4

I know how to create them manually through the interface (it is really easy) setup > sandbox > new sandbox > and follow the GUI.

Is there an API or a script that would allow me to create a sandbox other than using the GUI. I would like to call that API or script from our build server (Jenkins) and allocate the sandboxes that way.

2
3

You want SandboxInfo via the Tooling API against your production org.

Represents a sandbox.

SandboxInfo enqueues a sandbox for creation or refresh. A create operation on SandboxInfo represents creation of a new sandbox, and an update represents refresh of an existing sandbox. For every create or update, a SandboxProcess is automatically created and is used for monitoring the sandbox copy process.

Also check SandboxProcess:

Represents the sandbox copy process for a SandboxInfo record.

When you create a SandboxInfo record, a corresponding SandboxProcess record is created. The latest SandboxProcess record for a SandboxInfo record represents the current state of the sandbox.

These were introduced in Winter '16 to allow you to create and refresh sandboxes.

The SandboxInfo will need the Template ID from the Sandbox Template (PartitionLevelScheme - keyprefix 1ps).

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.