Create Actor version
Changed onCreates a version of an Actor using values specified in a Version object passed as JSON in the POST payload.
The request must specify versionNumber and sourceType parameters (as strings) in the JSON payload and a Content-Type: application/json HTTP header.
Each sourceType requires its own additional properties to be passed to the JSON payload object. These are outlined in the Version object table below and in more detail in the Apify documentation.
For example, if an Actor's source code is stored in a GitHub repository, you will set the sourceType to GIT_REPO and pass the repository's URL in the gitRepoUrl property.
{
"versionNumber": "0.1",
"sourceType": "GIT_REPO",
"gitRepoUrl": "https://github.com/my-github-account/actor-repo"
}
The response is the Version object as returned by the Get Actor version endpoint.
Request
- Base URLhttps://api.apify.com
- Auth
- HTTP bearer
- or API key in query parameter token
Path parameters
Actor ID or the username of the Actor owner and the Actor name, separated by a tilde (~).
Request body
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
- 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