---
title: "Run task synchronously and get dataset items"
method: POST
path: "/v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items"
tags: ["Actor tasks"]
---

# Run task synchronously and get dataset items

`POST /v2/actor-tasks/{actorTaskId}/run-sync-get-dataset-items`

Runs an Actor task and synchronously returns its dataset items.

The run must finish in 300<!-- MAX_ACTOR_JOB_SYNC_WAIT_SECS --> seconds
otherwise the HTTP request fails with a timeout error (this won't abort
the run itself).

Optionally, you can override the Actor input configuration by passing a JSON
object as the POST payload and setting the `Content-Type: application/json` HTTP header.

Note that if the object in the POST payload does not define a particular
input property, the Actor run uses the default value defined by the task (or the Actor's
input schema if not defined by the task).

You can send all the same options in parameters as the [Get Dataset
Items](#/reference/datasets/item-collection/get-items) API endpoint.

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.

Input fields from Actor task configuration can be overloaded with values
passed as the POST payload.

Just make sure to specify the `Content-Type` header as `application/json`
and that the input is an object.

To run the task asynchronously, use the [Run
task](#/reference/actor-tasks/run-collection/run-task) API endpoint instead.

## Path parameters

- `actorTaskId` string, required

## Query parameters

- `timeout` number, double
- `memory` number, double
- `maxItems` number, double
- `maxTotalChargeUsd` number, double
- `restartOnError` boolean
- `build` string
- `webhooks` string, byte
- `format` string
- `clean` boolean
- `offset` number, double
- `limit` number, double
- `fields` string
- `outputFields` string
- `omit` string
- `unwind` string
- `flatten` string
- `desc` boolean
- `attachment` boolean
- `delimiter` string
- `bom` boolean
- `xmlRoot` string
- `xmlRow` string
- `skipHeaderRow` boolean
- `skipHidden` boolean
- `skipEmpty` boolean
- `simplified` boolean
- `view` string
- `skipFailedPages` boolean
- `feedTitle` string
- `feedDescription` string

## Request body

- object

## Response `201`

- object

## Other responses

- `400` — Bad request - invalid input parameters or request body.
- `401` — Unauthorized - authentication required or invalid token.
- `402` — Payment required - the user has exceeded their usage limit, does not have enough credits, or the request lacks authentication and payment credentials.
- `403` — Forbidden - insufficient permissions to perform this action.
- `404` — Not found - the requested resource does not exist.
- `405` — Method not allowed.
- `408` — The HTTP request exceeded the timeout limit
- `413` — Payload too large - the request body exceeds the size limit.
- `415` — Unsupported media type - the Content-Encoding of the request is not supported.
- `429` — Too many requests - rate limit exceeded.

---

[API](https://skmtc.net/apify/apis/apify-api.md) · [All operations](https://skmtc.net/apify/apis/apify-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/apify/apify-api/versions/01a71794279b/schema)
