Update version
PUThttps://api.apify.com/v2/acts/:actorId/versions/:versionNumber
ClientsUpdates Actor version using values specified by a Version 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. (More
info).
The response is the Version object as returned by the Get version endpoint.
Request
Path Parameters
actorId stringrequired
Actor ID or a tilde-separated owner's username and Actor name.
versionNumber stringrequired
Actor major and minor version of the Actor.
- application/json
Bodyrequired
versionNumberstringnullable
Example:
0.0
sourceType object
envVars object[]nullable
applyEnvVarsToBuildbooleannullable
Example:
false
buildTagstringnullable
Example:
latest
sourceFiles object[]
Responses
- 200
Response Headers
- application/json
- Schema
- Example (auto)
Schema
data objectrequired
{
"data": {
"versionNumber": "0.0",
"envVars": [
{
"name": "MY_ENV_VAR",
"value": "my-value",
"isSecret": false
}
],
"applyEnvVarsToBuild": false,
"buildTag": "latest",
"sourceFiles": [
{
"format": "TEXT",
"content": "console.log('This is the main.js file');",
"name": "src/main.js"
},
{
"name": "src/placeholder",
"folder": true
}
]
}
}
Authorization: http
name: httpBearertype: httpscheme: bearerdescription: API authentication token.
- CLI
- JavaScript
- Python
- PHP
- Java
- C
- C#
- Go
- Rust
- Node.js
- Ruby
- PowerShell
- Dart
- Objective-C
- OCaml
- R
- Swift
- Kotlin
- CURL
curl -L -X PUT 'https://api.apify.com/v2/acts/:actorId/versions/:versionNumber' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"versionNumber": "0.0",
"envVars": [
{
"name": "MY_ENV_VAR",
"value": "my-value",
"isSecret": false
}
],
"applyEnvVarsToBuild": false,
"buildTag": "latest",
"sourceFiles": [
{
"format": "TEXT",
"content": "console.log('\''This is the main.js file'\'');",
"name": "src/main.js"
},
{
"name": "src/placeholder",
"folder": true
}
]
}'
ResponseClear