---
schema_version: "1"
id: b9f10ce8bbda97fe40d178531af0c2483b00aef2f7a49abd1dafdf9cb9ba5b89
title: Subscriptions Methods
collection: tableau
version: next
locale: en-us
portal_url: https://docs.salesforce.com/tableau/next/en-us/api/rest_api/REST/rest_api_ref_subscriptions.md
canonical_url: https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_ref_subscriptions.htm
source_site: help.tableau.com
content_type: documentation
content_hash: 63efffbf29d53a57e6f25e2eed099dd976748b5eaee46f583ed63e08323da0df
description: "Using the subscriptions methods of the Tableau Server REST API you can do the operations listed in the following category:"
---
[Skip to main content](#main-content)

# Subscriptions Methods

Using the subscriptions methods of the Tableau Server REST API you can do the operations listed in the following category:

**Subscriptions** (scheduled e-mails to users of snapshots of a workbook's views)

- List all subscriptions configured for a site or get the details of a specific subscription
- Create a subscription to a workbook or view for a user and add it to a schedule
- Update or delete a subscription for a user
- Set or get the format of images delivered by a subscription
- Suspend or resume a subscription

This functionality relates to the UI elements and concepts described at: [Subscribe to Views](https://help.tableau.com/current/server/en-us/subscribe_user.htm).

## Use Postman

Our Postman collection of requests enables you to construct, send, and examine HTTP requests to the Tableau Server or Tableau Cloud API without writing initial code. Postman is a free online app used by many developers for prototyping API calls, investigating issues, and generating request code in a variety of languages.

[Postman: Subscriptions](https://www.postman.com/salesforce-developers/salesforce-developers/folder/9bgg58b/subscriptions)

## Create Subscription

Creates a new subscription to a view or workbook for a specific user on Tableau Server and Tableau Cloud. When a user is subscribed to the content, Tableau sends the content to the user in email on the schedule that you define.

For more information, see [Subscribe to Views](https://help.tableau.com/current/server/en-us/subscribe_user.htm) in the Tableau Server documentation.

Tableau Server and Tableau Cloud each have a different model for schedules and tasks. On Tableau Server, you create a schedule and add a task to it. On Tableau Cloud you create a task and define it's frequency. While the Create Subscription endpoint path and parameters are the same for both Server and Cloud, because the models are different, the request and response bodies are different.

- [Tableau Server Request](#create_subscription_server)
- [Tableau Cloud Request](#create_subscription_cloud)

**Note**: After you create a resource, the server updates its search index. If you make a query immediately to see a new resource, the query results might not be up to date.

#### URI

POST /api/api-version/sites/site-id/subscriptions

#### Parameter Values

<table class="api-parameters-table"><colgroup><col class="api-parameters-table-col-1"> <col></colgroup><tbody><tr><td><span class="api-placeholder">api-version</span></td><td>The version of the API to use, such as <code><span class="mc-variable Variables.REST-API-Version variable">3.29</span></code>. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm" class="xref">REST API and Resource Versions</a>.</td></tr><tr><td><span class="api-placeholder">site-id</span></td><td>The ID of the site to create the subscription in.</td></tr></tbody></table>

#### JWT Access Scope

`tableau:tasks:create` _(this scope is included in the scope: `tableau:tasks`)_

This scope can be used to enable this REST method to be called from a unified access token (UAT) or connected app. For more information, see [Access scopes for UATs](https://help.tableau.com/current/api/cloud-manager/en-us/docs/unified_access_tokens.html#scopes) (Cloud), or [Tableau Cloud connected app scopes](https://help.tableau.com/current/online/en-us/connected_apps_scopes.htm) or [Tableau Server connected apps scopes](https://help.tableau.com/current/server/en-us/connected_apps_scopes.htm). _Available in API 3.20 (Tableau Cloud June 2023) / Tableau Server 2023.3._

### Tableau Server Request

Create a subscription task and add it to a server schedule on Tableau Server.  
_For Tableau Cloud, see [Tableau Cloud Request](#create_subscription_cloud)._

#### Request Body

```
<tsRequest>
  <subscription
    subject="subscription-subject"
    attachImage="attach-image-flag"
    attachPdf="attach-pdf-flag"
    pageOrientation="page-orientation"
    pageSizeOption="page-size-option"
    message="message"
    suspended="suspended-flag">
      <content id="content-id"
        type="content-type"
        sendIfViewEmpty="send-view-if-empty-flag"
        customViewId="custom-view-id"/>
      <schedule id="schedule-id" />
      <user id="user-id" />
    </subscription>
</tsRequest>
```

```
{
  "subscription": {
    "subject": "subscription-subject",
    "attachImage": "attach-image-flag",
    "attachPdf": "attach-pdf-flag",
    "pageOrientation": "page-orientation",
    "pageSizeOption": "page-size-option",
    "message": "message",
    "suspended": "suspended-flag",
    "content": {
      "id": "content-id",
      "type": "content-type",
      "sendIfViewEmpty": "send-view-if-empty-flag",
      "customViewId": "custom-view-id"
    },
    "schedule": {
      "id": "schedule-id"
    },
    "user": {
      "id": "user-id"
    }
  }
}
```

<table class="api-parameters-table">
                        <colgroup>
                            <col class="api-parameters-table-col-1-extra-wide">
                            <col>
                        </colgroup>
                        <tbody>
                            <tr>
                                <td><span class="api-placeholder">subscription-subject</span>
                                </td>
                                <td>A description for the subscription. This description is displayed when users list subscriptions for a site in the server environment.
								A description is required.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">attach-image-flag</span>
                                </td>
                                <td>
                                    <p>(Optional) Setting this <code>true</code> will cause the subscriber to receive mail with .png images of workbooks or views attached to it. This is the default
								behavior if neither <code>attachImage</code> or <code>attachPdf</code> are specified.</p>
                                    <p>If subscriptions to attachments are disabled in Tableau server or site settings,
								then making a request that sets <code>attachImage</code> to <code>false</code> will cause an error.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">attach-pdf-flag</span>
                                </td>
                                <td>
                                    <p>(Optional) Setting this <code>true</code> will cause the subscriber to receive mail with a .pdf file
								containing images of workbooks or views attached to it.</p>
                                    <p>If subscriptions to attachments are disabled in Tableau server or site settings,
								then  making a request that sets <code>attachPdf</code> to <code>true</code> will cause an error.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">page-orientation</span>
                                </td>
                                <td>
								(Optional) The orientation of the pages produced when <span class="api-placeholder">attach-pdf-flag</span>
								is <code>true</code>. The value can be <code>Portrait</code> or
								<code>Landscape</code>. If this parameter is not present the page orientation will default to <code>Portrait</code>.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">page-size-option</span>
                                </td>
                                <td>
								(Optional) The type of page produced, which determines the page dimensions when
								<span class="api-placeholder">attach-pdf-flag</span> is <code>true</code>. The value can be:
								<code>A3</code>, <code>A4</code>, <code>A5</code>, <code>B5</code>, <code>Executive</code>, <code>Folio</code>,
								<code>Ledger</code>, <code>Legal</code>, <code>Letter</code>, <code>Note</code>, <code>Quarto</code>, or
								<code>Tabloid</code>. If this parameter is not present the page type will default to <code>Letter</code>.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">message</span>
                                </td>
                                <td>
								The text body of the subscription email message.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">suspended-flag</span>
                                </td>
                                <td>(Optional) If <code>true</code>, the subscription is created in a disabled state, meaning it won't run until it's enabled using the <a href="#update_subscription">Update Subscription</a> method or <span class="uicontrol">Resume Subscription</span> in the web UI. The default value is <code>false</code>.</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">content-type</span>
                                </td>
                                <td><code>Workbook</code> to create a subscription for a workbook, or <code>View</code> to create a subscription for a view.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">send-view-if-empty-flag</span>
                                </td>
                                <td>(Optional) Applies to views only. If <code>true</code>, an image is sent even if the view specified in a subscription is
								empty. If <code>false</code>, nothing is sent if the view is empty. The default value is true.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">custom-view-id</span>
                                </td>
                                <td>(Optional) Applies to views only. The LUID of a custom view to use instead of the default view.</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">content-id</span>
                                </td>
                                <td>The ID of the workbook or view to subscribe to.</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">schedule-id</span>
                                </td>
                                <td>The ID of a schedule to associate the subscription with. To determine what schedules are available,
								call <a href="#query_schedules">List Server Schedules</a>. The type of the schedule must be <code>Subscription</code>.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">user-id</span>
                                </td>
                                <td>The ID of the user to create the subscription for.
							<p class="note"><strong>Note</strong>: The user must have an email address defined in Tableau Server.</p></td>
                            </tr>
                        </tbody>
                    </table>

#### Permissions

The following list summarizes the permissions required to subscribe a user to specific content:

- Tableau Server users who are server administrators can subscribe any user to any content.
- Site administrators can subscribe any user on the site to any content on that site.
- Project leaders can subscribe users to any content that they are project leaders for.
- Content owners can subscribe users to any content they own.
- Non-owners can subscribe themselves to any content that they have Read (view) permissions for.

#### Response Code

201

#### Response Body

```
<tsResponse>
  <subscription id="subscription-id"
    subject="subscription-subject"
    suspended="suspended-flag"
    pageOrientation="page-orientation"
    pageSizeOption="page-size-option"
    message="message" >
      <content id="content-id"
        type="content-type"
        sendIfViewEmpty="send-view-if-empty-flag"/>
      <schedule id="schedule-id" name="schedule-name" />
      <user id="user-id" name="user-name" />
  </subscription>
</tsResponse>
```

```
{
  "subscription": {
    "id": "subscription-id",
    "subject": "subscription-subject",
    "suspended": "suspended-flag",
    "pageOrientation": "page-orientation",
    "pageSizeOption": "page-size-option",
    "message": "message",
    "content": {
      "id": "content-id",
      "type": "content-type",
      "sendIfViewEmpty": "send-view-if-empty-flag"
    },
    "schedule": {
      "id": "schedule-id",
      "name": "schedule-name"
    },
    "user": {
      "id": "user-id",
      "name": "user-name"
    }
  }
}
```

#### Response Headers

```
Location: /api/3.29/sites/site-id/subscriptions/new-subscription-id
```

#### Version

Available in API 2.3 and later. For more information, see [REST API and Resource Versions](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm).

#### Errors

<table class="api-error-table"><colgroup><col class="api-error-table-col-1"> <col class="api-error-table-col-2"> <col class="api-error-table-col-3"> <col></colgroup><tbody><tr><th>HTTP status</th><th><code>error</code> Code</th><th>Condition</th><th>Details</th></tr><tr><td>400</td><td>400000</td><td>Bad request</td><td>The content of the request body is missing or incomplete, or contains malformed XML.</td></tr><tr><td>400</td><td>400067</td><td>Invalid subscription subject</td><td>The subscription subject is null or empty.</td></tr><tr><td>400</td><td>400068</td><td>Invalid subscription target</td><td>The content type specified in the request body is not a workbook or view.</td></tr><tr><td>400</td><td>400069</td><td>Invalid subscription type</td><td>The subscription type is not <code>Workbook</code> or <code>View</code>.</td></tr><tr><td>400</td><td>400069</td><td>Invalid schedule type</td><td>The schedule type is not <code>Subscription</code>.</td></tr><tr><td>403</td><td>403060</td><td>No permissions to create subscription.</td><td>The user does not have permission to create a subscription for the specified content.</td></tr><tr><td>403</td><td>403063</td><td>No user permissions for content.</td><td>The user specified in the request body does not have <span class="api-command-ref">Read</span> (view) permissions for the specified content.</td></tr><tr><td>403</td><td>403064</td><td>No user email address.</td><td>The user does not have an email address.</td></tr><tr><td>404</td><td>404000</td><td>Site not found</td><td>The specified site doesn't correspond to an existing site.</td></tr><tr><td>404</td><td>404002</td><td>User not found</td><td>The user specified in the request body doesn't correspond to an existing user.</td></tr><tr><td>400</td><td>404006</td><td>Workbook not found</td><td>The workbook ID in the request body doesn't correspond to an existing workbook.</td></tr><tr><td>404</td><td>404011</td><td>View not found</td><td>The view ID in the request body doesn't correspond to an existing view.</td></tr><tr><td>404</td><td>404023</td><td>Schedule not found</td><td>The schedule ID in the request body doesn't correspond to an existing schedule.</td></tr><tr><td>405</td><td>405000</td><td>Invalid request method</td><td>Request type was not <span class="api-command-ref">POST</span>.</td></tr></tbody></table>

For more information, see [Handling Errors](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_errors.htm).

### Tableau Cloud Request

Create a subscription task and define its frequency on Tableau Cloud.  
_For Tableau Server, see [Tableau Server Request](#create_subscription_server)._

**Version:** Available in API 3.20 (Tableau Cloud June 2023) and later. Not available for Tableau Server. _[Version Overview](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_versions.htm)_

**License:** No additional license required.

**Permissions:** Administrators and any user with the creator or explorer role can create a custom schedule for a subscription task.  _[Permissions Overview](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_permissions.htm)_

**JWT Access Scope**: tableau:tasks:create     Access Scopes Overview: [Cloud](https://help.tableau.com/current/online/en-us/connected_apps_scopes.htm)

#### URI

POST /api/api-version/sites/site-luid/subscriptions

#### URI Parameter Values

<table class="api-parameters-table"><colgroup><col class="api-parameters-table-col-1-wide"> <col></colgroup><tbody><tr><td><span class="api-placeholder">api-version</span></td><td>The version of the API to use, such as <code><span class="mc-variable Variables.REST-API-Version variable">3.29</span></code>. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm" class="xref">REST API and Resource Versions</a>.</td></tr><tr><td><span class="api-placeholder">site-luid</span></td><td>The LUID for the site.</td></tr></tbody></table>

#### Request Body

```
<tsRequest>
  <subscription
  subject="finance report"
  attachImage="true"
  attachPdf="true"
  pageOrientation="Portrait"
  pageSizeOption="Folio"
  message="Daily finance report"
  suspended="false">
    <content id="13237fd-6365-44d5-925b-644e5281b605"
      type="Workbook"
      sendIfViewEmpty="false"
      customViewId="12ab34cd-56ef-78ab-90cd-12ef34ab56cd"/>
     <user id="6t543fd-6365-44d5-925b-644e52897y65"/>
  </subscription>
  <schedule frequency="Daily">
    <frequencyDetails start="18:30:00" end="23:30:00">
      <intervals>
        <interval hours="4"/>
        <interval weekDay="Sunday"/>
        <interval WeekDay="Wednesday"/>
      </intervals>
    </frequencyDetails>
  </schedule>
</tsRequest>
```

```
{
  "subscription": {
    "subject": "finance report",
    "attachImage": "true",
    "attachPdf": "true",
    "pageOrientation": "true",
    "pageSizeOption": "Folio",
    "message": "daily finance report",
    "suspended": "false",
    "content": {
      "id": "13237fd-6365-44d5-925b-644e5281b605",
      "type": "Workbook",
      "sendIfViewEmpty": "false",
      "customViewId": "12ab34cd-56ef-78ab-90cd-12ef34ab56cd"
    },
    "user": {
      "id": "456"
    }
  },
  "schedule": {
    "frequency": "Daily",
    "frequencyDetails": {
      "start": "18:30:00",
      "end": "23:30:00",
      "intervals": {
        "interval": [
          { "hours": "4" },
          { "weekDay": "Sunday" },
          { "weekDay": "Wednesday" }
        ]
      }
    }
  }
}
```

#### Request Attributes

`subject, contentId, and userId` are **required** to create a custom schedule for a subscription, other attributes are optional with defaults. All attributes are optional when updating a custom schedule for a subscription.

<table class="api-parameters-table">
                        <colgroup>
                            <col width="30%">
                            <col width="70%">
                        </colgroup>
                        <tbody>
                            <tr>
                                <td><code>subscription subject</code>
                                </td>
                                <td><i>(Required to create subscription) string:</i> A description for the subscription. This description is displayed when users list subscriptions for a site in the server environment.
					</td>
                            </tr>
                            <tr>
                                <td><code>subscription attachImage</code>
                                </td>
                                <td>
                                    <p><i>boolean:</i>  Setting this <code>true</code> will cause the subscriber to receive mail with .png images of workbooks or views attached to it. This is the default
						behavior if neither <code>attachImage</code> or <code>attachPdf</code> are specified. Default is <code>false</code>.</p>
                                    <p>If subscriptions to attachments are disabled in Tableau server or site settings,
						then making a request that sets <code>attachImage</code> to <code>false</code> will cause an error.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><code>subscription attachPdf</code>
                                </td>
                                <td>
                                    <p><i>boolean:</i> Setting this <code>true</code> will cause the subscriber to receive mail with a .pdf file
						containing images of workbooks or views attached to it. Default is <code>false</code>.</p>
                                    <p>If subscriptions to attachments are disabled in Tableau server or site settings,
						then  making a request that sets <code>attachPdf</code> to <code>true</code> will cause an error.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><code>subscription pageOrientation</code>
                                </td>
                                <td><i>enumeration:</i> The orientation of the pages produced when <span class="api-placeholder">attach-pdf-flag</span>
						is <code>true</code>. The value can be <code>Portrait</code> or
						<code>Landscape</code>. If this parameter is not present the page orientation will default to <code>Portrait</code>.
					</td>
                            </tr>
                            <tr>
                                <td><code>subscription pageSizeOption</code>
                                </td>
                                <td><i>enumeration:</i> The type of page produced, which determines the page dimensions when
						<span class="api-placeholder">attach-pdf-flag</span> is <code>true</code>. The value can be:
						<code>A3</code>, <code>A4</code>, <code>A5</code>, <code>B5</code>, <code>Executive</code>, <code>Folio</code>,
						<code>Ledger</code>, <code>Legal</code>, <code>Letter</code>, <code>Note</code>, <code>Quarto</code>, or
						<code>Tabloid</code>. If this parameter is not present the page type will default to <code>Letter</code>.
					</td>
                            </tr>
                            <tr>
                                <td><code>subscription message</code>
                                </td>
                                <td><i>string:</i> The text body of the subscription email message.</td>
                            </tr>
                            <tr>
                                <td><code>subscription suspended</code>
                                </td>
                                <td><i>boolean:</i> If <code>true</code>, the subscription is created in a disabled state, meaning it won't run until it's enabled using the <a href="#update_subscription">Update Subscription</a> method or <span class="uicontrol">Resume Subscription</span> in the web UI. The default value is <code>false</code>.</td>
                            </tr>
                            <tr>
                                <td><code>content id</code>
                                </td>
                                <td><i>(Required to create subscription) LUID:</i> The LUID of the workbook or view the user should be subscribed to.
					</td>
                            </tr>
                            <tr>
                                <td><code>content type</code>
                                </td>
                                <td><i>(Required to create subscription) enumeration:</i> <code>Workbook</code> to create a subscription for a workbook, or <code>View</code> to create a subscription for a view.
					</td>
                            </tr>
                            <tr>
                                <td><code>content sendIfViewEmpty</code>
                                </td>
                                <td><i>boolean:</i> Applies to views only. If <code>true</code>, an image is sent even if the view specified in a subscription is
						empty. If <code>false</code>, nothing is sent if the view is empty. The default value is true.
					</td>
                            </tr>
                            <tr>
                                <td><code>content customViewID</code>
                                </td>
                                <td>
                                    <p><i>string:</i> Applies to views only. The LUID of a custom view to use instead of the default view.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><code>userId</code>
                                </td>
                                <td><i>(Required to create subscription) LUID:</i> The LUID of the user to create the subscription for.
					<p class="note"><strong>Note</strong>: The user must have an email address defined in Tableau Server.</p></td>
                            </tr>
                        </tbody>
                    </table> <table class="api-parameters-table">
                        <colgroup>
                            <col width="30%">
                            <col width="70%">
                        </colgroup>
                        <tbody>
                            <tr>
                                <td><code>schedule frequency</code>
                                </td>
                                <td><i>(Required to create subscription) enumeration:</i> The scheduled frequency for triggering the task. Valid values include:
							<ul><li>Hourly</li><li>Daily</li><li>Weekly</li><li>Monthly</li></ul></td>
                            </tr>
                            <tr>
                                <td><code>frequencyDetails start</code>
                                </td>
                                <td><i>(Required to create subscription) time:</i> If the schedule frequency is <code>Daily, Weekly, or Monthly</code>, then <code>start</code>
						is the time of day on which scheduled jobs should run. If the frequency is <code>Hourly</code>, then <code>start</code> is the beginning of the
								time range during which jobs should be started. The valid format is <code>HH:MM:SS</code>.
					</td>
                            </tr>
                            <tr>
                                <td><code>frequencyDetails end</code>
                                </td>
                                <td>
                                    <p><i>(Required to create subscription) time:</i> If the schedule frequency is <code>Hourly</code>, or <code>Daily</code> with an interval of
							<code>hours</code> less than <code>24</code>, then <code>end</code> is the time of day on which scheduled jobs should stop being run.
							The valid format is <code>HH:MM:SS</code>. Time should be specified in 5 minute increments and the difference between start
							and end times should be increments of 60 minutes. For example, a valid <code>frequencyDetail</code> would be:
</p><pre><code>&lt;frequencyDetail start="20:45:00" end="21:45:00"&gt;
  . . .
&lt;/frequencyDetail&gt;</code></pre>
                                </td>
                            </tr>
                            <tr>
                                <td><code>interval <i>{interval type}</i></code>
                                </td>
                                <td><i>(Required to create subscription) string:</i> Defines when and how often a scheduled job executes within the time parameters set in the <code>start</code> and <code>end</code>
							 values of the <code>frequencyDetails</code> of the <code>schedule</code>. The type and valid values for
							an interval expression depend on the declared <code>frequency</code> of the <code>schedule</code> as follows:<br><br><table><colgroup><col width="20%"><col width="80%"></colgroup><tbody><tr align="left"><th><b>Frequency</b></th><th><b>Valid interval values</b></th></tr><tr><td><code>Hourly</code></td><td> The value of an interval for an <code>Hourly</code> schedule can be only one of either:
							<ul><li><code>hours="1"</code>
									The number of hours between jobs. <code>1</code> is the only valid value.</li><li><code>minutes="60"</code>
									 The number of minutes between jobs. <code>60</code> is the only valid value.</li><li><code>weekDay="<i>weekday"</i></code> The weekday(s) the job will be run on.
									Valid values are:  <code>Sunday, Monday, Tuesday, Wednesday,
								 	Thursday, Friday, and Saturday</code>. <br><br>
									For example, to schedule to run a job every hour on Sunday and Wednesday, during the time range specified in <code>frequencyDetails</code>
									use an interval like:
											<pre><code>&lt;intervals&gt;
  &lt;interval hours="1"/&gt;
  &lt;interval weekDay="Sunday"/&gt;
  &lt;interval weekDay="Wednesday"/&gt;
&lt;intervals&gt;</code></pre></li></ul><br></td></tr><tr><td><code>Daily</code></td><td>
									The value of <code>Daily</code> can have multiple <code>weekday</code> elements, but only one <code>hours</code> declaration.
										An <code>hours</code> interval is required.
									<ul><li><code>hours="<i>interval</i>"</code> The interval between execution of jobs on the weekday(s) specified.
											Valid values are <code>2, 4, 6, 8, 12, or 24</code>. Note that if the <code><i>interval</i></code> value of a daily schedule
												is less than <code>24</code>, a <code>frequencyDetail end</code> time must be supplied. </li><li><code>weekDay="<i>weekday</i>"</code> The weekday(s) the job will be run on.
											Valid values are:  <code>Sunday, Monday, Tuesday, Wednesday,
										 	Thursday, Friday, or Saturday</code>. <br><br>
											For example, to schedule to run a job every 4 hours	on Sunday and Wednesday, during the time range specified in <code>frequencyDetails</code>
											use an interval like:<br><pre><code>&lt;intervals&gt;
  &lt;interval hours="4"/&gt;
  &lt;interval weekDay="Sunday"/&gt;
  &lt;interval weekDay="Wednesday"/&gt;
&lt;intervals&gt;</code></pre></li></ul></td></tr><tr><td><code>Weekly</code></td><td><code>weekDay="<i>weekday</i>"</code>
												The day of the week the schedule should run on. You can only specify a single day for a Weekly schedule. Valid values are:
											<code>Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday.</code></td></tr><tr><td><code>Monthly</code></td><td> <p>The day(s) of the month a job should be scheduled to run on. There are two ways to define a monthly interval:</p><p>Specify the day(s) using the number of the day in the month;
											</p><ul><li><code>monthDay="<i>day</i>"</code> The number of the day of the month. Valid values are the whole numbers
												<code>1</code> to <code>31</code> or <code>LastDay</code>. If you specify <code>monthDay</code> by day number
												then you can use multiple <code>interval</code> instances to choose for the job to
												run on multiple days in the month. If you use <code>LastDay</code> then only one instance of <code>interval</code>
												can be used in the schedule to specify the last day of the month.</li></ul><p></p><p>Specify the day by describing which occurrence of a weekday within the month.
										</p><ul><li><code>monthDay="<i>occurrence_of_weekday</i>" Weekday="<i>weekday</i>"</code>
													The occurrence of the specified weekday within the month when a job should be run.
													Valid values for <code><i>occurrencee_of_weekday</i></code> are	<code>First, Second, Third, Fourth, Fifth, or LastDay</code>.
													Valid values for <code><i>weekday</i></code> are
													<code>Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday</code>.
													If the value is <code>lastDay</code> then the job will run on
													the last occurrence of the specified weekday in the month.<br><br>
													For example, to make a schedule that that would run a job on the third Thursday of each month, you would use:<br><pre><code>&lt;interval monthDay="Third" weekDay="Thursday"/&gt;</code></pre></li></ul><p></p></td></tr></tbody></table></td>
                            </tr>
                        </tbody>
                    </table>

#### cURL Request Example

`curl -X POST "https://prod-ca-a.online.tableau.com/api/3.29/sites/a946d998-2ead-4894-bb50-1054a91dcab3/subscriptions" -H "Content-Type: application/xml" --data "<tsRequest> <subscription subject='finance report' attachImage='true' attachPdf='true' pageOrientation='Portrait' pageSizeOption='Folio' message='daily finance report'> <content id='13237fd-6365-44d5-925b-644e5281b605' type='Workbook' sendIfViewEmpty='false'/> <user id='6t543fd-6365-44d5-925b-644e52897y65'/> </subscription> <schedule frequency='Daily'> <frequencyDetails start='18:30:00' end='23:30:00'> <intervals> <interval hours='4'/> <interval weekDay='Sunday'/> <interval weekDay='Wednesday'/> </intervals> </frequencyDetails> </schedule> </tsRequest>"`

#### Response Code

200

#### Response Body

```
<tsResponse>
  <subscription
    id="45678fd-6365-44d5-925b-644e52834567"
    subject="finance report"
    attachImage="true"
    attachPdf="true"
    pageOrientation="Portrait"
    pageSizeOption="Folio"
    message="Daily finance report">
      <content
        id="13237fd-6365-44d5-925b-644e5281b605"
        type="Workbook"
        sendIfViewEmpty="false"/>
      <user id="09876fd-6365-44d5-925b-644e528d5678"/>
  </subscription>
  <schedule id="54321fd-6365-44d5-925b-644e52812345"
    createdAt="2023-04-06T23:43:12-0700"
    updatedAt="2023-04-06T23:43:12-0700"
    frequency="Daily"
    nextRunAt="2023-04-06T23:43:12-0700" />
      <frequencyDetails start="18:30:00" end="23:30:00">
        <intervals>
          <interval hours="4"/>
          <interval weekDay="Sunday"/>
          <interval weekDay="Wednesday"/>
        </intervals>
      </frequencyDetails>
  </schedule>
</tsResponse>
```

```
{
  "subscription": {
    "id": "789",
    "subject": "finance report",
    "attachImage": "true",
    "attachPdf": "true",
    "pageOrientation": "true",
    "pageSizeOption": "Folio",
    "message": "Daily finance report",
    "content": {
      "id": "13237fd-6365-44d5-925b-644e5281b605",
      "type": "Workbook",
      "sendIfViewEmpty": "false"
    },
    "user": {
      "id": "09876fd-6365-44d5-925b-644e528d5678"
    }
  },
  "schedule": {
    "id": "54321fd-6365-44d5-925b-644e52812345",
    "createdAt": "2023-04-06T23:43:12-0700",
    "updatedAt": "2023-04-06T23:43:12-0700",
    "frequency": "Daily",
    "nextRunAt": "2023-04-06T23:43:12-0700",
    "frequencyDetails": {
      "start": "18:30:00",
      "end": "23:30:00",
      "intervals": {
        "interval": [
             { "hours": "4" },
          { "weekDay": "Sunday" },
          { "weekDay": "Wednesday" }
         ]
      }
    }
  }
}
```

#### Errors

<table class="api-error-table"><colgroup><col class="api-error-table-col-1"> <col class="api-error-table-col-2"> <col class="api-error-table-col-3"> <col></colgroup><tbody><tr><th>HTTP status</th><th><code>error</code> Code</th><th>Condition</th><th>Details</th></tr><tr><td>400</td><td>400000</td><td>Bad Request</td><td>The content of the request body is missing or incomplete, or contains malformed XML.</td></tr><tr><td>401</td><td>401002</td><td>Unauthorized Access</td><td>The authentication token provided in the request header was invalid or has expired.</td></tr><tr><td>403</td><td>403004</td><td>Unauthorized Access</td><td>The user is not authorized to make this request..</td></tr><tr><td>404</td><td>404002</td><td>User not found</td><td>The user specified in the request could not be found.</td></tr><tr><td>404</td><td>404025</td><td>Subscription not found</td><td>The task for the subscription could not be found.</td></tr><tr><td>409</td><td>409004</td><td>invalid parameter value</td><td>The request is malformed or contains an invalid or missing schedule or interval parameter value. When the difference between <code>start</code> and <code>end</code> times are not increments of one hour, this error will result.</td></tr></tbody></table>

For more information, see [Handling Errors](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_errors.htm).

## Delete Subscription

Deletes the specified subscription on Tableau Server or Tableau Cloud.

#### URI

DELETE /api/api-version/sites/site-id/subscriptions/subscription-id

#### Parameter Values

<table class="api-parameters-table"><colgroup><col class="api-parameters-table-col-1-wide"> <col></colgroup><tbody><tr><td><span class="api-placeholder">api-version</span></td><td>The version of the API to use, such as <code><span class="mc-variable Variables.REST-API-Version variable">3.29</span></code>. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm" class="xref">REST API and Resource Versions</a>.</td></tr><tr><td><span class="api-placeholder">site-id</span></td><td>The ID of the site that contains the subscription.</td></tr><tr><td><span class="api-placeholder">subscription-id</span></td><td>The ID of the subscription to delete. To determine what subscriptions are available, call <a href="#query_subscriptions">Query Subscriptions</a>.</td></tr></tbody></table>

#### JWT Access Scope

Available in API 3.20 (Tableau Cloud June 2023). Not available for Tableau Server.

`tableau:tasks:delete` (this scope is included in the scope: `tableau:tasks`)

For more information, see [Access scopes for UATs](https://help.tableau.com/current/api/cloud-manager/en-us/docs/unified_access_tokens.html#scopes) (Cloud) and access scopes for connected apps: [Cloud](https://help.tableau.com/current/online/en-us/connected_apps_scopes.htm), [Server-Windows](https://help.tableau.com/current/server/en-us/connected_apps_scopes.htm), or [Server-Linux](https://help.tableau.com/current/server-linux/en-us/connected_apps_scopes.htm).

#### Request Body

None

#### Permissions

Tableau Server users can call this method to delete any subscription that they had permission to create. For details, see [Create Subscription](#create_subscription).

#### Response Code

204

#### Response Body

None

#### Version

Version 2.3 and later. For more information, see [REST API and Resource Versions](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm).

#### Errors

<table class="api-error-table"><colgroup><col class="api-error-table-col-1"> <col class="api-error-table-col-2"> <col class="api-error-table-col-3"> <col></colgroup><tbody><tr><th>HTTP status</th><th><code>error</code> Code</th><th>Condition</th><th>Details</th></tr><tr><td>400</td><td>400062</td><td>Error deleting the subscription.</td><td>An unspecified error occurred during the deletion operation.</td></tr><tr><td>401</td><td>401002</td><td>User not authenticated.</td><td>The user making the request has not been authenticated for this site.</td></tr><tr><td>403</td><td>403059</td><td>Delete forbidden.</td><td>A non-administrator user called this method but doesn't have permission to delete the subscription.</td></tr><tr><td>404</td><td>404000</td><td>Site not found</td><td>The specified site doesn't correspond to an existing site.</td></tr><tr><td>405</td><td>405000</td><td>Invalid request method</td><td>Request type was not <span class="api-command-ref">DELETE</span>.</td></tr></tbody></table>

For more information, see [Handling Errors](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_errors.htm).

## Get Subscription

Returns information about the specified subscription.

**Note**: After you create a resource, the server updates its search index. If you make a query immediately to see a new resource, the query results might not be up to date.

#### URI

GET /api/api-version/sites/site-id/subscriptions/subscription-id

#### Parameter Values

<table class="api-parameters-table"><colgroup><col class="api-parameters-table-col-1-wide"> <col></colgroup><tbody><tr><td><span class="api-placeholder">api-version</span></td><td>The version of the API to use, such as <code><span class="mc-variable Variables.REST-API-Version variable">3.29</span></code>. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm" class="xref">REST API and Resource Versions</a>.</td></tr><tr><td><span class="api-placeholder">site-id</span></td><td>The ID of the site that contains the subscriptions.</td></tr><tr><td><span class="api-placeholder">subscription-id</span></td><td>The ID of the subscription to get information for.</td></tr></tbody></table>

#### JWT Access Scope

`tableau:tasks:read` _(this scope is included in the scope: `tableau:tasks`)_

This scope can be used to enable this REST method to be called from a unified access token (UAT) or connected app. For more information, see [Access scopes for UATs](https://help.tableau.com/current/api/cloud-manager/en-us/docs/unified_access_tokens.html#scopes) (Cloud), or [Tableau Cloud connected app scopes](https://help.tableau.com/current/online/en-us/connected_apps_scopes.htm) or [Tableau Server connected apps scopes](https://help.tableau.com/current/server/en-us/connected_apps_scopes.htm). _Available in API 3.20 (Tableau Cloud June 2023) / Tableau Server 2023.3._

#### Request Body

None

#### Permissions

Tableau Server administrators and all site administrators can get subscription information for users of projects within the scope of their administrative permissions. Other users can get subscription information only for their own subscriptions.

#### Curl Example

`curl "http://MY-SERVER/api/3.29/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/subscriptions/59a8a7b6-be3a-4d2d-1e9e-08a7b6b5b4ba" -X GET -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"`

Tableau Server and Tableau Cloud return different payloads in response to this request.

For Tableau Server: **Server schedule** is returned.

#### Response Code

200

#### Response Body

Tableau Server and Tableau Cloud return different payloads in response to this request.

### Tableau Server Response

For Tableau Server, a subscription task with a server schedule is returned.

Copy

```
<tsResponse>  <subscription id="subscription-id"     subject="subscription-subject"    attachImage="attach-image-flag" attachPdf="attach-pdf-flag"    suspended="suspended-flag"    pageOrientation="page-orientation"    pageSizeOption="page-size-option">      <content id="content-id"           type="content-type"         sendIfViewEmpty="send-view-if-empty-flag"/>      <schedule id="schedule-id" name="schedule-name" />      <user id="user-id" name="user-name" />   </subscription> </tsResponse>
```

Copy

```
{  "subscription": {    "id": "subscription-id",    "subject": "subscription-subject",    "attachImage": "attach-image-flag",    "attachPdf": "attach-pdf-flag",    "suspended": "suspended-flag",    "pageOrientation": "page-orientation",    "pageSizeOption": "page-size-option",    "content": {      "id": "content-id",      "type": "content-type",      "sendIfViewEmpty": "send-view-if-empty-flag"    },    "schedule": {      "id": "schedule-id",      "name": "schedule-name"    },    "user": {      "id": "user-id",      "name": "user-name"    }  }}
```

### Tableau Cloud Response

For Tableau Cloud, a subscription task with frequency is returned.

Copy

```
 <tsResponse>  <subscription id="92cb4f51-7a15-41d4-bce4-a0fcce5fa985" subject="Subscription - postman" message="Test out postman Subscriptions" attachImage="true" attachPdf="false" suspended="false">    <content id="be016ba6-d0a8-44ae-a057-b6df6931ccaa" type="Workbook" sendIfViewEmpty="true"/>    <schedule frequency="Weekly" nextRunAt="2023-06-08T17:05:00-0700">      <frequencyDetails start="17:05:00">        <intervals>          <interval weekDay="Thursday"/>        </intervals>      </frequencyDetails>    </schedule>    <user id="14064b01-7d58-4978-bdeb-a5f8d7694863" name="mysite.com"/>  </subscription></tsResponse>
```

Copy

```
{  "subscription": {    "id": "92cb4f51-7a15-41d4-bce4-a0fcce5fa985",    "subject": "Subscription - postman",    "message": "Test out postman Subscriptions",    "attachImage": "true",    "attachPdf": "false",    "suspended": "false",    "content": {      "id": "be016ba6-d0a8-44ae-a057-b6df6931ccaa",      "type": "Workbook",      "sendIfViewEmpty": "true"    },    "schedule": {      "frequency": "Weekly",      "nextRunAt": "2023-06-08T17:05:00-0700",      "frequencyDetails": {        "start": "17:05:00",        "intervals": {          "interval": [            { "weekDay": "Thursday" }          ]        }      }    },    "user": {      "id": "14064b01-7d58-4978-bdeb-a5f8d7694863",      "name": "gmysite.com"    }  }}
```

#### Version

For Tableau Server: API 2.3 and later. For Tableau Cloud: API 3.20 (June 2023) and later. For more information, see [REST API and Resource Versions](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm).

#### Errors

<table class="api-error-table"><colgroup><col class="api-error-table-col-1"> <col class="api-error-table-col-2"> <col class="api-error-table-col-3"> <col></colgroup><tbody><tr><th>HTTP status</th><th><code>error</code> Code</th><th>Condition</th><th>Details</th></tr><tr><td>403</td><td>403058</td><td>Unauthorized</td><td>The user attempted to get information for a subscription that they don't have permission to access.</td></tr><tr><td>404</td><td>404000</td><td>Site not found</td><td>The specified site doesn't correspond to an existing site.</td></tr><tr><td>404</td><td>404025</td><td>Subscription not found</td><td>The specified subscription doesn't correspond to an existing subscription.</td></tr><tr><td>405</td><td>405000</td><td>Invalid request method</td><td>Request type was not <span class="api-command-ref">GET</span>.</td></tr></tbody></table>

For more information, see [Handling Errors](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_errors.htm).

## List Subscriptions

Returns a list of all the subscriptions on the specified site.

**Note**: After you create a resource, the server updates its search index. If you make a query immediately to see a new resource, the query results might not be up to date.

#### URI

GET /api/api-version/sites/site-id/subscriptions

GET /api/api-version/sites/site-id/subscriptions?pageSize=page-size&pageNumber=page-number

#### Parameter Values

<table class="api-parameters-table"><colgroup><col class="api-parameters-table-col-1-wide"> <col></colgroup><tbody><tr><td><span class="api-placeholder">api-version</span></td><td>The version of the API to use, such as <code><span class="mc-variable Variables.REST-API-Version variable">3.29</span></code>. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm" class="xref">REST API and Resource Versions</a>.</td></tr><tr><td><span class="api-placeholder">site-id</span></td><td>The ID of the site that contains the subscriptions.</td></tr><tr><td><span class="api-placeholder">page-size</span></td><td>(Optional) The number of items to return in one response. The minimum is 1. The maximum is 1000. The default is 100. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_paging.htm">Paginating Results</a>.</td></tr><tr><td><span class="api-placeholder">page-number</span></td><td>(Optional) The offset for paging. The default is 1. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_paging.htm">Paginating Results</a>.</td></tr></tbody></table>

#### JWT Access Scope

`tableau:tasks:read` _(this scope is included in the scope: `tableau:tasks`)_

This scope can be used to enable this REST method to be called from a unified access token (UAT) or connected app. For more information, see [Access scopes for UATs](https://help.tableau.com/current/api/cloud-manager/en-us/docs/unified_access_tokens.html#scopes) (Cloud) or access scopes for connected apps: [Tableau Cloud connected app scopes](https://help.tableau.com/current/online/en-us/connected_apps_scopes.htm) or [Tableau Server connected apps scopes](https://help.tableau.com/current/server/en-us/connected_apps_scopes.htm). _Available in API 3.20 (Tableau Cloud June 2023 / Tableau Server 2023.3._

#### Request Body

None

#### Curl Example

`curl "http://MY-SERVER/api/3.29/sites/9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d/subscriptions" -X GET -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd"`

#### Permissions

Tableau Server administrators and all site administrators can get subscription information for users of projects within the scope of their administrative permissions. Other users can get subscription information only for their own subscriptions.

#### Response Code

200

#### Response Body

Tableau Server and Tableau Cloud return different payloads in response to this request.

### Tableau Server Request

For Tableau Server, a subscription task with a server schedule is returned.

Copy

```
<tsResponse>   <pagination pageNumber="pageNumber"    pageSize="page-size"    totalAvailable="total-available"  />   <subscriptions>     <subscription id="subscription-id"       subject="subscription-subject"       attachImage="attach-image-flag"       attachPdf="attach-pdf-flag"       suspended="suspended-flag"       pageOrientation="page-orientation"       pageSizeOption="page-size-option" >         <content id="content-id"           type="content-type"           sendIfViewEmpty="send-view-if-empty-flag"/>         <schedule id="schedule-id" name="schedule-name"/>         <user id="user-id" name="user-name" />     </subscription>     <!--   ... additional subscriptions ...   -->   </subscriptions> </tsResponse>
```

Copy

```
{  "pagination": {    "pageNumber": "pageNumber",    "pageSize": "page-size",    "totalAvailable": "total-available"  },  "subscriptions": {    "subscription": {      "id": "subscription-id",      "subject": "subscription-subject",      "attachImage": "attach-image-flag",      "attachPdf": "attach-pdf-flag",      "suspended": "suspended-flag",      "pageOrientation": "page-orientation",      "pageSizeOption": "page-size-option",      "content": {        "id": "content-id",        "type": "content-type",        "sendIfViewEmpty": "send-view-if-empty-flag"      },      "schedule": {        "id": "schedule-id",        "name": "schedule-name"      },      "user": {        "id": "user-id",        "name": "user-name"      }    }  }}
```

### Tableau Cloud Request

For Tableau Cloud, a task with frequency is returned.

Copy

```
<tsResponse>  <pagination pageNumber="1" pageSize="100" totalAvailable="1"/>  <subscriptions>    <subscription id="92cb4f51-7a15-41d4-bce4-a0fcce5fa985"       subject="Subscription - postman"       message="weekly report"       attachImage="true"       attachPdf="false"       suspended="false">        <content id="be016ba6-d0a8-44ae-a057-b6df6931ccaa"           type="Workbook" sendIfViewEmpty="true"/>            <schedule frequency="Weekly"               nextRunAt="2023-06-08T17:05:00-0700">                <frequencyDetails start="17:05:00">                  <intervals>                    <interval weekDay="Thursday"/>                  </intervals>                </frequencyDetails>              </schedule>              <user id="14064b01-7d58-4978-bdeb-a5f8d7694863"                 name="me@mysite.com"/>    </subscription>  </subscriptions></tsResponse>
```

Copy

```
{  "pagination": {    "pageNumber": "1",    "pageSize": "100",    "totalAvailable": "1"  },  "subscriptions": {    "subscription": {      "id": "92cb4f51-7a15-41d4-bce4-a0fcce5fa985",      "subject": "Subscription - postman",      "message": "weekly report",      "attachImage": "true",      "attachPdf": "false",      "suspended": "false",      "content": {        "id": "be016ba6-d0a8-44ae-a057-b6df6931ccaa",        "type": "Workbook",        "sendIfViewEmpty": "true"      },      "schedule": {        "frequency": "Weekly",        "nextRunAt": "2023-06-08T17:05:00-0700",        "frequencyDetails": {          "start": "17:05:00",          "intervals": {            "interval": [              { "weekDay": "Thursday" }            ]          }        }      },      "user": {        "id": "14064b01-7d58-4978-bdeb-a5f8d7694863",        "name": "memysite.com"      }    }  }}
```

#### Version

For Tableau Server: API 2.3 and later. For Tableau Cloud: API 3.20 (June 2023) and later. For more information, see [REST API and Resource Versions](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm).

#### Errors

<table class="api-error-table"><colgroup><col class="api-error-table-col-1"> <col class="api-error-table-col-2"> <col class="api-error-table-col-3"> <col></colgroup><tbody><tr><th>HTTP status</th><th><code>error</code> Code</th><th>Condition</th><th>Details</th></tr><tr><td>400</td><td>400006</td><td>Invalid page number</td><td>The page number parameter is not an integer, is less than one, or is greater than the final page number for the sites at the requested page size.</td></tr><tr><td>400</td><td>400007</td><td>Invalid page size</td><td>The page size parameter is not an integer, or is less than one.</td></tr><tr><td>403</td><td>403014</td><td>Page size limit exceeded</td><td>The specified page size is larger than the maximum page size.</td></tr><tr><td>404</td><td>404000</td><td>Site not found</td><td>The specified site doesn't correspond to an existing site.</td></tr><tr><td>405</td><td>405000</td><td>Invalid request method</td><td>Request type was not <span class="api-command-ref">GET</span>.</td></tr></tbody></table>

For more information, see [Handling Errors](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_errors.htm).

## Update Subscription

Modifies an existing subscription on Tableau Server. You can change the subject, server schedule, and suspension state for the subscription.

Tableau Server and Tableau Cloud each have a different model for schedules and tasks. On Tableau Server, you create a schedule and add a task to it. On Tableau Cloud you create a task and define it's frequency. While the Create Subscription endpoint path and parameters are the same for both Server and Cloud, because the models are different, the request and response bodies are different.

- [Tableau Server Requests](#update_subscription_server)
- [Tableau Cloud Request](#update_subscription_cloud)

#### URI

PUT /api/api-version/sites/site-id/subscriptions/subscription-id

#### Parameter Values

<table class="api-parameters-table"><colgroup><col class="api-parameters-table-col-1-wide"> <col></colgroup><tbody><tr><td><span class="api-placeholder">api-version</span></td><td>The version of the API to use, such as <code><span class="mc-variable Variables.REST-API-Version variable">3.29</span></code>. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm" class="xref">REST API and Resource Versions</a>.</td></tr><tr><td><span class="api-placeholder">site-id</span></td><td>The ID of the site that contains the workbook.</td></tr><tr><td><span class="api-placeholder">subscription-id</span></td><td>The ID of the subscription to update.</td></tr></tbody></table>

#### JWT Access Scope

`tableau:tasks:update` _(this scope is included in the scope: `tableau:tasks`)_

This scope can be used to enable this REST method to be called from a unified access token or connected app. For more information, see [Access scopes for UATs](https://help.tableau.com/current/api/cloud-manager/en-us/docs/unified_access_tokens.html#scopes) (Cloud), or [Tableau Cloud connected app scopes](https://help.tableau.com/current/online/en-us/connected_apps_scopes.htm) or [Tableau Server connected apps scopes](https://help.tableau.com/current/server/en-us/connected_apps_scopes.htm). _Available in API 3.20 (Tableau Cloud June 2023 / Tableau Server 2023.3._

### Tableau Server Request

Update the attributes of a subscription task on a server schedule on Tableau Server.  
_For Tableau Cloud, see [Tableau Cloud Request](#update_subscription_cloud)._

```
<tsRequest>
  <subscription
    subject="subscription-subject"
    attachImage="attach-image-flag"
    attachPdf="attach-pdf-flag"
    pageOrientation="page-orientation"
    pageSizeOption="page-size-option"
    suspended="suspended-flag">
      <schedule id="new-schedule-id"
      <content sendIfViewEmpty="send-view-if-empty-flag" />
  </subscription>
</tsRequest>
```

```
{
  "subscription": {
    "subject": "subscription-subject",
    "attachImage": "attach-image-flag",
    "attachPdf": "attach-pdf-flag",
    "pageOrientation": "page-orientation",
    "pageSizeOption": "page-size-option",
    "suspended": "suspended-flag",
    "schedule": {
      "id": "new-schedule-id"
    },
    "content": {
      "sendIfViewEmpty": "send-view-if-empty-flag"
    }
  }
}
```

#### Attribute Values

<table class="api-parameters-table">
                        <colgroup>
                            <col class="api-parameters-table-col-1-extra-wide">
                            <col>
                        </colgroup>
                        <tbody>
                            <tr>
                                <td><span class="api-placeholder">new-subscription-subject</span>
                                </td>
                                <td>(Optional) A new subject for the subscription.</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">attach-image-flag</span>
                                </td>
                                <td>
                                    <p>(Optional) Setting this <code>true</code> will cause the subscriber to receive mail with .png images of workbooks or views attached to it. This is the default
								behavior if neither <code>attachImage</code> or <code>attachPdf</code> are specified.</p>
                                    <p>If subscriptions to attachments are disabled in Tableau server or site settings,
								then making a request that sets <code>attachImage</code> to <code>false</code> will cause an error.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">attach-pdf-flag</span>
                                </td>
                                <td>
                                    <p>(Optional) Setting this <code>true</code> will cause the subscriber to receive mail with a .pdf file
								containing images of workbooks or views attached to it.</p>
                                    <p>If subscriptions to attachments are disabled in Tableau server or site settings,
								then  making a request that sets <code>attachPdf</code> to <code>true</code> will cause an error.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">page-orientation</span>
                                </td>
                                <td>
								(Optional) The orientation of the pages produced when <span class="api-placeholder">attach-pdf-flag</span>
								is <code>true</code>. The value can be <code>Portrait</code> or
								<code>Landscape</code>. If this parameter is not present the page orientation will default to <code>Portrait</code>.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">page-size-option</span>
                                </td>
                                <td>
								(Optional) The type of page produced, which determines the page dimensions when
								<span class="api-placeholder">attach-pdf-flag</span> is <code>true</code>. The value can be:
								<code>A3</code>, <code>A4</code>, <code>A5</code>, <code>B5</code>, <code>Executive</code>, <code>Folio</code>,
								<code>Ledger</code>, <code>Legal</code>, <code>Letter</code>, <code>Note</code>, <code>Quarto</code>, or
								<code>Tabloid</code>. If this parameter is not present the page type will default to <code>Letter</code>.
							</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">suspended-flag</span>
                                </td>
                                <td>
                                    <p>(Optional boolean) If <code>true</code>, the subscription is disabled, meaning it won't run until it's enabled using the <a href="#update_subscription">Update Subscription</a> method or <span class="uicontrol">Resume Subscription</span> in the web UI. If <code>false</code>, the subscription is enabled.							</p>
                                </td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">new-schedule-id</span>
                                </td>
                                <td>(Optional) The ID of a server schedule to associate this subscription with. To determine what schedules are available,
									call <a href="#query_schedules">List Server Schedules</a>. The type of the schedule must be <code>Subscription</code>.
								</td>
                            </tr>
                            <tr>
                                <td><span class="api-placeholder">send-view-if-empty-flag</span>
                                </td>
                                <td>(Optional) Applies to views only. If <code>true</code>, an image is sent even if the view specified in a subscription is empty. If <code>false</code>, nothing is sent if the view is empty. The default value is true.</td>
                            </tr>
                        </tbody>
                    </table>

#### Permissions

Tableau Server users can call this method to update any subscription that they have permission to create. For details, see [Create Server Subscription](#create_subscription).

#### Response Code

200

#### Response Body

```
<tsResponse>
  <subscription id="subscription-id"
    subject="subscription-subject"
    suspended="suspended-flag"
    pageOrientation="page-orientation"
    pageSizeOption="page-size-option" >
      <content id="content-id"
        type="content-type"
        sendIfViewEmpty="send-view-if-empty-flag"/>
      <schedule id="schedule-id" name="schedule-name" />
      <user id="user-id" name="user-name" />
  </subscription>
</tsResponse>
```

```
{
  "subscription": {
    "id": "subscription-id",
    "subject": "subscription-subject",
    "suspended": "suspended-flag",
    "pageOrientation": "page-orientation",
    "pageSizeOption": "page-size-option",
    "content": {
      "id": "content-id",
      "type": "content-type",
      "sendIfViewEmpty": "send-view-if-empty-flag"
    },
    "schedule": {
      "id": "schedule-id",
      "name": "schedule-name"
    },
    "user": {
      "id": "user-id",
      "name": "user-name"
    }
  }
}
```

#### Version

Version 2.3 and later. For more information, see [REST API and Resource Versions](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm).

#### Errors

<table class="api-error-table"><colgroup><col class="api-error-table-col-1"> <col class="api-error-table-col-2"> <col class="api-error-table-col-3"> <col></colgroup><tbody><tr><th>HTTP status</th><th><code>error</code> Code</th><th>Condition</th><th>Details</th></tr><tr><td>400</td><td>400000</td><td>Bad request</td><td>The content of the request body is missing or incomplete, or contains malformed XML.</td></tr><tr><td>400</td><td>400067</td><td>Invalid subscription subject</td><td>The subscription subject is null or empty.</td></tr><tr><td>400</td><td>400069</td><td>Invalid subscription type</td><td>The subscription type is not <code>Workbook</code> or <code>View</code>.</td></tr><tr><td>400</td><td>400069</td><td>Invalid schedule type</td><td>The schedule type is not <code>Subscription</code>.</td></tr><tr><td>400</td><td>400133</td><td>Invalid data condition type</td><td>The data condition type is invalid for the subscription.</td></tr><tr><td>403</td><td>403065</td><td>No permissions to update subscription.</td><td>The user does not have permission to update the specified subscription.</td></tr><tr><td>404</td><td>404000</td><td>Site not found</td><td>The specified site doesn't correspond to an existing site.</td></tr><tr><td>404</td><td>404023</td><td>Schedule not found</td><td>The schedule ID in the request body doesn't correspond to an existing schedule.</td></tr><tr><td>405</td><td>405000</td><td>Invalid request method</td><td>Request type was not <span class="api-command-ref">PUT</span>.</td></tr></tbody></table>

For more information, see [Handling Errors](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_errors.htm).

### Tableau Cloud Request

Update the attributes of a subscription task and its frequency on Tableau Cloud.  
_For Tableau Server, see [Tableau Server Request](#update_subscription_server)._

**Version:** Available in API 3.20 (Tableau Cloud June 2023) and later. Not available for Tableau Server. _[Version Overview](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_versions.htm)_

**License:** No additional license required.

**Permissions:** Administrators and any user with the creator role can create a custom schedule for a subscription task.  _[Permissions Overview](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_permissions.htm)_

**JWT Access Scope**: tableau:tasks:update     Access Scopes Overview: [Cloud](https://help.tableau.com/current/online/en-us/connected_apps_scopes.htm) | [Server-Windows](https://help.tableau.com/current/server/en-us/connected_apps_scopes.htm) | [Server-Linux](https://help.tableau.com/current/server-linux/en-us/connected_apps_scopes.htm)

#### URI

PUT /api/api-version/sites/site-luid/subscriptions/task-luid

#### URI Parameter Values

<table class="api-parameters-table"><colgroup><col class="api-parameters-table-col-1-wide"> <col></colgroup><tbody><tr><td><span class="api-placeholder">api-version</span></td><td>The version of the API to use, such as <code><span class="mc-variable Variables.REST-API-Version variable">3.29</span></code>. For more information, see <a href="https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_versions.htm" class="xref">REST API and Resource Versions</a>.</td></tr><tr><td><span class="api-placeholder">site-luid</span></td><td>The LUID for the site.</td></tr><tr><td><span class="api-placeholder">task-luid</span></td><td>The LUID of the extract refresh task. Use <a href="#query_subscriptions">Query subscriptions</a> to find task IDs by subscription subject or user.</td></tr></tbody></table>

#### Request Body

```
<tsRequest>
  <subscription
  subject="finance report"
  attachImage="true"
  attachPdf="true"
  pageOrientation="true"
  pageSizeOption="Folio"
  suspended="false"
  message="Daily finance report">
    <content id="13237fd-6365-44d5-925b-644e5281b605"
      type="Workbook"
      sendIfViewEmpty="false"/>
    <user id="6t543fd-6365-44d5-925b-644e52897y65"/>
  </subscription>
  <schedule frequency="Daily">
    <frequencyDetails start="18:30:00" end="23:30:00">
      <intervals>
        <interval hours="4"/>
        <interval weekDay="Sunday"/>
        <interval weekDay="Wednesday"/>
      </intervals>
    </frequencyDetails>
  </schedule>
</tsRequest>
```

```
{
  "subscription": {
    "subject": "finance report",
    "attachImage": "true",
    "attachPdf": "true",
    "pageOrientation": "true",
    "pageSizeOption": "Folio",
    "suspended": "false",
    "message": "daily finance report",
    "content": {
      "id": "13237fd-6365-44d5-925b-644e5281b605",
      "type": "Workbook",
      "sendIfViewEmpty": "false"
    },
    "user": {
      "id": "456"
    }
  },
  "schedule": {
    "frequency": "Daily",
    "frequencyDetails": {
      "start": "18:30:00",
      "end": "23:30:00",
      "intervals": {
        "interval": [
          { "hours": "4" },
          { "weekDay": "Sunday" },
          { "weekDay": "Wednesday" }
        ]

      }
    }
  }
}
```

#### Request Attributes

`subject, contentId, userId` and all `schedule` attributes are **required** to create a custom schedule for a subscription, other attributes are optional with defaults. All attributes are optional when updating a custom schedule for a subscription.

<table class="api-parameters-table">
                        <colgroup>
                            <col width="30%">
                            <col width="70%">
                        </colgroup>
                        <tbody>
                            <tr>
                                <td><code>subscription subject</code>
                                </td>
                                <td><i>(Required to create subscription) string:</i> A description for the subscription. This description is displayed when users list subscriptions for a site in the server environment.
					</td>
                            </tr>
                            <tr>
                                <td><code>subscription attachImage</code>
                                </td>
                                <td>
                                    <p><i>boolean:</i>  Setting this <code>true</code> will cause the subscriber to receive mail with .png images of workbooks or views attached to it. This is the default
						behavior if neither <code>attachImage</code> or <code>attachPdf</code> are specified. Default is <code>false</code>.</p>
                                    <p>If subscriptions to attachments are disabled in Tableau server or site settings,
						then making a request that sets <code>attachImage</code> to <code>false</code> will cause an error.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><code>subscription attachPdf</code>
                                </td>
                                <td>
                                    <p><i>boolean:</i> Setting this <code>true</code> will cause the subscriber to receive mail with a .pdf file
						containing images of workbooks or views attached to it. Default is <code>false</code>.</p>
                                    <p>If subscriptions to attachments are disabled in Tableau server or site settings,
						then  making a request that sets <code>attachPdf</code> to <code>true</code> will cause an error.</p>
                                </td>
                            </tr>
                            <tr>
                                <td><code>subscription pageOrientation</code>
                                </td>
                                <td><i>enumeration:</i> The orientation of the pages produced when <span class="api-placeholder">attach-pdf-flag</span>
						is <code>true</code>. The value can be <code>Portrait</code> or
						<code>Landscape</code>. If this parameter is not present the page orientation will default to <code>Portrait</code>.
					</td>
                            </tr>
                            <tr>
                                <td><code>subscription pageSizeOption</code>
                                </td>
                                <td><i>enumeration:</i> The type of page produced, which determines the page dimensions when
						<span class="api-placeholder">attach-pdf-flag</span> is <code>true</code>. The value can be:
						<code>A3</code>, <code>A4</code>, <code>A5</code>, <code>B5</code>, <code>Executive</code>, <code>Folio</code>,
						<code>Ledger</code>, <code>Legal</code>, <code>Letter</code>, <code>Note</code>, <code>Quarto</code>, or
						<code>Tabloid</code>. If this parameter is not present the page type will default to <code>Letter</code>.
					</td>
                            </tr>
                            <tr>
                                <td><code>subscription message</code>
                                </td>
                                <td><i>string:</i> The text body of the subscription email message.
					</td>
                            </tr>
                            <tr>
                                <td><code>subscription suspended</code>
                                </td>
                                <td><i>boolean:</i> If <code>true</code>, the subscription is disabled, meaning it won't run until it's enabled using the <a href="#update_subscription">Update Subscription</a> method or <span class="uicontrol">Resume Subscription</span> in the web UI. If <code>false</code>, the subscription is enabled.</td>
                            </tr>
                            <tr>
                                <td><code>content id</code>
                                </td>
                                <td><i>(Required to create subscription) LUID:</i> The LUID of the workbook or view the user should be subscribed to.
					</td>
                            </tr>
                            <tr>
                                <td><code>content type</code>
                                </td>
                                <td><i>(Required to create subscription) enumeration:</i> <code>Workbook</code> to create a subscription for a workbook, or <code>View</code> to create a subscription for a view.
					</td>
                            </tr>
                            <tr>
                                <td><code>content sendIfViewEmpty</code>
                                </td>
                                <td><i>boolean:</i> Applies to views only. If <code>true</code>, an image is sent even if the view specified in a subscription is
						empty. If <code>false</code>, nothing is sent if the view is empty. The default value is true.
					</td>
                            </tr>
                            <tr>
                                <td><code>userId</code>
                                </td>
                                <td><i>(Required to create subscription) LUID:</i> The LUID of the user to create the subscription for.
					<p class="note"><strong>Note</strong>: The user must have an email address defined in Tableau Server.</p></td>
                            </tr>
                        </tbody>
                    </table> <table class="api-parameters-table">
                        <colgroup>
                            <col width="30%">
                            <col width="70%">
                        </colgroup>
                        <tbody>
                            <tr>
                                <td><code>schedule frequency</code>
                                </td>
                                <td><i>(Required to create subscription) enumeration:</i> The scheduled frequency for triggering the task. Valid values include:
							<ul><li>Hourly</li><li>Daily</li><li>Weekly</li><li>Monthly</li></ul></td>
                            </tr>
                            <tr>
                                <td><code>frequencyDetails start</code>
                                </td>
                                <td><i>(Required to create subscription) time:</i> If the schedule frequency is <code>Daily, Weekly, or Monthly</code>, then <code>start</code>
						is the time of day on which scheduled jobs should run. If the frequency is <code>Hourly</code>, then <code>start</code> is the beginning of the
								time range during which jobs should be started. The valid format is <code>HH:MM:SS</code>.
					</td>
                            </tr>
                            <tr>
                                <td><code>frequencyDetails end</code>
                                </td>
                                <td>
                                    <p><i>(Required to create subscription) time:</i> If the schedule frequency is <code>Hourly</code>, or <code>Daily</code> with an interval of
							<code>hours</code> less than <code>24</code>, then <code>end</code> is the time of day on which scheduled jobs should stop being run.
							The valid format is <code>HH:MM:SS</code>. Time should be specified in 5 minute increments and the difference between start
							and end times should be increments of 60 minutes. For example, a valid <code>frequencyDetail</code> would be:
</p><pre><code>&lt;frequencyDetail start="20:45:00" end="21:45:00"&gt;
  . . .
&lt;/frequencyDetail&gt;</code></pre>
                                </td>
                            </tr>
                            <tr>
                                <td><code>interval <i>{interval type}</i></code>
                                </td>
                                <td><i>(Required to create subscription) string:</i> Defines when and how often a scheduled job executes within the time parameters set in the <code>start</code> and <code>end</code>
							 values of the <code>frequencyDetails</code> of the <code>schedule</code>. The type and valid values for
							an interval expression depend on the declared <code>frequency</code> of the <code>schedule</code> as follows:<br><br><table><colgroup><col width="20%"><col width="80%"></colgroup><tbody><tr align="left"><th><b>Frequency</b></th><th><b>Valid interval values</b></th></tr><tr><td><code>Hourly</code></td><td> The value of an interval for an <code>Hourly</code> schedule can be only one of either:
							<ul><li><code>hours="1"</code>
									The number of hours between jobs. <code>1</code> is the only valid value.</li><li><code>minutes="60"</code>
									 The number of minutes between jobs. <code>60</code> is the only valid value.</li><li><code>weekDay="<i>weekday"</i></code> The weekday(s) the job will be run on.
									Valid values are:  <code>Sunday, Monday, Tuesday, Wednesday,
								 	Thursday, Friday, and Saturday</code>. <br><br>
									For example, to schedule to run a job every hour on Sunday and Wednesday, during the time range specified in <code>frequencyDetails</code>
									use an interval like:
											<pre><code>&lt;intervals&gt;
  &lt;interval hours="1"/&gt;
  &lt;interval weekDay="Sunday"/&gt;
  &lt;interval weekDay="Wednesday"/&gt;
&lt;intervals&gt;</code></pre></li></ul><br></td></tr><tr><td><code>Daily</code></td><td>
									The value of <code>Daily</code> can have multiple <code>weekday</code> elements, but only one <code>hours</code> declaration.
										An <code>hours</code> interval is required.
									<ul><li><code>hours="<i>interval</i>"</code> The interval between execution of jobs on the weekday(s) specified.
											Valid values are <code>2, 4, 6, 8, 12, or 24</code>. Note that if the <code><i>interval</i></code> value of a daily schedule
												is less than <code>24</code>, a <code>frequencyDetail end</code> time must be supplied. </li><li><code>weekDay="<i>weekday</i>"</code> The weekday(s) the job will be run on.
											Valid values are:  <code>Sunday, Monday, Tuesday, Wednesday,
										 	Thursday, Friday, or Saturday</code>. <br><br>
											For example, to schedule to run a job every 4 hours	on Sunday and Wednesday, during the time range specified in <code>frequencyDetails</code>
											use an interval like:<br><pre><code>&lt;intervals&gt;
  &lt;interval hours="4"/&gt;
  &lt;interval weekDay="Sunday"/&gt;
  &lt;interval weekDay="Wednesday"/&gt;
&lt;intervals&gt;</code></pre></li></ul></td></tr><tr><td><code>Weekly</code></td><td><code>weekDay="<i>weekday</i>"</code>
												The day of the week the schedule should run on. You can only specify a single day for a Weekly schedule. Valid values are:
											<code>Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday.</code></td></tr><tr><td><code>Monthly</code></td><td> <p>The day(s) of the month a job should be scheduled to run on. There are two ways to define a monthly interval:</p><p>Specify the day(s) using the number of the day in the month;
											</p><ul><li><code>monthDay="<i>day</i>"</code> The number of the day of the month. Valid values are the whole numbers
												<code>1</code> to <code>31</code> or <code>LastDay</code>. If you specify <code>monthDay</code> by day number
												then you can use multiple <code>interval</code> instances to choose for the job to
												run on multiple days in the month. If you use <code>LastDay</code> then only one instance of <code>interval</code>
												can be used in the schedule to specify the last day of the month.</li></ul><p></p><p>Specify the day by describing which occurrence of a weekday within the month.
										</p><ul><li><code>monthDay="<i>occurrence_of_weekday</i>" Weekday="<i>weekday</i>"</code>
													The occurrence of the specified weekday within the month when a job should be run.
													Valid values for <code><i>occurrencee_of_weekday</i></code> are	<code>First, Second, Third, Fourth, Fifth, or LastDay</code>.
													Valid values for <code><i>weekday</i></code> are
													<code>Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday</code>.
													If the value is <code>lastDay</code> then the job will run on
													the last occurrence of the specified weekday in the month.<br><br>
													For example, to make a schedule that that would run a job on the third Thursday of each month, you would use:<br><pre><code>&lt;interval monthDay="Third" weekDay="Thursday"/&gt;</code></pre></li></ul><p></p></td></tr></tbody></table></td>
                            </tr>
                        </tbody>
                    </table>

#### cURL Request Example

`curl --location --request PUT "qa-near.tsi.lan/api/3.29/sites/a946d998-2ead-4894-bb50-1054a91dcab3/subscriptions/r2345998-2ead-4894-bb50-1054a9109876" --header "Content-Type: application/xml" --data "<tsRequest> > <subscription subject="finance report" attachImage="true" attachPdf="true" pageOrientation="true" pageSizeOption="Folio" message="daily finance report"> <content id="13237fd-6365-44d5-925b-644e5281b605" type="Workbook" sendIfViewEmpty="false"/><user id="6t543fd-6365-44d5-925b-644e52897y65"/> </subscription> <schedule frequency='Daily'> <frequencyDetails start='18:30:00' end='23:00:00'> <intervals> <interval hours='4'/> <interval weekDay='Sunday'/> <interval weekDay='Wednesday'/> </intervals> </frequencyDetails> </schedule> </tsRequest>"`

#### Response Code

200

#### Response Body

```
<tsResponse>
  <subscription
    id="45678fd-6365-44d5-925b-644e52834567"
    subject="finance report"
    attachImage="true"
    attachPdf="true"
    pageOrientation="true"
    pageSizeOption="Folio"
    message="daily finance report">
      <content
        id="13237fd-6365-44d5-925b-644e5281b605"
        type="Workbook"
        sendIfViewEmpty="false"/>
      <user id="09876fd-6365-44d5-925b-644e528d5678"/>
  </subscription>
  <schedule id="54321fd-6365-44d5-925b-644e52812345"
    createdAt="2023-04-06T23:43:12-0700"
    updatedAt="2023-04-06T23:43:12-0700"
    frequency="Daily"
    nextRunAt="2023-04-06T23:43:12-0700" />
      <frequencyDetails start="18:30:00" end="23:30:00">
        <intervals>
          <interval hours="4"/>
          <interval weekDay="Sunday"/>
          <interval weekDay="Wednesday"/>
        </intervals>
      </frequencyDetails>
  </schedule>
</tsResponse>
```

```
{
  "subscription": {
    "id": "789",
    "subject": "finance report",
    "attachImage": "true",
    "attachPdf": "true",
    "pageOrientation": "true",
    "pageSizeOption": "Folio",
    "message": "daily finance report",
    "content": {
      "id": "13237fd-6365-44d5-925b-644e5281b605",
      "type": "Workbook",
      "sendIfViewEmpty": "false"
    },
    "user": {
      "id": "09876fd-6365-44d5-925b-644e528d5678"
    }
  },
  "schedule": {
    "id": "54321fd-6365-44d5-925b-644e52812345",
    "createdAt": "2023-04-06T23:43:12-0700",
    "updatedAt": "2023-04-06T23:43:12-0700",
    "frequency": "Daily",
    "nextRunAt": "2023-04-06T23:43:12-0700",
    "frequencyDetails": {
      "start": "18:30:00",
      "end": "23:30:00",
      "intervals": {
        "interval": [
          { "hours": "4" },
          { "weekDay": "Sunday" },
          { "weekDay": "Wednesday" }
        ]
      }
    }
  }
}
```

#### Errors

<table class="api-error-table"><colgroup><col class="api-error-table-col-1"> <col class="api-error-table-col-2"> <col class="api-error-table-col-3"> <col></colgroup><tbody><tr><th>HTTP status</th><th><code>error</code> Code</th><th>Condition</th><th>Details</th></tr><tr><td>400</td><td>400000</td><td>Bad Request</td><td>The content of the request body is missing or incomplete, or contains malformed XML.</td></tr><tr><td>401</td><td>401002</td><td>Unauthorized Access</td><td>The authentication token provided in the request header was invalid or has expired.</td></tr><tr><td>403</td><td>403004</td><td>Unauthorized Access</td><td>The user is not authorized to make this request.</td></tr><tr><td>404</td><td>404002</td><td>User not found</td><td>The user specified in the request could not be found.</td></tr><tr><td>404</td><td>404025</td><td>Subscription not found</td><td>The task for the subscription could not be found.</td></tr><tr><td>409</td><td>409004</td><td>invalid parameter value</td><td>The request is malformed or contains an invalid or missing schedule or interval parameter value. When the difference between <code>start</code> and <code>end</code> times are not increments of one hour, this error will result.</td></tr></tbody></table>

For more information, see [Handling Errors](https://help.tableau.com/v0.0/api/rest_api/en-us/REST/rest_api_concepts_errors.htm).