E2B API
E2B API endpoints from E2B
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
E2B API endpoints from E2B
Endpoints 125
templates
- POSTCreate template (v3)
/v3/templatesCreate a new template - GETList templates (v2)
/v2/templatesList all templates - GETTemplate build file upload URL
/templates/:templateID/files/:hashGet an upload link for a tar file containing build layer files - GETList templates
/templatesDeprecated. List all templates. Returns 400 when the team has more than 5000 templates; use /v2/templates to page through them. - GETList default templates
/default-templatesLists the platform's default templates, ordered by template ID. Deleted templates are left out. Templates that are not public are listed only to their own… - GETList template builds
/templates/:templateIDList all builds for a template - DELETEDelete template
/templates/:templateIDDelete a template - PATCHUpdate template
/templates/:templateIDDeprecated. Update template - POSTStart template build (v2)
/v2/templates/:templateID/builds/:buildIDStart the build - PATCHUpdate template (v2)
/v2/templates/:templateIDUpdate template - GETTemplate build status
/templates/:templateID/builds/:buildID/statusGet template build info - GETTemplate build logs
/templates/:templateID/builds/:buildID/logsGet template build logs - GETCheck template alias
/templates/aliases/:aliasCheck if template with given alias exists
sandboxes
- GETList running sandboxes
/sandboxesDeprecated. List all running sandboxes. Returns 400 when more than 5000 running sandboxes match; use GET /v2/sandboxes to page through them. - POSTCreate sandbox
/sandboxesDeprecated. Create a sandbox from the template. All system communication with the sandbox is secured. Use POST /v2/sandboxes instead. - GETList sandboxes (v2)
/v2/sandboxesList all sandboxes - POSTCreate sandbox (v2)
/v2/sandboxesCreate a sandbox from the template. All system communication with the sandbox is secured. - GETList sandbox metrics
/sandboxes/metrics?sandbox_ids=stringList metrics for given sandboxes - GETSandbox logs
/sandboxes/:sandboxID/logsDeprecated. Get sandbox logs. Use /v2/sandboxes/{sandboxID}/logs instead. - GETSandbox logs (v2)
/v2/sandboxes/:sandboxID/logsGet sandbox logs - GETSandbox
/sandboxes/:sandboxIDGet a sandbox by id - DELETEKill sandbox
/sandboxes/:sandboxIDKill a sandbox - GETSandbox metrics
/sandboxes/:sandboxID/metricsGet sandbox metrics - GETSandbox record
/unstable/sandboxes/:sandboxID/recordReturns the team's latest recorded run of the sandbox, including runs that have already ended, and whether its monitoring, logs and events data are still… - POSTPause sandbox
/sandboxes/:sandboxID/pausePause the sandbox. Answers 503 and leaves the sandbox running when it cannot be paused right now: its node is busy, it is being snapshotted, or… - POSTResume sandbox
/sandboxes/:sandboxID/resumeDeprecated. Resume the sandbox. Answers 409 when the sandbox is already running, or when its snapshot was taken while the sandbox guest agent was not… - POSTFork sandbox
/sandboxes/:sandboxID/forkFork the sandbox: checkpoint the running sandbox in place (it is briefly paused, snapshotted with its full memory state, and resumed on its node, keeping its… - POSTConnect sandbox
/sandboxes/:sandboxID/connectDeprecated. Returns sandbox details. If the sandbox is paused, it will be resumed. TTL is only extended. Use POST /v2/sandboxes/{sandboxID}/connect instead.… - POSTConnect sandbox (v2)
/v2/sandboxes/:sandboxID/connectReturns sandbox details. If the sandbox is paused, it will be resumed. TTL is only extended. The request body is optional; an omitted timeout defaults to 300… - POSTSet sandbox timeout
/sandboxes/:sandboxID/timeoutSet the timeout for the sandbox. The sandbox will expire x seconds from the time of the request. Calling this method multiple times overwrites the TTL, each… - PUTUpdate sandbox network
/sandboxes/:sandboxID/networkUpdate the network configuration for a running sandbox. Replaces the current egress rules with the provided configuration. Omitting field clears it. - POSTRefresh sandbox
/sandboxes/:sandboxID/refreshesRefresh the sandbox extending its time to live - POSTCreate snapshot
/sandboxes/:sandboxID/snapshotsCreate a persistent snapshot from the sandbox's current state. Snapshots can be used to create new sandboxes and persist beyond the original sandbox's lifetime.
auth
- GETList teams
/teamsList all teams - GETTeam metrics
/teams/:teamID/metricsGet metrics for the team - GETMaximum team metrics
/teams/:teamID/metrics/max?metric=concurrent_sandboxesGet the maximum metrics for the team in the given interval - GETTeam access status
/unstable/teams/:teamID/statusReturns whether the team is banned or blocked, and why it is blocked. A team-authenticated request may read only its own team. - GETTeam limits
/unstable/teams/:teamID/limitsReturns the team's effective resource limits. A team-authenticated request may read only its own team.
api-keys
- GETList team API keys
/api-keysList all team API keys - POSTCreate team API key
/api-keysCreate a new team API key - DELETEDelete team API key
/api-keys/:apiKeyIDDelete a team API key - PATCHUpdate team API key
/api-keys/:apiKeyIDUpdate a team API key
tags
- POSTAssign template tags
/templates/tagsAssign tag(s) to a template build - DELETEDelete template tags
/templates/tagsDelete multiple tags from templates - GETList template tags
/templates/:templateID/tagsList all tags for a template - GETList template tag groups
/templates/:templateID/tags/groupsLists the template's tags that have at least one ready build, each with its most recent ready assignments, paginated over tags with a keyset cursor. Returns… - GETCount template tags
/templates/:templateID/tags/countReturns the number of distinct tags of the template that have at least one ready build. Returns 404 when the template does not exist or belongs to another team. - GETCheck template tag
/templates/:templateID/tags/exists?tag=stringChecks whether a tag of the template has at least one ready build. Returns 404 when the template does not exist or belongs to another team. - GETList template tag assignments
/templates/:templateID/tags/:tag/assignmentsLists the ready assignments of one tag of the template, newest first, with keyset cursor pagination. Returns 404 when the template does not exist or belongs…
volumes
- GETList team volumes
/volumesList all team volumes - POSTCreate team volume
/volumesCreate a new team volume - GETTeam volume
/volumes/:volumeIDGet team volume info - DELETEDelete team volume
/volumes/:volumeIDDelete a team volume
secrets
- GETList project secrets
/secretsList the project's secrets. No response carries a secret value. - POSTCreate a secret
/secretsCreate a secret by storing a runtime marker as its first version. The response carries metadata only. - GETGet a secret
/secrets/:secretIDGet one secret's metadata, selected by identifier or name. - POSTUpdate a secret
/secrets/:secretIDReplace the secret's stored marker by appending a new version. The response carries metadata only. - DELETEDelete a secret
/secrets/:secretIDRevoke the secret and schedule its versions for cleanup.
snapshots
- GETList snapshots
/snapshotsList all snapshots for the team
unstable
- GETSearch templates
/unstable/templates/searchLists the team's templates together with the platform's public default templates, which carry isDefault: true, with search, a visibility filter and sorts.… - GETList team builds
/unstable/buildsLists the team's builds, newest first, with an optional filter by build ID, template ID or template alias and by status. nextCursor continues the listing. For… - GETBuild statuses
/unstable/builds/statuses?build_ids=3fa85f64-5717-4562-b3fc-2c963f66afa6Returns the statuses of the team's builds with the given IDs; IDs of other teams' builds are left out. For E2B's own clients: it may change or disappear… - GETBuild details
/unstable/builds/:buildIDReturns a build of the team with the names of its template. For E2B's own clients: it may change or disappear without notice.
admin
- GETList nodes
/nodesList all nodes - GETNode info
/nodes/:nodeIDGet node info - POSTChange node status
/nodes/:nodeIDChange status of a node - POSTKill all sandboxes for a team
/admin/teams/:teamID/sandboxes/killKills all sandboxes for the specified team - GETCount running sandboxes by team
/admin/sandboxes/running-countsReturns a shared snapshot normally refreshed after five seconds. A sandbox transitioning out of running can remain counted until removal. - GETGet a sandbox's team and state
/admin/sandboxes/:sandboxIDReads the team and state of a sandbox from its latest lifecycle event. The state lags the sandbox while that event is in flight. A sandbox whose events have… - GETSandbox overview
/unstable/admin/sandboxes/:sandboxID/overviewReads a sandbox's team, snapshot template, most recent pause and newest default-tag build from the database. The team comes from the stopped-sandbox log, or… - GETList the builds of a sandbox's snapshot template
/unstable/admin/sandboxes/:sandboxID/buildsLists the build assignments of the template that holds the sandbox's snapshot under one tag. Assignments without a creation time are left out. A sandbox… - POSTMake a build the current build of a sandbox's snapshot
/unstable/admin/sandboxes/:sandboxID/builds/restoreAssigns a ready build of the sandbox's snapshot template to the template again under the default tag, so the sandbox resumes from that build. The snapshot… - POSTCancel all builds for a team
/admin/teams/:teamID/builds/cancelCancels all in-progress and pending builds for the specified team - GETList team API keys as admin
/admin/teams/:teamID/api-keysLists a team's API keys for internal service workflows. Unlike GET /api-keys, it does not resolve the team, so it also answers for a banned team. - POSTCreate team API key as admin
/admin/teams/:teamID/api-keysCreates a team API key for internal service workflows. - DELETEDelete team API key as admin
/admin/teams/:teamID/api-keys/:apiKeyIDDeletes a team API key for internal service workflows. - PUTRegister a cluster.
/unstable/management/clusters/:clusterIDA cluster registered here for the first time starts with deletion protection turned off. Registering an existing cluster again with the same name and auth… - DELETEDelete a cluster and its environments.
/unstable/management/clusters/:clusterIDDeletes a cluster after all team assignments are detached. In the same transaction, soft-deletes every live template, snapshot template and paused sandbox… - GETList the projects assigned to a cluster.
/unstable/management/clusters/:clusterID/projectsReturns the ID of every project whose team is assigned to the cluster, whichever way it was assigned. A deleted project is never assigned. An absent cluster… - PUTRecord that a cluster is being deleted.
/unstable/management/clusters/:clusterID/deletionRecords that the caller is deleting the cluster, for a caller that deletes the cluster's teams before the cluster itself. Refused while the cluster has… - GETCheck cluster destroy readiness.
/unstable/management/clusters/:clusterID/destroy-readinessChecks whether the cluster has deletion protection turned on, or more than one team uses this exact cluster, either as an assigned team or as the owner of… - PUTAssign a cluster to a project.
/unstable/management/projects/:projectID/cluster/:clusterIDAssigns the cluster when the project has no cluster assigned. Replaying the identical assignment succeeds; replacing a different assigned cluster returns a… - DELETEDetach a cluster assignment from a project.
/unstable/management/projects/:projectID/cluster/:clusterIDAnswers 404 when the project is missing or deleted. - PUTCreate or reconcile a project.
/unstable/management/projects/:projectID - DELETESoft-delete a project.
/unstable/management/projects/:projectIDMarks the project deleted and blocked, releases its cluster assignment, scrubs its name and email to DELETED and its slug to deleted-<project ID>, which… - PUTApply one versioned project member projection.
/unstable/management/projects/:projectID/members/:userIDApplies the newest desired presence for one project member. An older or duplicate revision is accepted without changing target state. - PUTReconcile effective limits for a project.
/unstable/management/projects/:projectID/limits - PUTApply a project's settings revision.
/unstable/management/projects/:projectID/settingsReplaces the complete project settings document when the revision is newer than the stored revision. Omitted settings are removed. Older and duplicate… - PUTApply a project's block state.
/unstable/management/projects/:projectID/blockRecords whether the project is refused billable work, which the auth path reads before it lets a sandbox start. An older or duplicate revision is accepted… - PUTApply a project's ban state.
/unstable/management/projects/:projectID/banRecords whether the project is banned. Authentication refuses a banned project's API keys and members. A revision that turns the ban on also kills the… - POSTList teams as admin
/unstable/admin/teams/queryLists teams matching the filters in the request body, with each team's member count, and its running sandbox count when sorted by running sandboxes. A read… - POSTBan teams
/unstable/admin/teams/bansBans up to 100 teams at once, as PUT /unstable/admin/teams/{teamID}/ban does, except that every team's ban is stored before any team's sandboxes are killed or… - GETTeam as admin
/unstable/admin/teams/:teamIDReturns a team with its sandbox scheduling labels and cluster. It also answers for a banned or blocked team. - PUTReplace a team's sandbox scheduling labels
/unstable/admin/teams/:teamID/scheduling-labelsReplaces the labels that place the team's new sandboxes on matching nodes. Labels are deduplicated, keeping the first occurrence of each. - PUTBan a team
/unstable/admin/teams/:teamID/banMarks the team as banned so its API keys stop authenticating, then kills its sandboxes and cancels its builds. The ban is stored first: a failure to kill or… - DELETEUnban a team
/unstable/admin/teams/:teamID/banClears the team's ban. Idempotent. - GETList clusters as admin
/unstable/admin/clustersLists the registered clusters with the number of teams assigned to each. Never returns a cluster's token. The local cluster is not a registered cluster and is… - POSTCreate a cluster as admin
/unstable/admin/clustersCreates a cluster whose configuration cannot be modified through this route. A new cluster starts with deletion protection turned on. Creating a cluster again… - GETCluster as admin
/unstable/admin/clusters/:clusterIDReturns a cluster with the first page of its assigned teams, the number of teams assigned to it and the number of live templates on it. Never returns the… - DELETEDelete a cluster and its environments as admin
/unstable/admin/clusters/:clusterIDDeletes a cluster after all team assignments are detached. In the same transaction, soft-deletes every live template, snapshot template and paused sandbox… - PATCHUpdate a cluster as admin
/unstable/admin/clusters/:clusterIDWrites only the properties present in the body. endpoint and endpointTls change where orchestration traffic for every team on the cluster goes,… - GETList a cluster's teams as admin
/unstable/admin/clusters/:clusterID/teamsLists the teams assigned to the cluster. - PUTRotate a cluster's token as admin
/unstable/admin/clusters/:clusterID/tokenReplaces the token used to reach the cluster. The previous token stops working at once. No route returns a cluster's token. - GETSearch template aliases as admin
/unstable/admin/templates/aliases?search=stringFinds the templates whose ID equals search, or that own an alias equal to search in any namespace, with their owning team and all their aliases. Deleted… - POSTAdd a template alias without a namespace as admin
/unstable/admin/templates/aliasesAdds an alias without a namespace to a template, so the template resolves by that name for every team. The alias follows the rules of template names… - DELETERemove a template alias without a namespace as admin
/unstable/admin/templates/aliases/:aliasIDRemoves an alias without a namespace. A namespaced alias is not removed and answers 404. - POSTAdd a default template as admin
/unstable/admin/templates/defaultsMakes a template one of the platform's default templates. Returns 404 when the template does not exist and 409 when it is already a default template. - DELETERemove a default template as admin
/unstable/admin/templates/defaults/:templateIDStops a template being one of the platform's default templates. The template itself is not changed. Returns 404 when the template is not a default template. - PATCHUpdate a default template as admin
/unstable/admin/templates/defaults/:templateIDUpdates the description of a default template. Returns 404 when the template is not a default template. - GETLook up a template as admin
/unstable/admin/templates/lookup?query=stringResolves query as, in order: a build ID (a UUID, matched to the template of the build's newest assignment, with no fallback), a template ID, or a template… - GETList rigs of a cluster
/clusters/:clusterID/rigsList the orchestrator node pools ("rigs") of a cluster with a snapshot of their scaling groups. Forwarded to the cluster's edge service; a cluster with no rig… - PUTSet the capacity of a rig
/clusters/:clusterID/rigs/:rigID/capacitySet the desired instance count on the rig's scaling group. The value is passed to the cloud provider unchanged; violations of the group's bounds or… - DELETETerminate an instance of a rig
/clusters/:clusterID/rigs/instances/:instanceID?decrementDesired=trueTerminate an instance in whichever rig's scaling group it belongs to. The caller chooses whether the rig shrinks or the instance is replaced. - GETList the instances attached to a rig
/clusters/:clusterID/rigs/:rigID/instancesList the instances attached to the rig's scaling group with their creation time and transition state, sorted by instance ID. - GETList recent scaling errors of a rig
/clusters/:clusterID/rigs/:rigID/errorsList recent scaling errors on the rig's scaling group (e.g. failed instance creations due to resource exhaustion), newest first.
events
- GETGET /events/sandboxes/{sandboxID}
/events/sandboxes/:sandboxIDGet sandbox events - GETGET /events/sandboxes
/events/sandboxesGet all sandbox events for the team associated with the API key
webhooks
- GETGET /events/webhooks
/events/webhooksList registered webhooks. - POSTPOST /events/webhooks
/events/webhooksRegister events webhook. - GETGET /events/webhooks/{webhookID}
/events/webhooks/:webhookIDGet a registered webhook. - DELETEDELETE /events/webhooks/{webhookID}
/events/webhooks/:webhookIDDelete a registered webhook. - PATCHPATCH /events/webhooks/{webhookID}
/events/webhooks/:webhookIDUpdate a registered webhook configuration. - GETGET /events/webhooks/{webhookID}/deliveries
/events/webhooks/:webhookID/deliveriesList webhook delivery attempts. - GETGET /events/webhooks/{webhookID}/stats
/events/webhooks/:webhookID/statsGet webhook delivery aggregate stats.
- GETHealth check
/healthHealth check
API details
- Base URL
https://api.e2b.app- Authentication
- An API key in the X-API-Key header
A bearer token in the Authorization header
An API key in the X-Team-ID header
An API key in the X-Admin-Token header
A bearer token in the Authorization header
An API key in the X-Team-ID header - Operations
- 125 operations on 98 pathsGET 61POST 28DELETE 16PUT 14PATCH 6
7 marked deprecated - Main resources
- admin 52sandboxes 20templates 13tags 7webhooks 7auth 5secrets 5api-keys 4unstable 4volumes 4
- Response formats
application/json- Description format
- OpenAPI 3.0.0, API version
0.1.0 - Links
- OpenAPI document
- Listed from
- E2B's published OpenAPI description (e2b-dev/E2B) (Apache-2.0)
How to test the E2B API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the E2B API collection, without the publisher's secrets.
- Add your credentialsThis API uses an API key in the X-API-Key header. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Create template (v3)” (POST /v3/templates), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the E2B API?
E2B API endpoints from E2B It is listed under AI & machine learning and has 125 endpoints.
Who publishes the E2B API?
It is listed from E2B's public API description (an OpenAPI document), not published by E2B on Swastik Codes. Anyone who controls e2b.dev can claim the profile by adding a DNS TXT record.
What is the base URL of the E2B API?
Requests go to https://api.e2b.app. Endpoint paths are added to this base URL.
How do I authenticate with the E2B API?
It accepts 6 methods: an API key in the X-API-Key header; A bearer token in the Authorization header; an API key in the X-Team-ID header; an API key in the X-Admin-Token header; A bearer token in the Authorization header; an API key in the X-Team-ID header.
How many endpoints does the E2B API have?
125 operations on 98 paths (61 GET, 28 POST, 16 DELETE, 14 PUT, 6 PATCH). The largest groups are admin, sandboxes, templates, tags.
Is forking the E2B API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.