Manage Destinations and Output Settings
Configure PBRS email and disk destinations, manage recipients and output formats, and safely add, update, or remove email destinations through the REST API.
Destinations control where PBRS sends a report and which output format it generates. A single-report schedule can include email destinations, disk destinations, or both.
For a complete PowerShell example, follow Update Email Recipients Without Changing Other Destination Settings. The recipe updates To recipients, preserves other destination settings, and verifies the saved changes without executing the schedule.
Use the dedicated email destination endpoints to add an email destination, update its recipients or message, or delete it. To manage disk destinations or change other output settings, update the complete schedule definition.
Before you begin
You need:
- A running PBRS API service.
- A valid access token.
- The
uniqueidof the schedule you want to manage. - Access to the schedule’s current configuration.
Send your access token with each request:
Authorization: Bearer YOUR_ACCESS_TOKENFor requests with a JSON body, also send:
Content-Type: application/jsonSchedule IDs and destination IDs identify different objects:
| Field | Identifies |
|---|---|
uniqueid | The schedule in a schedule definition |
ParentId | The schedule that owns a destination |
DestinationId | An individual destination |
ExecutionId | A schedule execution, not a schedule or destination |
Read the existing destinations
Retrieve the schedule before changing its destinations. Use the endpoint that matches the report source.
| Report source | Request |
|---|---|
| Power BI | GET /api/SingleSchedule/Get?Id=101 |
| Power BI paginated report | GET /api/SingleSchedule/GetPaginated?Id=101 |
| SQL Server Reporting Services | GET /api/SingleSchedule/GetForSSRS?Id=101 |
| Power BI Report Server | GET /api/SingleSchedule/GetPBirs?Id=101 |
Inspect the EmailDestinations and DiskDestinations collections. Record the DestinationId of each destination you intend to change or retain.
Do not assume the retrieved response is a complete, reusable update request. Some settings may be omitted or returned in a form that cannot be submitted unchanged. Keep an authoritative copy of the schedule configuration, including any required export settings and credentials.
Email destination operations
| Action | Request |
|---|---|
| Add an email destination | POST /api/SingleSchedule/AddEmailDestination |
| Update recipients or message settings | PUT /api/SingleSchedule/UpdateEmailDestination |
| Delete an email destination | DELETE /api/SingleSchedule/DeleteEmailDestination?destinationId=701 |
These operations apply to single-report schedules. Do not substitute package IDs for single-report schedule IDs.
Add an email destination
Send a JSON request containing the parent schedule ID and at least one recipient in To.
POST /api/SingleSchedule/AddEmailDestination?clearExisting=false{
"ParentId": 101,
"DestinationName": "Operations email",
"DestinationType": "Email",
"Enabled": true,
"OutputFormat": "Acrobat Format (*.pdf)",
"To": [
"[email protected]"
],
"Cc": [],
"Bcc": [],
"Subject": "Daily sales report",
"Body": "Attached is the daily sales report.",
"BodyFormat": "TEXT",
"EmbedReport": false
}Replace 101 with the schedule’s uniqueid and replace the example address with the intended recipient.
A successful request returns HTTP 200 with the new destination ID:
{
"DestinationId": 701
}Save this ID for later updates or deletion.
Preserve or replace existing email destinations
The optional clearExisting query parameter defaults to false.
| Value | Behavior |
|---|---|
false | Adds the new email destination and retains existing email destinations |
true | Deletes existing email destinations for the parent schedule before adding the new destination |
clearExisting=true does not remove disk destinations or other destination types.
Use
clearExisting=trueonly when you intend to replace every existing email destination. Existing email destinations are deleted before the new one is added; do not assume they will be restored if the addition fails.
Recipient fields
Provide recipients as JSON arrays.
{
"To": [
"[email protected]",
"[email protected]"
],
"Cc": [
"[email protected]"
],
"Bcc": []
}Do not submit multiple addresses as one comma-separated string.
Update an email destination
Use the dedicated update endpoint to change recipients, subject, body, body format, or sender fields.
PUT /api/SingleSchedule/UpdateEmailDestinationThis operation requires the existing DestinationId. It does not accept a complete email destination definition.
Preserve fields when making a selective update
The endpoint treats empty arrays, null, and omitted fields differently.
| Field | Supplied value | Behavior |
|---|---|---|
To | Nonempty array | Replaces the current recipients |
To | null or [] | Preserves the current recipients |
Cc, Bcc | Nonempty array | Replaces the current recipients |
Cc, Bcc | null | Preserves the current recipients |
Cc, Bcc | [] | Clears the current recipients |
Subject, Body, CustomSenderName, CustomerSenderAddress | Nonempty string | Replaces the current value |
Subject, Body, CustomSenderName, CustomerSenderAddress | null or "" | Preserves the current value |
BodyFormat | "TEXT" or "HTML" | Sets the body format |
BodyFormat | null or "" | Preserves the current format |
Omitting Cc or Bcc can clear those recipients because their default is an empty array. Omitting BodyFormat can change an existing HTML body to text because its default is TEXT.
Use explicit JSON null values when preserving these fields.
Change only the subject
{
"DestinationId": 701,
"To": null,
"Cc": null,
"Bcc": null,
"Subject": "Updated daily sales report",
"Body": null,
"BodyFormat": null,
"CustomSenderName": null,
"CustomerSenderAddress": null
}A successful request returns HTTP 200:
{
"Message": "Email destination updated successfully",
"DestinationId": 701
}Replace recipients and clear CC recipients
This example replaces To, clears Cc, and preserves Bcc and the existing body format.
{
"DestinationId": 701,
"To": [
"[email protected]"
],
"Cc": [],
"Bcc": null,
"BodyFormat": null
}An empty To array does not clear the primary recipients. Similarly, an empty string does not clear the subject, body, or sender fields.
Settings that require a full schedule update
The dedicated email update endpoint does not change:
- Destination name.
- Destination enabled state.
- Output format.
- Custom output filename or extension.
- Report embedding settings.
- Power BI data-only Excel export settings.
To change these settings, use the appropriate full schedule update endpoint.
The selective-update rules above apply only to
UpdateEmailDestination. Do not apply them to destination collections in a full schedule update.
Delete an email destination
First retrieve the parent schedule and confirm that the destination ID belongs to the destination you intend to remove.
Then send:
DELETE /api/SingleSchedule/DeleteEmailDestination?destinationId=701Use the query parameter destinationId. Do not send a request body.
A successful request returns HTTP 200:
{
"Message": "Email destination deleted successfully",
"DestinationId": 701
}Retrieve the parent schedule again to verify that the destination was removed and the destinations you intended to retain are still present.
Deleting a destination does not recall output that has already been delivered. Do not rely on deletion to cancel an execution already in progress.
Choose the output format
Set OutputFormat on the destination using the exact format name supported by the report source.
| Output | OutputFormat value |
|---|---|
Acrobat Format (*.pdf) | |
| Power BI data-only Excel export | MS Excel - Data Only (*.xlsx) |
Output support depends on the report source and export configuration. Do not assume that a format available for one source is available for every source.
For Power BI data-only Excel exports, provide a nonempty PowerBIDataOnlyExportSettings collection containing the required export configuration.
See Export Power BI Visual Data to Excel for the export settings and examples.
Custom filenames and extensions
Destinations can include:
| Field | Purpose |
|---|---|
CustomOutputFileName | Sets a custom output filename |
CustomOutputExtension | Sets a custom output extension |
Leave these fields at their defaults unless you need to override the generated name.
Changing the extension does not change the generated file format. Select the format through OutputFormat.
Configure the email message
Text and HTML bodies
Use BodyFormat to specify how PBRS interprets Body.
| Value | Body content |
|---|---|
TEXT | Plain text |
HTML | HTML markup |
For example:
{
"DestinationId": 701,
"To": null,
"Cc": null,
"Bcc": null,
"Subject": "Daily sales report",
"Body": "<p>Hello,</p><p>Your daily sales report is attached.</p>",
"BodyFormat": "HTML"
}Use a JSON serializer when building requests programmatically so that quotes, line breaks, and HTML content are escaped correctly.
Sender fields
| Field | Purpose |
|---|---|
CustomSenderName | Custom sender display name |
CustomerSenderAddress | Custom sender email address |
The API field is spelled CustomerSenderAddress. It is a sender address, not a reply-to address.
The configured mail service must permit the requested sender address. Setting this field does not grant permission to send from that address.
Embed the report
Email destination creation and full schedule definitions support:
EmbedReport: whether to embed the report.EmbedFormat:IMAGEorHTML.
BodyFormat controls the message body. EmbedFormat controls the embedded report representation.
For a standard report attachment, use:
{
"EmbedReport": false
}Embedding affects how PBRS generates and includes the report. Do not assume enabling EmbedReport also retains the normal report attachment. Verify the resulting message with a controlled execution.
Configure a disk destination
Manage disk destinations through the source-specific schedule creation or update endpoint.
The following example is a destination object for inclusion in the schedule’s DiskDestinations array. It is not a complete schedule request.
{
"DestinationName": "Sales export folder",
"DestinationId": 0,
"DestinationType": "Disk",
"OutputFormat": "Acrobat Format (*.pdf)",
"Enabled": true,
"ParentId": 101,
"OutputPath": "C:\\PBRSExports\\Sales"
}Use DestinationId: 0 for a new destination. When retaining or updating an existing destination, provide its existing ID.
OutputPath refers to a path available to the machine executing the PBRS schedule, not the computer sending the API request.
Ensure that:
- The destination folder is accessible from the executing PBRS machine.
- The account used for report execution has permission to write to it.
- Any shared path is accessible from every machine that may execute the schedule.
JSON requires escaped backslashes in Windows paths.
Update destinations through the complete schedule
Use the endpoint for the schedule’s report source.
| Report source | Update endpoint |
|---|---|
| Power BI | POST /api/SingleSchedule/UpdateForPowerBI |
| Power BI paginated report | POST /api/SingleSchedule/UpdateForPaginated |
| SQL Server Reporting Services | POST /api/SingleSchedule/UpdateForSSRS |
| Power BI Report Server | POST /api/SingleSchedule/UpdateForPbirs |
These endpoints update complete schedule definitions. They are not partial destination updates.
Preserve the complete destination collections
Include both EmailDestinations and DiskDestinations as complete, non-null arrays.
| Submitted configuration | Effect |
|---|---|
Existing destination included with its existing DestinationId | Retains that destination for updating |
Destination included with DestinationId: 0 | Treats it as a new destination |
| Existing destination omitted from its collection | Deletes that destination |
| Empty destination array | Requests an empty collection of that destination type |
Missing or null destination collection | Does not preserve the collection and can cause the update to fail |
Keep the resulting destination configuration valid for the schedule.
Full update workflow
- Retrieve the current schedule using the matching read endpoint.
- Combine the retrieved values with your authoritative schedule configuration.
- Preserve the schedule’s existing
uniqueid. - Include the required recurrence configuration.
- Include every email and disk destination you intend to retain.
- Preserve the existing
DestinationIdfor each retained destination. - Apply the intended output or destination changes.
- Preserve unrelated schedule settings, including filters, parameters, bookmarks, rendering settings, and enabled state.
- Submit the complete definition to the matching update endpoint.
- Retrieve the schedule again and verify the result.
Full schedule updates return HTTP 200 with an empty response body. Do not attempt to parse that response as an updated schedule object.
See Create and Update Single Schedules for complete schedule request examples.
Verify the result
After changing a destination:
- Retrieve the schedule again.
- Confirm the destination IDs and enabled states.
- Check recipients, subject, body format, output format, and disk paths.
- Confirm that unrelated destinations remain present.
- Run a controlled execution using an intended test recipient or output folder.
- Monitor the execution and inspect the generated output.
Saving a destination does not execute the schedule or send a report. A successful configuration response confirms that the API accepted the change; verify delivery separately.
Troubleshooting
| Problem | What to check |
|---|---|
| CC or BCC recipients disappeared | In a dedicated email update, use null to preserve them. Empty arrays clear them, and omitted fields can default to empty arrays. |
| An HTML email changed to plain text | Supply "BodyFormat": null to preserve the format, or explicitly set "HTML". |
| Output settings did not change | The dedicated email update endpoint does not accept output settings. Use a complete schedule update. |
| Existing destinations disappeared | Check clearExisting and whether a full update omitted destinations from either collection. |
| A retained destination was recreated | Preserve its existing DestinationId; do not submit 0. |
| A disk export cannot write its file | Check the path and write permissions from the executing PBRS machine. |
| A custom sender is rejected | Check whether the configured mail service authorizes that sender address. |
| A data-only Excel export fails | Check the exact output format and the required PowerBIDataOnlyExportSettings. |
| A full update succeeds but returns no JSON | HTTP 200 with an empty body is the expected response. Retrieve the schedule to inspect the saved configuration. |
Updated about 21 hours ago

