# `ApifyClient.API.Actors.Versions.EnvVars`
[🔗](https://github.com/social-growth-studio/apify-client-ex/blob/v1.0.0/lib/apify_client/api/actors/versions/env_vars.ex#L1)

Provides API endpoints related to api/actors/versions/env vars

# `create`

```elixir
@spec create(
  actor_id :: String.t(),
  version_number :: String.t(),
  body :: map() | ApifyClient.Schemas.EnvVarRequest.t(),
  opts :: keyword()
) :: {:ok, ApifyClient.Schemas.EnvVar.t()} | {:error, ApifyClient.Error.t()}
```

Create environment variable in Actor version

Creates an environment variable of an Actor using values specified in an
`EnvVar` object passed as
JSON in the POST payload.

The request must specify `name` and `value` parameters (as strings) in the
JSON payload and a `Content-Type: application/json` HTTP header.

```
{
    "name": "ENV_VAR_NAME",
    "value": "my-env-var"
}
```

The response is the `EnvVar`
object as returned by the [Get environment variable of Actor version](https://docs.apify.com/api/v2/actor-version-env-var-get)
endpoint.

## Request Body

**Content Types**: `application/json`

# `delete`

```elixir
@spec delete(
  actor_id :: String.t(),
  version_number :: String.t(),
  env_var_name :: String.t(),
  opts :: keyword()
) :: :ok | {:error, ApifyClient.Error.t()}
```

Delete environment variable from Actor version

Deletes a specific environment variable.

# `get`

```elixir
@spec get(
  actor_id :: String.t(),
  version_number :: String.t(),
  env_var_name :: String.t(),
  opts :: keyword()
) :: {:ok, ApifyClient.Schemas.EnvVar.t()} | {:error, ApifyClient.Error.t()}
```

Get environment variable of Actor version

Gets an `EnvVar` object that
contains all the details about a specific environment variable of an Actor.

If `isSecret` is set to `true`, then `value` will never be returned.

# `list`

```elixir
@spec list(actor_id :: String.t(), version_number :: String.t(), opts :: keyword()) ::
  {:ok, ApifyClient.Schemas.ListOfEnvVars.t()} | {:error, ApifyClient.Error.t()}
```

Get list of environment variables of Actor version

Gets the list of environment variables for a specific version of an Actor.
The response is a JSON object with the list of `EnvVar` objects, where each contains basic information about a single environment variable.

# `update`

```elixir
@spec update(
  actor_id :: String.t(),
  version_number :: String.t(),
  env_var_name :: String.t(),
  body :: map() | ApifyClient.Schemas.EnvVarRequest.t(),
  opts :: keyword()
) :: {:ok, ApifyClient.Schemas.EnvVar.t()} | {:error, ApifyClient.Error.t()}
```

Update environment variable in Actor version

Updates Actor environment variable using values specified by an `EnvVar`
object
passed as JSON in the POST payload.
If the object does not define a specific property, its value will not be
updated.

The request needs to specify the `Content-Type: application/json` HTTP
header!

When providing your API authentication token, we recommend using the
request's `Authorization` header, rather than the URL.
For details, see [Authentication](https://docs.apify.com/api/v2#authentication).

The response is the `EnvVar` object as returned by the
[Get environment variable of Actor version](https://docs.apify.com/api/v2/actor-version-env-var-get)
endpoint.

## Request Body

**Content Types**: `application/json`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
