deleteById(id: string, options?: RequestScope): Promise<DeletedVariableResource>Soft deletes one variable by id. Version snapshots taken earlier keep their copy of the value, so a rollback can restore it.
An id that never existed and an id that was already deleted both answer 404 rather than succeeding quietly, so a retry after a delete that actually landed will reject. Treat that 404 as success if your caller is meant to be idempotent.
Example
const removed = await envless.variables.deleteById('a7f2c1e0-8b4d-4c11-9f3a-2d5e6b7c8d90')
console.log(removed.name, removed.environmentId)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Variable id from a list response or a webhook payload. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
DeletedVariableResource with the id, name and environmentId of the removed row.
Worth knowing
- This is the only delete route that tells you the name of a variable you addressed purely by id.
Required scopes
variables:write
Underlying endpoint
DELETE /variables/{id}
Request and response schema, every error code, and a live playground.
In Python
envless.variables.delete_by_id()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.variables.delete_by_id
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->variables->deleteById()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.