# Update schedule


```
PUT 
https://api.apify.com/v2/schedules/:scheduleId
```


Updates a schedule using values specified by a schedule object passed as JSON in the POST payload. If the object does not define a specific property, its value will not be updated.

The response is the full schedule 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

* **scheduleId** string required

  Schedule ID.

  **Example:** `asdLZtadYvn4mBZmm`

### Body**required**

* **name** string | null nullable\
  **Example:** `my-schedule`

* **isEnabled** boolean | null nullable\
  **Example:** `true`

* **isExclusive** boolean | null nullable\
  **Example:** `true`

* **cronExpression** string | null nullable\
  **Example:** `* * * * *`

* **timezone** string | null nullable\
  **Example:** `UTC`

* **description** string | null nullable\
  **Example:** `Schedule of actor ...`

* **title** string | null nullable

* **actions** object\[]

  * oneOf

    * ScheduleCreateActionRunActor
    * ScheduleCreateActionRunActorTask

    **type** string required

    **Possible values:** \[`RUN_ACTOR`]

  * **actorId** string required\
    **Example:** `jF8GGEvbEg4Au3NLA`

  * **runInput** object

    * anyOf
      * ScheduleActionsRunInput
      * null
      **body** string | null nullable\
      **Example:** `{\n "foo": "actor"\n}`
    * **contentType** string | null nullable\
      **Example:** `application/json; charset=utf-8`

  * **runOptions** object

    * anyOf
      * OptionalRunOptions
      * null
      **build** string | null nullable\
      **Example:** `latest`
    * **timeoutSecs** integer | null nullable\
      **Example:** `300`
    * **memoryMbytes** integer | null nullable\
      **Example:** `1024`
    * **maxItems** integer | null nullable\
      **Example:** `1000`
    * **maxTotalChargeUsd** number | null nullable\
      **Example:** `5`
    * **restartOnError** boolean | null nullable\
      **Example:** `false`

### Status 200

**Response Headers**




```
{
  "data": {
    "id": "asdLZtadYvn4mBZmm",
    "userId": "wRsJZtadYvn4mBZmm",
    "name": "my-schedule",
    "cronExpression": "* * * * *",
    "timezone": "UTC",
    "isEnabled": true,
    "isExclusive": true,
    "createdAt": "2019-12-12T07:34:14.202Z",
    "modifiedAt": "2019-12-20T06:33:11.202Z",
    "nextRunAt": "2019-04-12T07:34:10.202Z",
    "lastRunAt": "2019-04-12T07:33:10.202Z",
    "description": "Schedule of actor ...",
    "title": "string",
    "actions": [
      {
        "id": "c6KfSgoQzFhMk3etc",
        "type": "RUN_ACTOR",
        "actorId": "jF8GGEvbEg4Au3NLA",
        "runInput": {
          "body": "{\\n   \"foo\": \"actor\"\\n}",
          "contentType": "application/json; charset=utf-8"
        },
        "runOptions": {
          "build": "latest",
          "timeoutSecs": 300,
          "memoryMbytes": 1024,
          "maxItems": 1000,
          "maxTotalChargeUsd": 5,
          "restartOnError": false
        }
      },
      {
        "id": "c6KfSgoQzFhMk3etc",
        "type": "RUN_ACTOR_TASK",
        "actorTaskId": "jF8GGEvbEg4Au3NLA",
        "input": {}
      }
    ]
  }
}
```


**Schema**

* **data** object required

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

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

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

  * **cronExpression** string required\
    **Example:** `* * * * *`

  * **timezone** string required\
    **Example:** `UTC`

  * **isEnabled** boolean required\
    **Example:** `true`

  * **isExclusive** boolean required\
    **Example:** `true`

  * **createdAt** string\<date-time> required\
    **Example:** `2019-12-12T07:34:14.202Z`

  * **modifiedAt** string\<date-time> required\
    **Example:** `2019-12-20T06:33:11.202Z`

  * **nextRunAt** string,null\<date-time> nullable\
    **Example:** `2019-04-12T07:34:10.202Z`

  * **lastRunAt** string,null\<date-time> nullable\
    **Example:** `2019-04-12T07:33:10.202Z`

  * **description** string | null nullable\
    **Example:** `Schedule of actor ...`

  * **title** string | null nullable

  * **actions** object\[] required

    * oneOf
      * ScheduleActionRunActor
      * ScheduleActionRunActorTask
      **id** string required\
      **Example:** `c6KfSgoQzFhMk3etc`

    * **type** string required

      **Possible values:** \[`RUN_ACTOR`]

    * **actorId** string required\
      **Example:** `jF8GGEvbEg4Au3NLA`

    * **runInput** object

      * anyOf
        * ScheduleActionsRunInput
        * null
        **body** string | null nullable\
        **Example:** `{\n "foo": "actor"\n}`
      * **contentType** string | null nullable\
        **Example:** `application/json; charset=utf-8`

    * **runOptions** object

      * anyOf
        * OptionalRunOptions
        * null
        **build** string | null nullable\
        **Example:** `latest`
      * **timeoutSecs** integer | null nullable\
        **Example:** `300`
      * **memoryMbytes** integer | null nullable\
        **Example:** `1024`
      * **maxItems** integer | null nullable\
        **Example:** `1000`
      * **maxTotalChargeUsd** number | null nullable\
        **Example:** `5`
      * **restartOnError** boolean | null nullable\
        **Example:** `false`

### 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)`
