delete(slug: string, options?: ProductScope): Promise<DeletedProjectResource>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 resolved 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
const removed = await envless.projects.delete('api-gateway', { product: 'billing' })
console.log(removed.id)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | Project slug, or the project uniqueId. |
options.product | string | No | Product slug used to disambiguate an ambiguous project slug. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
DeletedProjectResource 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 withoptions.productset. - 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 Python
envless.projects.delete()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.projects.delete
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->projects->delete()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.