def delete(slug, product: nil, timeout: nil)def delete: (
String slug,
?product: (String | Symbol)?,
?timeout: seconds?
) -> deleted_project_resourceSoft deletes the project together with its environments and every variable in them, in one transaction, which takes the version history of those environments out of reach with it. There is no has children guard, so a project full of secrets goes away without complaint. Confirm with the caller before firing this.
The returned value is a tombstone with id, name and slug, plus deletedEnvironments and deletedVariables counting what went with it, not the full project shape, so capture anything else you need before deleting. A 409 means the slug was ambiguous and nothing was touched, not that the delete half happened.
Example
require "envless/sdk"
removed = Envless.projects.delete(
"api-gateway",
product: "billing"
)
puts removed[:id]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | String | Yes | Project slug, or the project uniqueId. |
product: | String | Symbol | No | Product slug used to disambiguate an ambiguous project slug. |
timeout: | Integer | Float | Rational | No | Seconds each attempt of this call may take, redirects and the response body included, before it raises Envless::NetworkError with timeout? set. Overrides the client's timeout for this call, and 0 turns the limit off. |
Returns
deleted_project_resource carrying id, name, slug, deletedEnvironments and deletedVariables.
Worth knowing
deletedVariablescounts live variables only. Version snapshots are not deleted and are not counted, they simply stop resolving once their environment is gone.- A 409
project.ambiguous_productis safe to retry withproduct:set. - The tombstone omits
product, so read the project first if you need to log where it lived.
Required scopes
projects:write
Underlying endpoint
DELETE /projects/{slug}
Request and response schema, every error code, and a live playground.
In TypeScript
envless.projects.delete()
The same method in @goenvless/sdk, with the same request, retries and errors.