Projects

Envless.projects.delete

Soft delete a project and everything under it

def delete(slug, product: nil, timeout: nil)

Soft 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

ruby
require "envless/sdk"

removed = Envless.projects.delete(
  "api-gateway",
  product: "billing"
)

puts removed[:id]

Parameters

ParameterTypeRequiredDescription
slugStringYesProject slug, or the project uniqueId.
product:String | SymbolNoProduct slug used to disambiguate an ambiguous project slug.
timeout:Integer | Float | RationalNoSeconds 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

  • deletedVariables counts 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_product is safe to retry with product: 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.