---
title: "Update a task"
method: PUT
path: "/schedules/{scheduleId}/tasks/{taskId}"
tags: ["Task"]
---

# Update a task

`PUT /schedules/{scheduleId}/tasks/{taskId}`

## Request body

- TaskRequest
  - `label` string — A recognizable label for your reference
  - `filename` string — The filename for the merged PDF.
  - `subject` string — Subject of the email
  - `mailinglists` unknown[]
    - unknown
  - `emails` unknown[]
    - unknown
  - `send_type` 'to' | 'cc' | 'bcc' — Send the email with the following method
  - `from_email` string — Email address to use in the from email field. Note that you need permission with the authenticated email account to send an email with this email address.
  - `from_name` string — Name from in the email
  - `reply_to_email` string — The reply to email address in the email
  - `reply_to_name` string — The reply to name in the email
  - `active` boolean — When the task is active, it will be sent once the schedule is executed.
  - `save` boolean — Save a copy of the PDF on your server
  - `notify_on_failure` boolean — In case a task would fail, all recipients will get a notification that we were not able to send the email. We are aware of the issue and are working on it. This way we prevent that everyone will notify you about the failed email.
  - `csv_delimiter` string — The delimiter to be used in your csv export
  - `csv_extension` string — The extension for the csv export
  - `views` View[]
    - `id` string — The id of the view. When you add a new view and you want to use it in the message as an inline image, you can give it a temp-12345 id and work with that.
    - `label` string — Recognizable label of the view
    - `workbook_id` string — Tableau workbook id. Obtain from Tableau API request
    - `view_id` string — Tableau view id. Obtain from Tableau API request
    - `is_landscape` boolean — When true, export in landscape orientation.
    - `order` integer — The display order of the views. Use integers from 1 upwards.
    - `export_types` 2 | 3 | 4 | 6 — Export type: * 2 - PDF of the view * 3 - Excel crosstab of the view * 4 - CSV of the view * 6 - Image of the view
    - `filters` Filter[] — Filters for the view.
      - `id` string
      - `key` string
      - `value` string
  - `templates` Template[] — Templates are part of the email. You have templates for the headers and footers, but also for the main content of the email.
    - `id` string — The id of the template record
    - `label` string — recognizable label for your reference
    - `position` 'header-left' | 'header-center' | 'header-right' | 'body' | 'footer-left' | 'footer-center' | 'footer-right' — The position of the template in the email.
    - `is_global` boolean — The template can be re-used if it is a global template. If not, it will only be used by this task in this email template position.
    - `body` string — Richtext body
    - `img_id` string — If you use an image file, specify the image ID.
    - `img_url` string — If you use an image url, specify it here.
    - `img_width` integer — Image width in px
    - `img_height` integer — Image height in px
    - `img_align` 'left' | 'center' | 'right' — The aligment of the image within the cell. left, center, right

## Response `200`

successfully updated

## Other responses

- `404` — Model not found
- `422` — Unprocessable Content
- `500` — Server error

---

[API](https://skmtc.net/gitbookio/apis/mailscheduler.md) · [All operations](https://skmtc.net/gitbookio/apis/mailscheduler/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitbookio/mailscheduler/revisions/c6c3717d477d/schema)
