Using sandboxes
A sandbox is a temporary copy of local project data that you can interact with. The actual project data remains unchanged.
One use case for a sandbox is for test suites. A sandbox allows you to begin each test run with the same data.
Sandboxes automatically expire and are deleted after an hour of inactivity. The expiration resets every time the sandbox is used.
Each account is limited to 10 active sandboxes across all workspaces and projects. To request an increase to that number, contact Tonic.ai.
Displaying your sandboxes
To display the list of active sandboxes, under API, click Sandboxes.

For each sandbox, the list includes:
Sandbox name.
When the sandbox was most recently used.
When the sandbox expires and will be deleted. The expiration is based on inactivity. The inactivity timer resets whenever you use the sandbox.

About the sandbox URL
The Sandboxes page displays a template sandbox URL for the current project. To copy the template URL, click the copy icon.
At a high level, the structure of a sandbox URL is:
https://<fabricate URL>/api/v1/workspaces/<workspace name>/projects/<project name>/versions/<project version>/sandboxes/<sandbox>/api
Where:
<fabricate URL>is the main URL for the Fabricate instance. For Fabricate Cloud, this is fabricate.tonic.ai.<workspace name>is the name of the workspace. In the workspace name, replace any spaces with%20. For example, the workspace nameFirst workspacebecomesFirst%20workspace.<project name>is the name of the project. In the project name, replace any spaces with%20. For example, the project nameFirst projectbecomesFirst%20project.<project version>is the version of the project to use.<sandbox>is the identifier of the sandbox.
Connecting to a sandbox
To connect to a sandbox, you call the sandbox URL.
The request must include a Fabricate API key as a bearer token in the Authorization header. The API key must have edit access to the project.
For example:
curl -H "Authorization: Bearer NIDgKxMs2tPzdeF5PRrayr28" "https://fabricate.tonic.ai/api/v1/workspaces/workspace1/projects/project1/versions/v1/sandboxes/sandbox1/api/patients"
Creating a sandbox
To create a sandbox, you connect to the sandbox URL with a new sandbox name.
When Fabricate detects the new name, it creates a sandbox with that name.
If your account already has the maximum allowed number of active sandboxes, then the request returns an error indicating that the sandbox cannot be created because of the limit.
If the call uses the name of an active sandbox, then Fabricate connects to that sandbox.
Deleting an active sandbox
Sandboxes expire and are deleted automatically after an hour.
Before that, to delete an active sandbox, on the Sandboxes page, click the delete icon for the sandbox.
Using REST API endpoints to manage sandboxes
You can also use REST API endpoints to create and manage sandboxes.
Base path
The base path for REST API requests is:
/api/v1/workspaces/{workspace}/projects/{project}[/versions/{version_label}]/sandboxes/
To refer to a specific sandbox:
/api/v1/workspaces/{workspace}/projects/{project}[/versions/{version_label}]/sandboxes/{sandbox_id}
Endpoints
The REST API includes the following endpoints:
GET .../sandboxes
Returns the list of active sandboxes.
PUT .../sandboxes/{sandbox_id}
If the sandbox identifier matches an active sandbox, returns the sandbox.
If the sandbox identifier does not match an active sandbox, creates the sandbox.
POST .../sandboxes/{sandbox_id}/reset
Resets the data in the sandbox.
DELETE .../sandboxes/{sandbox_id}
Deletes the sandbox.
Last updated
Was this helpful?