# Update task


```
PUT 
https://api.apify.com/v2/actor-tasks/:actorTaskId
```


Update settings of a task using values specified by an object passed as JSON in the POST payload.

If the object does not define a specific property, its value is not updated.

The response is the full task object as returned by the  endpoint.

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. ().

## Request

### Path Parameters

* **actorTaskId** string required

  Task ID or a tilde-separated owner's username and task's name.

  **Example:** `janedoe~my-task`

### Body**required**

* **name** string\
  **Example:** `my-task`

* **options** object

  * anyOf
    * TaskOptions
    * null
    **build** string | null nullable\
    **Example:** `latest`
  * **timeoutSecs** integer | null nullable\
    **Example:** `300`
  * **memoryMbytes** integer | null nullable\
    **Example:** `128`
  * **restartOnError** boolean | null nullable\
    **Example:** `false`
  * **maxItems** integer | null nullable

* **input** object

  * anyOf

    * TaskInput
    * null

    object

    The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run.

    **Example:** `{"startUrls":[{"url":"https://example.com"}],"maxRequestsPerCrawl":100}`

* **title** string | null nullable

* **actorStandby** object

  * anyOf
    * ActorStandby
    * null
    **isEnabled** boolean | null nullable
  * **desiredRequestsPerActorRun** integer | null nullable
  * **maxRequestsPerActorRun** integer | null nullable
  * **idleTimeoutSecs** integer | null nullable
  * **build** string | null nullable
  * **memoryMbytes** integer | null nullable
  * **disableStandbyFieldsOverride** boolean | null nullable
  * **shouldPassActorInput** boolean | null nullable

### Status 200

**Response Headers**




```
{
  "data": {
    "id": "zdc3Pyhyz3m8vjDeM",
    "userId": "wRsJZtadYvn4mBZmm",
    "actId": "asADASadYvn4mBZmm",
    "name": "my-task",
    "username": "janedoe",
    "createdAt": "2018-10-26T07:23:14.855Z",
    "modifiedAt": "2018-10-26T13:30:49.578Z",
    "removedAt": "2024-07-29T15:51:28.071Z",
    "stats": {
      "totalRuns": 15
    },
    "options": {
      "build": "latest",
      "timeoutSecs": 300,
      "memoryMbytes": 128,
      "restartOnError": false,
      "maxItems": 0
    },
    "input": {
      "startUrls": [
        {
          "url": "https://example.com"
        }
      ],
      "maxRequestsPerCrawl": 100
    },
    "title": "string",
    "actorStandby": {
      "isEnabled": true,
      "desiredRequestsPerActorRun": 0,
      "maxRequestsPerActorRun": 0,
      "idleTimeoutSecs": 0,
      "build": "string",
      "memoryMbytes": 0,
      "disableStandbyFieldsOverride": true,
      "shouldPassActorInput": true
    },
    "standbyUrl": "string"
  }
}
```


**Schema**

* **data** object required

  * **id** string required\
    **Example:** `zdc3Pyhyz3m8vjDeM`

  * **userId** string required\
    **Example:** `wRsJZtadYvn4mBZmm`

  * **actId** string required\
    **Example:** `asADASadYvn4mBZmm`

  * **name** string required\
    **Example:** `my-task`

  * **username** string | null nullable\
    **Example:** `janedoe`

  * **createdAt** string\<date-time> required\
    **Example:** `2018-10-26T07:23:14.855Z`

  * **modifiedAt** string\<date-time> required\
    **Example:** `2018-10-26T13:30:49.578Z`

  * **removedAt** string,null\<date-time> nullable

  * **stats** object

    * anyOf
      * TaskStats
      * null
      **totalRuns** integer\
      **Example:** `15`

  * **options** object

    * anyOf
      * TaskOptions
      * null
      **build** string | null nullable\
      **Example:** `latest`
    * **timeoutSecs** integer | null nullable\
      **Example:** `300`
    * **memoryMbytes** integer | null nullable\
      **Example:** `128`
    * **restartOnError** boolean | null nullable\
      **Example:** `false`
    * **maxItems** integer | null nullable

  * **input** object

    * anyOf

      * TaskInput
      * null

      object

      The input configuration for the Actor task. This is a user-defined JSON object that will be passed to the Actor when the task is run.

      **Example:** `{"startUrls":[{"url":"https://example.com"}],"maxRequestsPerCrawl":100}`

  * **title** string | null nullable

  * **actorStandby** object

    * anyOf
      * ActorStandby
      * null
      **isEnabled** boolean | null nullable
    * **desiredRequestsPerActorRun** integer | null nullable
    * **maxRequestsPerActorRun** integer | null nullable
    * **idleTimeoutSecs** integer | null nullable
    * **build** string | null nullable
    * **memoryMbytes** integer | null nullable
    * **disableStandbyFieldsOverride** boolean | null nullable
    * **shouldPassActorInput** boolean | null nullable

  * **standbyUrl** string,null\<uri> nullable

### 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 required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 401

Unauthorized - authentication required or invalid token.


```
{
  "error": {
    "type": "token-not-valid",
    "message": "Authentication token is not valid."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 403

Forbidden - insufficient permissions to perform this action.


```
{
  "error": {
    "type": "permission-denied",
    "message": "You do not have permission to perform this action."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 404

Not found - the requested resource does not exist.


```
{
  "error": {
    "type": "record-not-found",
    "message": "The requested resource was not found."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 405

Method not allowed.


```
{
  "error": {
    "type": "method-not-allowed",
    "message": "This API end-point can only be accessed using the following HTTP methods: OPTIONS,GET"
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 413

Payload too large - the request body exceeds the size limit.


```
{
  "error": {
    "type": "request-too-large",
    "message": "The POST payload is too large (limit: 9437184 bytes, actual length: 10485760 bytes)."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 415

Unsupported media type - the Content-Encoding of the request is not supported.


```
{
  "error": {
    "type": "unsupported-content-encoding",
    "message": "Content-Encoding \"bla\" is not supported."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 429

Too many requests - rate limit exceeded.


```
{
  "error": {
    "type": "rate-limit-exceeded",
    "message": "You have exceeded the rate limit. Please try again later."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`
