Run task synchronously
GET/v2/actor-tasks/:actorTaskId/run-sync
Run a specific task and return its output.
The run must finish in 300 seconds otherwise the HTTP request fails with a timeout error (this won't abort the run itself).
Beware that it might be impossible to maintain an idle HTTP connection for an extended period, due to client timeout or network conditions. Make sure your HTTP client is configured to have a long enough connection timeout.
If the connection breaks, you will not receive any information about the run and its status.
To run the Task asynchronously, use the Run task asynchronously endpoint instead.
Request
Path Parameters
Task ID or a tilde-separated owner's username and task's name.
Example:janedoe~my-taskQuery Parameters
Optional timeout for the run, in seconds. By default, the run uses a timeout specified in the task settings.
Example:60Memory limit for the run, in megabytes. The amount of memory can be set to a power of 2 with a minimum of 128. By default, the run uses a memory limit specified in the task settings.
Example:256Specifies the maximum number of dataset items that will be charged for pay-per-result Actors.
This does NOT guarantee that the Actor will return only this many items.
It only ensures you won't be charged for more than this number of items.
Only works for pay-per-result Actors.
Value can be accessed in the actor run using ACTOR_MAX_PAID_DATASET_ITEMS environment variable.
1000Specifies the Actor build to run. It can be either a build tag or build
number. By default, the run uses the build specified in the task
settings (typically latest).
0.1.234Key of the record from run's default key-value store to be returned
in the response. By default, it is OUTPUT.
OUTPUTSpecifies optional webhooks associated with the Actor run, which can be used to receive a notification e.g. when the Actor finished or failed. The value is a Base64-encoded JSON array of objects defining the webhooks. For more information, see Webhooks documentation.
Example:dGhpcyBpcyBqdXN0IGV4YW1wbGUK...Status 201
Response Headers
{
"bar": "foo"
}
Schema
- object object
Status 400
Response Headers
{
"error": {
"type": "run-failed",
"message": "Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)"
}
}
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:
Status 408
Request Timeout: the HTTP request exceeded the 300 second limit
Response Headers
{
"error": {
"type": "run-failed",
"message": "Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)"
}
}
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: