CLI
These commands need E2B CLI2.23.0 or later.
List templates
The CLI pages through all of your templates for you, so it works for projects of any size.
Delete a template
Pass the template ID or name. The CLI asks for confirmation unless you pass-y.
GET /templates/{templateID} instead.
API
Authenticate every request with your API key in theX-API-Key header.
List templates
GET /v2/templates returns your templates newest first, one page at a time.
The
X-Next-Token header is only set when there are more results. Keep requesting pages until it’s missing:
templateID, names, buildID, buildStatus, cpuCount, memoryMB, diskSizeMB, public, createdAt, updatedAt, lastSpawnedAt, spawnCount, and buildCount.
Get a template
GET /templates/{templateID} returns one template with its builds. Pass the template ID, not a name. Builds are paginated with the same limit, nextToken, and X-Next-Token as the list endpoint.
Delete a template
DELETE /templates/{templateID} deletes a template by ID or name and returns 204 No Content. The template’s names become free to reuse.