Learning resourcesReviewed · E2B

E2B sandbox lifecycle webhooks (documentation page)

This E2B documentation page explains sandbox lifecycle webhooks for developers who want their servers to receive notifications when their E2B sandboxes change state. The documented events cover a sandbox being created, updated, paused, resumed, checkpointed or killed. The main catch is that every management request needs an E2B project API key, and the page does not state pricing, rate limits, timeout duration or retry timing. It documents a REST API at [https://api.e2b.app/events/webhooks] for managing webhooks, a JSON event payload with a v2 version field, and an e2b-signature header for verifying requests. Each webhook delivery is attempted up to three times in total, so the same event can arrive more than once.

Researched 15 Nov 2026

In short.

This E2B documentation page explains sandbox lifecycle webhooks for developers who want their servers to receive notifications when their E2B sandboxes change state. It is a reference page for having your own server notified of these changes instead of polling. The main catch is that the page leaves out several operational details: pricing or plan limits, timeout duration, retry spacing, ordering guarantees and the response shape for registration. It documents five management operations on [https://api.e2b.app/events/webhooks] (register, list, get, update, delete). Each one is authenticated with an X-API-Key header that carries the project API key. Events are delivered as POST requests with a JSON body (version v2) and an e2b-signature header. The signature is a base64 SHA-256 of the secret joined to the raw body, with trailing = padding removed. Each webhook delivery is attempted up to three times in total. A 4xx or 5xx response, a timeout or a network error counts as a failed attempt, which can be retried within that limit, so handlers must tolerate duplicates. Six event types can be subscribed to: created, updated, killed, paused, resumed and checkpointed. Nothing was run or tested. The endpoints, fields, event types and delivery rules above are documented on the single captured page. Its code examples were not executed. The judgements about gaps, and any recommendations, are this report's own assessment rather than statements from the page.

Researched and written by an AI model and checked by a second AI model. How it works

The scope is the single documentation page at [https://docs.e2b.dev/sandbox/lifecycle-events-webhooks.md], captured in full as selected-page.txt (13,242 bytes) on 2026-11-15. Pages linked from it were not read. These include the API key, filesystem-only snapshots, persistence, resume-without-memory and snapshots pages, and the documentation index at [https://docs.e2b.dev/llms.txt]. The page also refers to a lifecycle events API, through which each event remains available for events_ttl_days. It does not link to that API or give any details of it, so the API is not covered here. No licence or terms text was captured. No code, API call or webhook delivery was executed or tested. Behaviour such as signature verification, retries and payload contents is therefore described only as documented, and the page's code examples remain unverified.

The overview

What this resource is

This E2B documentation page explains sandbox lifecycle webhooks for developers who want their servers to receive notifications when their E2B sandboxes change state. The page is titled Sandbox lifecycle webhooks and is at [https://docs.e2b.dev/sandbox/lifecycle-events-webhooks.md]. It describes HTTP webhooks that notify an external web server when certain sandbox lifecycle events occur. It says this lets you get updates about sandbox creation, updates and termination without polling the API.

It is documentation, not software you install. The captured page carries a note pointing to a full documentation index at [https://docs.e2b.dev/llms.txt]. It shows no version number or author for the page itself. The payload it describes carries a version field with the value v2.

Overall assessment

As a reference for this one feature, the page is compact and concrete. It gives the endpoint, HTTP verbs, header names, a full sample payload, enumerated values for several fields, signature-verification examples in three languages that were not executed, and an explicit warning that deliveries can repeat. It documents the management operations, payloads and verification examples a developer needs to start building a receiver. Whether a receiver built from it works correctly, and whether the examples are correct as written, remains unverified.

The gaps matter for production use. The page does not state the delivery timeout duration, the delay between retries, ordering guarantees, rate limits, the number of webhooks allowed per project, whether the signature secret is required, or what the registration response returns. The documented signature scheme is a plain hash of the secret and body rather than an HMAC, and the page describes no replay protection. These are observations about what the page documents, not security findings from testing.

Who it is for

The page is for developers and platform teams who already use, or plan to use, E2B sandboxes and need to react to sandbox state changes in their own backend. Examples are logging sandbox runtime and size, cleaning up related resources when a sandbox is killed, or tracking pause and resume behaviour.

It assumes comfort with HTTP APIs and JSON. An endpoint reachable by E2B must accept POST requests containing JSON. The examples use HTTPS, but the page does not specify HTTPS requirements or public-access restrictions. It is not a beginner tutorial on E2B itself and does not explain what a sandbox or template is. It links to other pages, such as the API key, snapshot and persistence pages. Those pages were not captured, so their contents are unknown here.

What the feature can do

Management operations: register a webhook with POST, list all webhooks for the project with GET, read one webhook by ID with GET, update one with PATCH, and delete one with DELETE. A webhook has a name, a url, an enabled flag, a list of events and a signatureSecret. The page says a webhook is registered for the project tied to the API key. The sample GET response shows id, teamId, name, createdAt, enabled, url and events.

Event types: sandbox.lifecycle.created, killed, updated, paused, resumed and checkpointed. The checkpointed event means a snapshot was created.

Payload content: the event id, version, type, timestamp, event category and label, sandbox identifiers (sandbox, execution, template, build and team), custom sandbox_metadata key-value pairs, and an events_ttl_days retention value. Some events carry extra data. Killed and paused events carry an execution object with started_at, vcpu_count, memory_mb and execution_time in milliseconds. Killed events carry a kill_reason. Documented possible kill_reason values include request, timeout, admin, orphaned, base_template_missing, seal_failed, resume_failed and unknown. Paused events carry pause_mode, either full or filesystem. Resumed events carry resume_mode, either restore or reboot.

The page notes that pause_mode records the snapshot actually taken, not the one requested. A memory auto-pause that keeps being refused falls back to a filesystem-only pause, and the event then says filesystem. Events recorded before pause_mode and resume_mode were added lack those fields. The page says to treat a missing value as unknown, not as full or restore.

Using it

Requirements

Stated by the page: an E2B project API key, sent in the X-API-Key header on every management request. An endpoint reachable by E2B must accept POST requests containing JSON. The examples use HTTPS, but the page does not specify HTTPS requirements or public-access restrictions. To verify signatures you also need the secret you passed as signatureSecret when registering the webhook.

Dependencies shown in the examples: for management calls, fetch in JavaScript and TypeScript and the requests library in Python. For signature verification, node:crypto in JavaScript and TypeScript, hashlib and base64 in Python, and crypto/sha256, encoding/base64, fmt and strings in Go. The page does not specify installation requirements or supported runtime versions.

Not stated: the required plan or tier, IP allow-listing information, URL restrictions, and where to find the webhook ID after registration. The registration example only checks for a 201 status and does not show the response body. The other examples use a webhookID variable without saying how it is obtained. Listing webhooks may return IDs, but the page does not show that response.

How it works

You register a webhook through the REST API with the event types you want. When one of those events occurs for a sandbox in your project, E2B sends a POST with the JSON payload to your URL. Each request carries four headers. e2b-webhook-id names the webhook that fired. e2b-delivery-id is unique per delivery attempt and gets a new value on each retry of the same event. e2b-signature-version is currently always v1 and is reserved for future use. e2b-signature holds the signature.

Signature scheme as documented: concatenate the secret and the request body, secret first, compute SHA-256, encode the digest as base64 and strip trailing = characters. The result should equal the e2b-signature header. The JavaScript and Python examples name their input as the raw body (webhookBodyRaw, webhook_body_raw), which points to hashing the body exactly as received. All three examples compare with ordinary string equality. Using a constant-time comparison instead is an additional recommendation that the page does not make, and its basis is not verified by this evidence. The page does not describe a timestamp header or replay protection.

Delivery: each webhook delivery is attempted up to three times in total. An attempt counts as failed if the endpoint returns a 4xx or 5xx status, the request times out, or a network error occurs. Failed attempts can be retried within that limit. The page lists only those failure conditions, does not say how 2xx or 3xx responses are treated, and gives no timeout length or retry interval. Because retries can produce duplicates, the page says to make handlers idempotent and to deduplicate on the payload id field.

Updates: according to the page, the PATCH operation replaces the previous configuration fields with the fields you provide. The sample sends url, enabled and events. The page says nothing beyond that sentence about whether omitted fields keep their old values.

Setup steps the page supports

First, get your E2B project API key. The page links to its API key page, which was not captured. Second, set up an endpoint reachable by E2B that accepts POST requests containing JSON. Using HTTPS, as all the page's examples do, is a recommendation; the page does not specify HTTPS requirements or public-access restrictions. Third, send a POST to [https://api.e2b.app/events/webhooks] with the X-API-Key header and a JSON body holding name, url, enabled, events and signatureSecret. A 201 status means the webhook was registered. Fourth, in your handler, read the raw body and the e2b-signature header, recompute the signature with your secret, and reject mismatches. Fifth, deduplicate on the payload id, then act on type and event_data. Finally, use GET, PATCH and DELETE on [https://api.e2b.app/events/webhooks/{webhookID}] to inspect, change or remove the webhook.

The page gives each management call in JavaScript and TypeScript and in Python. It gives signature verification in JavaScript and TypeScript, Python and Go. None of this was executed, so it is unverified whether these snippets work as written.

Worked example built from the page

Suppose a team wants to record how long each sandbox ran and why it ended. It registers a webhook with events set to sandbox.lifecycle.created and sandbox.lifecycle.killed and a signatureSecret of its choosing. Its receiver recomputes the base64 SHA-256 of the secret plus the raw body and compares it with e2b-signature. On a mismatch it returns a 4xx, which the page treats as a failed attempt that can be retried. It then checks whether the payload id was already stored. If not, it saves sandbox_id and type. For killed events it also saves event_data.kill_reason, event_data.execution.execution_time (milliseconds), event_data.execution.vcpu_count and event_data.execution.memory_mb. It then returns a 2xx.

The sample payload on the page is illustrative. Its started_at and timestamp are one minute apart while execution_time is 1000 ms, and the type field is a placeholder. The page does not show real values, and it does not show payloads for created, updated, resumed or checkpointed events. This walkthrough is a reading of the documentation and was not run.

Assessment & evidence

Limitations and unknowns

Not documented on this page: delivery timeout duration, retry spacing, ordering guarantees, rate limits, the maximum number of webhooks per project, secret requirements and length, the registration response body, payload samples for events other than killed, how event types map to event_label values (only kill is shown), and any replay protection. The page also does not cover how to find the webhook ID, the error response format of the management API, or whether failed deliveries are later visible in a dashboard.

The page says each event is retained for events_ttl_days and remains available through the lifecycle events API. It does not describe that API, so this page alone cannot show whether events whose delivery failed on all three attempts can be recovered.

The page is only documentation. No behaviour was observed, no calls were made and none of the snippets were run. The pages it links to were not read.

Why this is worth reading

The page presents webhooks as a way to receive sandbox updates without polling. It gives precise detail to start building a receiver: exact field names, documented possible termination reasons, and explicit handling rules for pause and resume modes. Nothing was run, so it remains unverified whether a receiver works and whether the examples are correct. The advice to deduplicate on event id and to treat a missing pause_mode or resume_mode as unknown addresses cases that could otherwise be mishandled.

There are two reasons for caution. One is the missing operational limits listed above. The other is the signature design, which hashes a shared secret together with the body. The page says the signature confirms that the request came from E2B and was not tampered with, but it gives no replay guidance. Readers handling sensitive workloads may want extra checks. Constant-time comparison is one such check, but it is an additional recommendation that the page does not make, and its basis is not verified here. Confirm details with E2B.

Alternatives

The page mentions polling the API as the approach webhooks avoid. It also refers to a lifecycle events API, through which each event remains available for events_ttl_days. The page gives no details of that API. Choosing between polling and webhooks depends on whether you can run an endpoint reachable by E2B that accepts POST requests containing JSON, and whether you can handle duplicates.

Webhook or event features of other sandbox or code-execution providers, and general webhook-signing standards such as HMAC-based schemes, were not part of the evidence and have not been compared.

Evidence base

The report rests on one captured file, selected-page.txt (13,242 bytes), taken from [https://docs.e2b.dev/sandbox/lifecycle-events-webhooks.md] on 2026-11-15. It covers the complete page. Documented facts in this report come from that text: endpoints, HTTP verbs, header names, payload fields and values, event types, and the rule that each webhook delivery is attempted up to three times in total. The page's code examples are described as written and were not executed. The overall judgements, the worked example, the identified gaps and recommendations such as constant-time comparison are this report's own assessment, not statements from the page. The basis for the constant-time recommendation is not verified by this evidence. Where the report says information is missing, it means the captured page does not say it, not that E2B lacks it.

Access & freshness

Costs

Unknown. The page says nothing about pricing, plan requirements, quotas, or whether webhook deliveries or retries are billed. It also does not say how E2B bills sandbox usage, so on this evidence the vcpu_count, memory_mb and execution_time fields cannot be treated as a billing record.

Receiving-endpoint hosting charges and arrangements are not specified on this page.

Rights and reuse

The captured page contains no licence statement, copyright notice or reuse terms for the documentation text or the code snippets. The terms for using the E2B service and API are not on this page either. The rights position is therefore unknown, and this report does not offer the page text for redistribution. Read the page at its original address and check E2B's own terms before copying material or relying on the service in production.

Freshness

The page was captured on 2026-11-15 and shows no publication or revision date. The sample createdAt value of 2025-08-06 is example data, not a page date. The page describes fields added to previously recorded event formats: events recorded before pause_mode and resume_mode were added do not include them. When they were added and whether development is ongoing are unknown. The kill_reason values are introduced as possible values that include those shown, so the list may not be complete. Endpoints, fields and event types may have changed since capture, so check the live page before building on it.

Suggested next steps

If you use E2B sandboxes and want state-change notifications, start with a test project and register a webhook for created and killed events. Log the raw headers and body of the first deliveries to confirm the payload shapes the page does not show. Verify signatures against the raw body, store processed event ids, and return a 2xx once a delivery is handled. A 4xx or 5xx response, a timeout or a network error counts as a failed attempt. Each webhook delivery is attempted up to three times in total, so failed attempts can be retried within that limit. The timeout duration is not documented.

Before relying on this in production, confirm with E2B the points the page leaves open: timeout duration and retry timing, rate limits, plan requirements, pricing, and how to recover events whose delivery failed on all three attempts. If you use pause or resume events, read the linked pages on the API key, snapshots, persistence and resume behaviour.

Evidence for this report

selected-page.txtselected · checked 2026-11-15