Skip to content
中文

Start a reserved template build

POST/sandbox/v1/templates/{templateID}/builds/{buildID}◐ Partial

Request parameters

  • templateIDstringrequired

    path: Template identifier from templates.create or templates.list. Use your organization's templateID, not a provider handle.

  • buildIDstringrequired

    path: Build identifier returned by templates.create. It must belong to the selected template in your organization.

  • fromImagestringoptional

    Image to use as a base for the template build

  • fromTemplatestringoptional

    Template to use as a base for the template build

  • fromImageRegistryobjectoptional

    Registry authentication. Unlike E2B, only the vault reference variant is accepted; plaintext aws, gcp and registry variants return 400. Cannot be used with official templates.

    Expand sub-fields (4)
    • typestringrequired

      vault resolves the password at build time without persisting its value.

      values vault
    • vaultIdstringrequired

      Vault ID containing the registry password, from vaults.list or vaults.create.

    • secretNamestringrequired

      Secret name in that vault containing the registry password.

    • usernamestringoptional

      Registry login username without whitespace; defaults to token.

  • forcebooleanoptional
    default false

    Whether the whole build should be forced to run regardless of the cache

  • stepsarrayoptional
    default []

    List of steps to execute in the template build

    Expand sub-fields (4)
    • typestringrequired

      Type of the step

    • argsarrayoptional
      default []

      Arguments for the step

    • filesHashstringoptional

      Hash of the files used in the step

    • forcebooleanoptional
      default false

      Whether the step should be forced to run regardless of the cache

  • startCmdstringoptional

    Start command to execute in the template after the build

  • readyCmdstringoptional

    Ready check command to execute in the template after the build

  • dockerfilestringoptional

    Dockerfile text, at most 64 KiB UTF-8. Mutually exclusive with fromImage, fromTemplate and steps. COPY/ADD are rejected; fetch remote content using RUN. Registry credentials require a nonofficial image in the first FROM.

Returns

202

Errors follow the E2B format — see error codes

Request

curl
curl https://api.deepraxis.com/sandbox/v1/templates/sbe_example/builds/sbt_example \
  -H "X-API-Key: $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dockerfile":"FROM praxis/base\nRUN echo template-reference"}'
Python
import requests

api_key = "$PRAXIS_API_KEY"

# templateID and buildID come from the preceding create response; replace the example IDs.
resp = requests.request("POST", "https://api.deepraxis.com/sandbox/v1/templates/sbe_example/builds/sbt_example",
    headers={"X-API-Key": api_key},
    json={"dockerfile":"FROM praxis/base\nRUN echo template-reference"},
)
print(resp.status_code, resp.text)
TypeScript
const apiKey = "$PRAXIS_API_KEY";

// templateID and buildID come from the preceding create response; replace the example IDs.
const resp = await fetch("https://api.deepraxis.com/sandbox/v1/templates/sbe_example/builds/sbt_example", { method: "POST",
  headers: { "X-API-Key": apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({"dockerfile":"FROM praxis/base\nRUN echo template-reference"}),
});
console.log(resp.status, await resp.text());

Response 202

{}

Response

HTTP 202

The build has started

No response body is declared.