Skip to main content

Update Actor version (POST)

POST 

/v2/actors/:actorId/versions/:versionNumber

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.

Request

Path Parameters

    actorId string required

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


    Example: compass~google-maps-extractor
    versionNumber string required

    Actor version.


    Example: 0.1

Bodyrequired

  • versionNumber string

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

    Possible values: Value must match regular expression ^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$


    Example: 1.6
  • sourceType WritableVersionSourceType (string)

    Where the source code of the version lives.

    Possible values: [SOURCE_FILES, GIT_REPO, TARBALL, GITHUB_GIST]

  • envVars object[]

    Environment variables for the version.

    • name string required

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


      Example: MY_ENV_VAR
    • value string required

      The value of the environment variable.


      Example: my-value
    • isSecret boolean | null nullable

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


      Example: false
  • applyEnvVarsToBuild boolean | null nullable

    Whether to inject the environment variables at build time.


    Example: false
  • buildTag string | null nullable

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


    Example: latest
  • sourceFiles object[]

    Applies when the sourceType is SOURCE_FILES. Represents the Actor's file structure as an array of files and folders.

      anyOf
    • format SourceCodeFileFormat (string)

      Format of the file's content, TEXT for plain text and BASE64 for encoded content.

      Possible values: [BASE64, TEXT]


      Example: TEXT
    • content string

      The contents of the file. Interpreted based on the value of format.


      Example: console.log('This is the main.js file');
    • name string required

      The path of the file relative to the Actor's root directory.


      Example: src/main.js
  • gitRepoUrl string

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

  • tarballUrl string

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

  • gitHubGistUrl string

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

  • actorPath string | null nullable

    The Actor's directory inside the uploaded source, as a path relative to the upload root with / separators, for example actors/typescript-actor. Applies when the sourceType is SOURCE_FILES or TARBALL. The API rejects it when the sourceType is GIT_REPO or GITHUB_GIST. On an update without sourceType, the API checks it against the version's stored source type. When the version has no actorPath, the upload root is the Actor's directory. It has 1 to 255 characters, with no leading, trailing, or repeated / and no . or .. segments. An update that sends sourceType, sourceFiles, or tarballUrl without actorPath removes the stored actorPath, so send it again with every upload. An update of other fields, such as envVars or buildTag, keeps it. Send null to remove it.

    Possible values: non-empty and <= 255 characters


    Example: actors/typescript-actor

Status 200

Response Headers
    {
    "data": {
    "versionNumber": "0.0",
    "sourceType": "SOURCE_FILES",
    "envVars": [
    {
    "name": "MY_ENV_VAR",
    "value": "my-value",
    "isSecret": false,
    "valueHash": "a1b2c3"
    }
    ],
    "applyEnvVarsToBuild": false,
    "buildTag": "latest",
    "sourceFiles": [
    {
    "format": "TEXT",
    "content": "console.log('This is the main.js file');",
    "name": "src/main.js"
    },
    {
    "name": "src/utils",
    "folder": true
    }
    ],
    "gitRepoUrl": "string",
    "tarballUrl": "string",
    "gitHubGistUrl": "string",
    "actorPath": "actors/typescript-actor",
    "githubWebhookId": 0,
    "gitlabWebhookId": 0,
    "bitbucketWebhookId": "string"
    }
    }