Actors/Actor versions

Create environment variable in Actor version

Changed on

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 endpoint.

post/v2/actors/{actorId}/versions/{versionNumber}/env-vars

Request

  • Base URL
    https://api.apify.com
  • Auth
    • HTTP bearer
    • or API key in query parameter token

Path parameters

actorIdstring required
Example:compass~google-maps-extractor

Actor ID or the username of the Actor owner and the Actor name, separated by a tilde (~).

versionNumberstring required
Example:0.1

Actor version.

Request body

namestring required

The name of the environment variable. Can't contain =.

valuestring required

The value of the environment variable.

isSecretboolean nullable

Whether the environment variable is encrypted. Secret values aren't returned by the API.

Example request

{
  "name": "MY_ENV_VAR",
  "value": "my-value"
}

Response

Example response

{
  "data": {
    "name": "MY_ENV_VAR",
    "value": "my-value",
    "valueHash": "a1b2c3"
  }
}

Changes

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status