> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update ReportSubscription

> Update an existing ReportSubscription record.

Updates an existing ReportSubscription record. You must include the `Id` of the record to update along with all required fields.

## Authentication

<Note>
  This endpoint requires OAuth2 authentication. Include a valid bearer token in the `Authorization` header.
  The authenticated user must be a full unrestricted administrator or have the **`ReportSubscription-Edit`** role.
</Note>

## Request Body

### Required Fields

<ParamField body="Id" type="integer" required>
  The Id of the ReportSubscription record to update.
</ParamField>

<ParamField body="BusinessId" type="integer" required>
  ID of the business the schedule belongs to.
</ParamField>

<ParamField body="Name" type="string" required>
  Name of the schedule, e.g. Weekly revenue to finance.
</ParamField>

<ParamField body="Recipients" type="string" required>
  Email addresses separated by commas or semicolons.
</ParamField>

<ParamField body="Frequency" type="integer" required>
  Daily, Weekly or Monthly.
</ParamField>

<ParamField body="DayOfWeek" type="integer" required>
  Weekly schedules: 1 = Monday ... 7 = Sunday.
</ParamField>

<ParamField body="DayOfMonth" type="integer" required>
  Monthly schedules: day of the month (1-28).
</ParamField>

<ParamField body="HourOfDay" type="integer" required>
  Hour of the day to send (0-23) in the business time zone.
</ParamField>

### Optional Fields

<ParamField body="ReportDefinitionId" type="integer">
  Saved report to send (exactly one of ReportDefinitionId, ReportDashboardId, TemplateKey or DashboardTemplateKey).
</ParamField>

<ParamField body="ReportDashboardId" type="integer">
  Saved dashboard to send: every report tile is attached as CSV (set either ReportDefinitionId or ReportDashboardId).
</ParamField>

<ParamField body="TemplateKey" type="string">
  Built-in report template to send (key from report\_templates), instead of a saved report.
</ParamField>

<ParamField body="DashboardTemplateKey" type="string">
  Built-in dashboard template to send (key from report\_templates kind=dashboard), instead of a saved dashboard.
</ParamField>

<ParamField body="Subject" type="string">
  Optional email subject; defaults to the report or dashboard name.
</ParamField>

<ParamField body="IncludeAttachment" type="boolean">
  Attach the report data as CSV files.
</ParamField>

<ParamField body="IncludeSummary" type="boolean">
  Include an AI-written summary of the results in the email body.
</ParamField>

<ParamField body="ParametersJson" type="string">
  Optional JSON: for reports an array of prompt filter overrides \[\{field, op, value}], for dashboards an object of parameter values keyed by parameter id.
</ParamField>

<ParamField body="Active" type="boolean">
  Paused schedules are kept but not sent.
</ParamField>

<ParamField body="OwnerId" type="integer">
  User who created the schedule; reports run with this user's permissions (set automatically).
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    "https://spaces.nexudus.com/api/sys/reportsubscriptions" \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "BusinessId": 0,
      "Name": "",
      "Recipients": "",
      "Frequency": 0,
      "DayOfWeek": 0,
      "DayOfMonth": 0,
      "HourOfDay": 0,
      "Id": 87654321
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://spaces.nexudus.com/api/sys/reportsubscriptions',
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        BusinessId: 0,
        Name: '',
        Recipients: '',
        Frequency: 0,
        DayOfWeek: 0,
        DayOfMonth: 0,
        HourOfDay: 0,
        Id: 87654321
      })
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
      'https://spaces.nexudus.com/api/sys/reportsubscriptions',
      headers={
          'Authorization': 'Bearer YOUR_TOKEN',
          'Content-Type': 'application/json'
      },
      json={
          'BusinessId': 0,
          'Name': '',
          'Recipients': '',
          'Frequency': 0,
          'DayOfWeek': 0,
          'DayOfMonth': 0,
          'HourOfDay': 0,
          'Id': 87654321
      }
  )

  data = response.json()
  ```
</CodeGroup>

## Response

### 200

<ResponseField name="Status" type="integer">
  HTTP status code. `200` on success.
</ResponseField>

<ResponseField name="Message" type="string">
  A human-readable message confirming the update.
</ResponseField>

<ResponseField name="Value" type="object">
  Contains the `Id` of the updated record.
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `true` if the reportsubscription was updated successfully.
</ResponseField>

<ResponseField name="Errors" type="array">
  `null` on success.
</ResponseField>

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "ReportSubscription was successfully updated.",
  "Value": {
    "Id": 87654321
  },
  "OpenInDialog": false,
  "OpenInWindow": false,
  "RedirectURL": null,
  "JavaScript": null,
  "UpdatedOn": "2025-01-15T10:30:00Z",
  "UpdatedBy": "admin@example.com",
  "Errors": null,
  "WasSuccessful": true
}
```

### 400

<ResponseField name="Message" type="string">
  A summary of the validation error(s), in the format `PropertyName: error message`.
</ResponseField>

<ResponseField name="Value" type="any">
  `null` on validation failure.
</ResponseField>

<ResponseField name="Errors" type="object[]">
  Array of validation errors.

  <Expandable>
    <ResponseField name="AttemptedValue" type="any">
      The value that was submitted for the field, or `null` if missing.
    </ResponseField>

    <ResponseField name="Message" type="string">
      The validation error message.
    </ResponseField>

    <ResponseField name="PropertyName" type="string">
      The name of the property that failed validation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="WasSuccessful" type="boolean">
  `false` when the request fails validation.
</ResponseField>

```json Example Response theme={null}
{
  "Message": "Name: is a required field",
  "Value": null,
  "Errors": [
    {
      "AttemptedValue": null,
      "Message": "is a required field",
      "PropertyName": "Name"
    }
  ],
  "WasSuccessful": false
}
```
