Actors/Actor versions

Update Actor version (POST)

Changed on

Updates Actor version using values specified by a Version object passed as JSON in the POST payload. This endpoint is an alias for the Update Actor version endpoint and behaves identically.

post/v2/actors/{actorId}/versions/{versionNumber}

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

versionNumberstring

The version number of the Actor. Two numbers separated by a dot, that represent the MAJOR.MINOR part of the semantic versioning.

sourceType'SOURCE_FILES' | 'GIT_REPO' | 'TARBALL' | 'GITHUB_GIST'

The version source types accepted in request bodies. Same as VersionSourceType, without SOURCE_CODE.

applyEnvVarsToBuildboolean nullable

Whether to inject the environment variables at build time.

buildTagstring nullable

The tag name to apply to a successful build of this version. Can be null when the version has no build tag.

gitRepoUrlstring

URL of the Git repository to clone the source code from. Applies when the sourceType is GIT_REPO.

tarballUrlstring

URL of the zip archive to download the source code from. Applies when the sourceType is TARBALL.

gitHubGistUrlstring

URL of the GitHub Gist to clone the source code from. Applies when the sourceType is GITHUB_GIST.

Example request

{
  "versionNumber": "1.6",
  "envVars": [
    {
      "name": "MY_ENV_VAR",
      "value": "my-value"
    }
  ],
  "buildTag": "latest",
  "sourceFiles": [
    {
      "format": "TEXT",
      "content": "console.log('This is the main.js file');",
      "name": "src/main.js"
    }
  ]
}

Response

Example response

{
  "data": {
    "versionNumber": "0.0",
    "envVars": [
      {
        "name": "MY_ENV_VAR",
        "value": "my-value",
        "valueHash": "a1b2c3"
      }
    ],
    "buildTag": "latest",
    "sourceFiles": [
      {
        "format": "TEXT",
        "content": "console.log('This is the main.js file');",
        "name": "src/main.js"
      }
    ]
  }
}

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

    • 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