Variables

envless.variables.delete_by_id()

Soft delete one variable by id

def delete_by_id(
    id: str,
    *,
    timeout: float | None = None,
) -> 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 raise. Treat that 404 as success if your caller is meant to be idempotent.

Example

from envless import envless

removed = envless.variables.delete_by_id(
    'a7f2c1e0-8b4d-4c11-9f3a-2d5e6b7c8d90'
)

print(removed['name'], removed['environmentId'])

Parameters

ParameterTypeRequiredDescription
idstrYesVariable id from a list response or a webhook payload.
timeoutfloatNoSeconds each attempt of this call may take, the response body included, before it raises EnvlessNetworkError with is_timeout set. Overrides the client's timeout for this call, and 0 turns the limit off.

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 TypeScript

envless.variables.deleteById()

The same method in @goenvless/sdk, with the same request, retries and errors.