Create Actor
POST/v2/acts
Creates a new Actor with settings specified in an Actor object passed as JSON in the POST payload. The response is the full Actor object as returned by the Get Actor endpoint.
The HTTP request must have the Content-Type: application/json HTTP header!
The Actor needs to define at least one version of the source code. For more information, see Version object.
If you want to make your Actor
public using isPublic: true, you will need to provide the Actor's title and the categories
under which that Actor will be classified in Apify Store. For this, it's
best to use the constants from our apify-shared-js
package.
Request
Bodyrequired
- name string | null nullableExample:
MyActor - description string | null nullableExample:
My favourite actor! - title string | null nullableExample:
My actor - isPublic boolean | null nullableExample:
false - seoTitle string | null nullableExample:
My actor - seoDescription string | null nullableExample:
My actor is the best - restartOnError boolean deprecatedExample:
false versions object[]
- versionNumber string requiredExample:
0.0 sourceType object required
- anyOf
- VersionSourceType
- null
- VersionSourceType (string)
Possible values: [
SOURCE_FILES,GIT_REPO,TARBALL,GITHUB_GIST]
envVars object[]
- name string requiredExample:
MY_ENV_VAR - value string requiredExample:
my-value - isSecret boolean | null nullableExample:
false
- name string requiredExample:
- applyEnvVarsToBuild boolean | null nullableExample:
false - buildTag stringExample:
latest sourceFiles object[]
- anyOf
- SourceCodeFile
- SourceCodeFolder
- format SourceCodeFileFormat (string) required
Possible values: [
Example:BASE64,TEXT]TEXT - content string requiredExample:
console.log('This is the main.js file'); - name string requiredExample:
src/main.js
- gitRepoUrl string | null nullable
URL of the Git repository when sourceType is GIT_REPO.
- tarballUrl string | null nullable
URL of the tarball when sourceType is TARBALL.
- gitHubGistUrl string | null nullable
URL of the GitHub Gist when sourceType is GITHUB_GIST.
- versionNumber string requiredExample:
pricingInfos object[]
- oneOf
- PayPerEventActorPricingInfo
- PricePerDatasetItemActorPricingInfo
- FlatPricePerMonthActorPricingInfo
- FreeActorPricingInfo
- apifyMarginPercentage number required
In [0, 1], fraction of pricePerUnitUsd that goes to Apify
- createdAt string<date-time> required
When this pricing info record has been created
- startedAt string<date-time> required
Since when is this pricing info record effective for a given Actor
- notifiedAboutFutureChangeAt string,null<date-time> nullable
- notifiedAboutChangeAt string,null<date-time> nullable
- reasonForChange string | null nullable
- pricingModel PricingModel (string) required
Possible values: [
PAY_PER_EVENT,PRICE_PER_DATASET_ITEM,FLAT_PRICE_PER_MONTH,FREE] pricingPerEvent object required
actorChargeEvents object
property name* ActorChargeEvent
- eventPriceUsd number required
- eventTitle string required
- eventDescription string required
- minimalMaxTotalChargeUsd number | null nullable
- categories string[] nullable
defaultRunOptions object
- build string requiredExample:
latest - timeoutSecs integerExample:
3600 - memoryMbytes integer requiredExample:
2048 - restartOnError booleanExample:
false
- build string requiredExample:
Status 201
Response Headers
- Location
{
"data": {
"id": "zdc3Pyhyz3m8vjDeM",
"userId": "wRsJZtadYvn4mBZmm",
"name": "MyActor",
"username": "jane35",
"description": "My favourite Actor!",
"isPublic": false,
"createdAt": "2019-07-08T11:27:57.401Z",
"modifiedAt": "2019-07-08T14:01:05.546Z",
"stats": {
"totalBuilds": 9,
"totalRuns": 16,
"totalUsers": 6,
"totalUsers7Days": 2,
"totalUsers30Days": 6,
"totalUsers90Days": 6,
"totalMetamorphs": 2,
"lastRunStartedAt": "2019-07-08T14:01:05.546Z"
},
"versions": [
{
"versionNumber": "0.1",
"envVars": null,
"sourceType": "SOURCE_FILES",
"applyEnvVarsToBuild": false,
"buildTag": "latest",
"sourceFiles": []
},
{
"versionNumber": "0.2",
"sourceType": "GIT_REPO",
"envVars": null,
"applyEnvVarsToBuild": false,
"buildTag": "latest",
"gitRepoUrl": "https://github.com/jane35/my-actor"
},
{
"versionNumber": "0.3",
"sourceType": "TARBALL",
"envVars": null,
"applyEnvVarsToBuild": false,
"buildTag": "latest",
"tarballUrl": "https://github.com/jane35/my-actor/archive/master.zip"
},
{
"versionNumber": "0.4",
"sourceType": "GITHUB_GIST",
"envVars": null,
"applyEnvVarsToBuild": false,
"buildTag": "latest",
"gitHubGistUrl": "https://gist.github.com/jane35/e51feb784yu89"
}
],
"defaultRunOptions": {
"build": "latest",
"timeoutSecs": 3600,
"memoryMbytes": 2048,
"restartOnError": false
},
"exampleRunInput": {
"body": "{ \"helloWorld\": 123 }",
"contentType": "application/json; charset=utf-8"
},
"isDeprecated": false,
"deploymentKey": "ssh-rsa AAAA ...",
"title": "My Actor",
"taggedBuilds": {
"latest": {
"buildId": "z2EryhbfhgSyqj6Hn",
"buildNumber": "0.0.2",
"finishedAt": "2019-06-10T11:15:49.286Z"
}
}
}
}
Schema
data object required
- id string requiredExample:
zdc3Pyhyz3m8vjDeM - userId string requiredExample:
wRsJZtadYvn4mBZmm - name string requiredExample:
MyActor - username string requiredExample:
jane35 - description string | null nullableExample:
My favourite actor! - restartOnError boolean deprecatedExample:
false - isPublic boolean requiredExample:
false - actorPermissionLevel ActorPermissionLevel (string)
Determines permissions that the Actor requires to run. For more information, see the Actor permissions documentation.
Possible values: [
Example:LIMITED_PERMISSIONS,FULL_PERMISSIONS]LIMITED_PERMISSIONS - createdAt string<date-time> requiredExample:
2019-07-08T11:27:57.401Z - modifiedAt string<date-time> requiredExample:
2019-07-08T14:01:05.546Z stats object required
- totalBuilds integerExample:
9 - totalRuns integerExample:
16 - totalUsers integerExample:
6 - totalUsers7Days integerExample:
2 - totalUsers30Days integerExample:
6 - totalUsers90Days integerExample:
6 - totalMetamorphs integerExample:
2 - lastRunStartedAt string<date-time>Example:
2019-07-08T14:01:05.546Z
- totalBuilds integerExample:
versions object[] required
- versionNumber string requiredExample:
0.0 sourceType object required
- anyOf
- VersionSourceType
- null
- VersionSourceType (string)
Possible values: [
SOURCE_FILES,GIT_REPO,TARBALL,GITHUB_GIST]
envVars object[]
- name string requiredExample:
MY_ENV_VAR - value string requiredExample:
my-value - isSecret boolean | null nullableExample:
false
- name string requiredExample:
- applyEnvVarsToBuild boolean | null nullableExample:
false - buildTag stringExample:
latest sourceFiles object[]
- anyOf
- SourceCodeFile
- SourceCodeFolder
- format SourceCodeFileFormat (string) required
Possible values: [
Example:BASE64,TEXT]TEXT - content string requiredExample:
console.log('This is the main.js file'); - name string requiredExample:
src/main.js
- gitRepoUrl string | null nullable
URL of the Git repository when sourceType is GIT_REPO.
- tarballUrl string | null nullable
URL of the tarball when sourceType is TARBALL.
- gitHubGistUrl string | null nullable
URL of the GitHub Gist when sourceType is GITHUB_GIST.
- versionNumber string requiredExample:
pricingInfos object[]
- oneOf
- PayPerEventActorPricingInfo
- PricePerDatasetItemActorPricingInfo
- FlatPricePerMonthActorPricingInfo
- FreeActorPricingInfo
- apifyMarginPercentage number required
In [0, 1], fraction of pricePerUnitUsd that goes to Apify
- createdAt string<date-time> required
When this pricing info record has been created
- startedAt string<date-time> required
Since when is this pricing info record effective for a given Actor
- notifiedAboutFutureChangeAt string,null<date-time> nullable
- notifiedAboutChangeAt string,null<date-time> nullable
- reasonForChange string | null nullable
- pricingModel PricingModel (string) required
Possible values: [
PAY_PER_EVENT,PRICE_PER_DATASET_ITEM,FLAT_PRICE_PER_MONTH,FREE] pricingPerEvent object required
actorChargeEvents object
property name* ActorChargeEvent
- eventPriceUsd number required
- eventTitle string required
- eventDescription string required
- minimalMaxTotalChargeUsd number | null nullable
defaultRunOptions object required
- build string requiredExample:
latest - timeoutSecs integerExample:
3600 - memoryMbytes integer requiredExample:
2048 - restartOnError booleanExample:
false
- build string requiredExample:
exampleRunInput object
- anyOf
- exampleRunInput
- null
- body string requiredExample:
{ "helloWorld": 123 } - contentType string requiredExample:
application/json; charset=utf-8
- isDeprecated boolean | null nullableExample:
false - deploymentKey stringExample:
ssh-rsa AAAA ... - title string | null nullableExample:
My Actor taggedBuilds object
- anyOf
- TaggedBuilds
- null
- object
A dictionary mapping build tag names (e.g., "latest", "beta") to their build information.
Example:{"latest":{"buildId":"z2EryhbfhgSyqj6Hn","buildNumber":"0.0.2","finishedAt":"2019-06-10T11:15:49.286Z"},"beta":{"buildId":"abc123def456","buildNumber":"1.0.0-beta","finishedAt":"2019-07-15T14:30:00.000Z"}}
- readmeSummary string
A brief, LLM-generated readme summary
- id string requiredExample:
Status 400
Bad request - invalid input parameters or request body.
{
"error": {
"type": "invalid-input",
"message": "Invalid input: The request body contains invalid data."
}
}
Schema
error object required
- type string requiredExample:
run-failed - message string requiredExample:
Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)
- type string requiredExample: