> ## 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.

# Create ReportSubscription

> Create a new ReportSubscription record.

A scheduled email delivery of a saved report or dashboard: the data is attached as CSV, the body carries an AI summary and a link to open it in the dashboard. Use report\_definition\_list / report\_dashboard\_list to find the report or dashboard to schedule.

## 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-Create`** role.

## Request Body

### Required Fields

**BusinessId** `integer` *required*

ID of the business the schedule belongs to.

**Name** `string` *required*

Name of the schedule, e.g. Weekly revenue to finance.

**Recipients** `string` *required*

Email addresses separated by commas or semicolons.

**Frequency** `integer` *required*

Daily, Weekly or Monthly.

**DayOfWeek** `integer` *required*

Weekly schedules: 1 = Monday ... 7 = Sunday.

**DayOfMonth** `integer` *required*

Monthly schedules: day of the month (1-28).

**HourOfDay** `integer` *required*

Hour of the day to send (0-23) in the business time zone.

### Optional Fields

**ReportDefinitionId** `integer`

Saved report to send (exactly one of ReportDefinitionId, ReportDashboardId, TemplateKey or DashboardTemplateKey).

**ReportDashboardId** `integer`

Saved dashboard to send: every report tile is attached as CSV (set either ReportDefinitionId or ReportDashboardId).

**TemplateKey** `string`

Built-in report template to send (key from report\_templates), instead of a saved report.

**DashboardTemplateKey** `string`

Built-in dashboard template to send (key from report\_templates kind=dashboard), instead of a saved dashboard.

**Subject** `string`

Optional email subject; defaults to the report or dashboard name.

**IncludeAttachment** `boolean`

Attach the report data as CSV files.

**IncludeSummary** `boolean`

Include an AI-written summary of the results in the email body.

**ParametersJson** `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.

**Active** `boolean`

Paused schedules are kept but not sent.

**OwnerId** `integer`

User who created the schedule; reports run with this user's permissions (set automatically).

## Code Examples

```bash cURL theme={null}
curl -X POST \
  "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
}'
```

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

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

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

response = requests.post(
    '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
    }
)

data = response.json()
```

## Response

### 200

**Status** `integer`

HTTP status code. `200` on success.

**Message** `string`

A human-readable message confirming the creation.

**Value** `object`

Contains the `Id` of the newly created record.

**WasSuccessful** `boolean`

`true` if the reportsubscription was created successfully.

**Errors** `array`

`null` on success.

```json Example Response theme={null}
{
  "Status": 200,
  "Message": "ReportSubscription was successfully created.",
  "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

**Message** `string`

A summary of the validation error(s), in the format `PropertyName: error message`.

**Value** `any`

`null` on validation failure.

**Errors** `object[]`

Array of validation errors.

**AttemptedValue** `any`

The value that was submitted for the field, or `null` if missing.

**Message** `string`

The validation error message.

**PropertyName** `string`

The name of the property that failed validation.

**WasSuccessful** `boolean`

`false` when the request fails validation.

```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
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.