Skip to content
中文

Start a reserved template build

POST/e2b/v2/templates/{templateID}/builds/{buildID}◐ Partial

Request parameters

  • templateIDstringrequired

    path:

  • buildIDstringrequired

    path:

  • fromImagestringoptional

    Image to use as a base for the template build

  • fromTemplatestringoptional

    Template to use as a base for the template build

  • fromImageRegistryobjectoptional
    Expand sub-fields (7)

    按 type 区分(aws / gcp / registry),此处展开其中一种的形状

    • typestringrequired

      Type of registry authentication

      values awsgcpregistry
    • awsAccessKeyIdstringoptional

      AWS Access Key ID for ECR authentication Required when type is aws. Not used when type is gcp, registry.

    • awsSecretAccessKeystringoptional

      AWS Secret Access Key for ECR authentication Required when type is aws. Not used when type is gcp, registry.

    • awsRegionstringoptional

      AWS Region where the ECR registry is located Required when type is aws. Not used when type is gcp, registry.

    • serviceAccountJsonstringoptional

      Service Account JSON for GCP authentication Required when type is gcp. Not used when type is aws, registry.

    • usernamestringoptional

      Username to use for the registry Required when type is registry. Not used when type is aws, gcp.

    • passwordstringoptional

      Password to use for the registry Required when type is registry. Not used when type is aws, gcp.

  • 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

Returns

202

Errors follow the E2B format — see error codes

Request

curl
curl https://api.deepraxis.com/e2b/v2/templates/sbe_example/builds/sbt_example \
  -H "X-API-Key: $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fromTemplate":"base","steps":[{"type":"RUN","args":["echo template-reference"]}]}'
Python
import requests

opts = dict(
    api_key="$PRAXIS_API_KEY",
    api_url="https://api.deepraxis.com/e2b",
    domain="sandbox.praxisusercontent.com",
)

# templateID and buildID come from the preceding create response; replace the example IDs.
resp = requests.request("POST", opts["api_url"] + "/v2/templates/sbe_example/builds/sbt_example",
    headers={"X-API-Key": opts["api_key"]},
    json={"fromTemplate":"base","steps":[{"type":"RUN","args":["echo template-reference"]}]},
)
print(resp.status_code, resp.text)
TypeScript
const opts = {
  apiKey: "$PRAXIS_API_KEY",
  apiUrl: "https://api.deepraxis.com/e2b",
  domain: "sandbox.praxisusercontent.com",
};

// templateID and buildID come from the preceding create response; replace the example IDs.
const resp = await fetch(opts.apiUrl + "/v2/templates/sbe_example/builds/sbt_example", { method: "POST",
  headers: { "X-API-Key": opts.apiKey, "Content-Type": "application/json" },
  body: JSON.stringify({"fromTemplate":"base","steps":[{"type":"RUN","args":["echo template-reference"]}]}),
});
console.log(resp.status, await resp.text());

Response 202

{}

Response

HTTP 202

The build has started

No response body is declared.