Time-to-Live (TTL) for On-Demand Sandboxes

When you create an on-demand sandbox, you can configure an optional Time-to-Live (TTL) value that specifies how many hours the sandbox exists. For example, if the sandbox has a TTL of 24, the sandbox lasts for 24 hours and then is automatically deleted.

TTL for a Sandbox

The maximum allowed TTL for a sandbox is 2160 hours. A sandbox with a TTL value of 0 or less lasts until it is deleted.

Important: When the TTL value for a sandbox is reached, the sandbox is permanently deleted. Data from the sandbox is no longer available.

This snippet from the JSON body of a POST/sandboxes API call to create a sandbox sets the TTL value of the sandbox to 100 hours.

{
  "realm": "<your realm id>",
  "ttl": 100,
  
      }
   

After a sandbox is created, you can change its TTL value using a PATCH/sandboxes API call. This snippet from the JSON body of a PATCH/sandboxes{sandboxId} API call updates the TTL to 0, specifying that the sandbox lasts until it is explicitly deleted using a DELETE /sandboxes/{sandboxId} call.

{
  
  "ttl": 0,
  
      }
   

In the B2C Commerce Developer Sandbox REST API Swagger UI, the example to create a sandbox with a POST/sandboxes API call uses a TTL value of 24. If you don't change the TTL in the example request body, the sandbox is created with a TTL of 24 hours. To use a different TTL, update the ttl value in the Example before clicking Try it out.

TTL for the Realm

Every realm has settings for default TTL and maximum TTL for all sandboxes in the realm. Every realm comes with its default TTL set to 24 hours. To change the default TTL for the realm, use a PATCH/realms/{realm}/configuration API call or override the realm default for any sandbox in the realm by setting the TTL for that sandbox to a different value.

The default maximum TTL setting for a realm is 0, indicating that no maximum has been set. You can set a maximum TTL, up to 2160 hours, for all sandboxes in the realm using a PATCH/realms/{realm}/configuration API call. When a default maximum TTL is set for the realm, you get an error if you try to create a sandbox in the realm with a TTL higher than the maximum.

Best Practices for TTL

If you need a sandbox for a defined short-term use, best practice is to specify a TTL that covers only the time required. If you need a sandbox for a project with an uncertain end date, configure the TTL as 0 or less so that the sandbox lasts until you delete it, or use a large TTL, such as 2100 hours, but then manually delete the sandbox when the project is completed.

In the B2C Commerce Developer Sandbox REST API Swagger UI, the example to create a sandbox with a POST/sandboxes API call uses a TTL value of 24. If you use the Try it out feature to create a sandbox from the Swagger UI and don't change the TTL in the example request body, the sandbox is created with a TTL of 24 hours. To use a different TTL, update the ttl value in the Example before clicking Try it out.

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. By continuing to use this site you are giving us your consent to do this.