deleteMany(project: string, environment: string, names: Array<string>, options?: ProductScope): Promise<DeletedVariablesResource>Soft deletes up to 200 variables by name in one request. Names are matched without regard to case, so api_key removes a live API_KEY.
Unknown names are not an error. They come back under notFound while everything that matched is still deleted, which makes the call safe to retry. Even when nothing matches, the call resolves with count: 0 and every name in notFound, so check count rather than assuming work happened.
This sends a JSON body on a DELETE request. The SDK transport does that correctly, but a proxy or gateway in front of your traffic may strip the body, which surfaces as 400 with the generic request.invalid code and only message to explain it.
Example
const result = await envless.variables.deleteMany('api', 'production', ['LEGACY_API_URL', 'OLD_TOKEN'])
console.log(result.count, result.notFound)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Yes | Project slug the environment belongs to. |
environment | string | Yes | Environment slug the variables live in. |
names | Array<string> | Yes | Between 1 and 200 variable names, each matched without regard to case. |
options.product | string | No | Product slug, needed when the project slug is not unique in the workspace. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
DeletedVariablesResource with deleted, a count of rows removed and notFound for names that matched nothing.
Worth knowing
- More than 200 names, an empty array or a non-string entry is 400
request.body_invalid. - The whole batch is soft deleted, so earlier version snapshots keep every removed value.
Required scopes
variables:write
Underlying endpoint
DELETE /projects/{slug}/environments/{environmentSlug}/variables
Request and response schema, every error code, and a live playground.
In Python
envless.variables.delete_many()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.variables.delete_many
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->variables->deleteMany()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.