Create and Manage Report Packages

Create Tableau report packages, configure their schedules and destinations, then execute and monitor them through the ATRS API.

A report package brings related Tableau reports into one scheduled delivery. Use the ATRS API to create the package, choose its reports and destinations, then execute it and monitor the result.

For a complete PowerShell example, see Create a Report Package and Execute It.

Before you begin

You need:

  • A running ATRS API and a valid access token.
  • An ATRS folder in which to save the package.
  • A configured Tableau account with access to the views you want to include.
  • The Tableau view IDs and URLs, available through resource discovery.
  • A test email recipient or a folder accessible to the ATRS execution account.

The PowerShell examples use $AtrsBaseUrl and $AtrsHeaders from the authentication guide. Run the steps in order in the same session. Replace the example identifiers, URLs, folder and recipient before sending a request.

Package endpoints

ActionRequestSuccessful response
Create a packagePOST /api/PackageSchedule/CreateObject containing UniqueId
Retrieve a packageGET /api/PackageSchedule/Get?Id=201Package definition
Search packagesGET /api/PackageSchedule/GetAll, with a JSON bodyArray of packages
Clone a packageGET /api/Package/Clone?Id=201New package ID
List package reportsGET /api/Package/GetReportsInPackage?Id=201Report summaries
Delete a packageDELETE /api/PackageSchedule/Delete?Id=201JSON boolean

The Package controller also provides a create operation. The walkthrough below uses PackageSchedule/Create. Choose the intended endpoint when building your request; do not send a second create request to another endpoint after an uncertain response.

Understand the package definition

FieldPurpose
PackageNameName of the package
FolderPathFolder within ATRS
UniqueIdPackage identifier returned by creation
ScheduleRecurrence, dates and enabled state
ReportsTableau report members
EmailDestinations, DiskDestinationsComplete delivery destination arrays
DataDriven, DataDriverWhether and how input records drive the package
MergePDFFiles, MergedPDFFileNamePDF merging and output name
MergeExcelFiles, MergedExcelFileNameExcel merging and output name

Use PackageName and Reports for the ATRS package. A report member uses fields such as tableauAccountId, tableauItemId, reportUrl, reportName, outputFormat and parameters. Keep their spelling as shown in the reference.

Always include both destination arrays. Use [] for an unused destination type. A standard package needs at least one delivery destination.

1. Build the package

This example combines two Tableau views into one PDF and sends it to a test recipient. Recurring delivery starts disabled.

Paste this complete definition into PowerShell, then replace its example values. Choose the required dates and local ATRS execution time.

$AtrsPackage = @'
{
  "PackageName": "Daily sales package",
  "FolderPath": "/API Reports",
  "Description": "Sales overview and detail",
  "Keywords": "api,sales",
  "DataDriven": false,
  "GroupByEmail": false,
  "MergePDFFiles": true,
  "MergedPDFFileName": "Daily sales package.pdf",
  "MergeExcelFiles": false,
  "Schedule": {
    "Frequency": "Daily",
    "StartDate": "2026-10-20",
    "EndDate": "2027-10-20",
    "ExecutionTime": "09:00",
    "HasEndDate": false,
    "Repeat": false,
    "Enabled": false,
    "DailyRepeatInterval": 1
  },
  "Reports": [
    {
      "tableauAccountId": "YOUR_TABLEAU_ACCOUNT_ID",
      "tableauItemId": "YOUR_OVERVIEW_VIEW_ID",
      "reportUrl": "https://tableau.example.com/views/Sales/Overview",
      "reportName": "Sales overview",
      "customName": "Sales overview",
      "ObjectType": "REPORT",
      "outputFormat": "Acrobat Format (*.pdf)",
      "parameters": []
    },
    {
      "tableauAccountId": "YOUR_TABLEAU_ACCOUNT_ID",
      "tableauItemId": "YOUR_DETAIL_VIEW_ID",
      "reportUrl": "https://tableau.example.com/views/Sales/Detail",
      "reportName": "Sales detail",
      "customName": "Sales detail",
      "ObjectType": "REPORT",
      "outputFormat": "Acrobat Format (*.pdf)",
      "parameters": []
    }
  ],
  "EmailDestinations": [
    {
      "DestinationName": "Operations email",
      "DestinationType": "Email",
      "Enabled": true,
      "OutputFormat": "Acrobat Format (*.pdf)",
      "To": ["[email protected]"],
      "Cc": [],
      "Bcc": [],
      "Subject": "Daily sales package",
      "Body": "The sales reports are attached.",
      "BodyFormat": "TEXT"
    }
  ],
  "DiskDestinations": []
}
'@ | ConvertFrom-Json

If a view needs parameters, include them in that member's parameters array. For example, {"Name":"Region","Value":"North","Type":"String"} supplies a string parameter. Use the actual parameter name and type from your view.

Package members use renderingSettings for Tableau output settings. Single-report schedules use a different client settings object; see Configure Tableau Parameters and Rendering.

2. Create and retrieve the package

$AtrsCreated = Invoke-RestMethod -Method Post `
    -Uri "$AtrsBaseUrl/api/PackageSchedule/Create" `
    -Headers $AtrsHeaders -ContentType "application/json" `
    -Body ($AtrsPackage | ConvertTo-Json -Depth 100) -TimeoutSec 60
$AtrsPackageId = [int]$AtrsCreated.UniqueId
if ($AtrsPackageId -le 0) { throw "No package ID returned. Check ATRS before retrying." }

$AtrsSaved = Invoke-RestMethod -Method Get `
    -Uri "$AtrsBaseUrl/api/PackageSchedule/Get?Id=$AtrsPackageId" `
    -Headers $AtrsHeaders -TimeoutSec 30
$AtrsSaved | ConvertTo-Json -Depth 100

Save the returned package ID. Check its name, recurrence and reports. Open the package in ATRS to check its destinations and merge settings. You can retrieve report summaries separately with GET /api/Package/GetReportsInPackage?Id=201, replacing 201 with that ID.

Use the package-level ID to execute the whole package. A member's UniqueId identifies an individual report; DestinationId identifies a destination.

3. Execute and monitor the package

$AtrsSubmission = Invoke-RestMethod -Method Post `
    -Uri "$AtrsBaseUrl/api/Schedule/ExecuteScheduleAsync" `
    -Headers $AtrsHeaders -ContentType "application/json" `
    -Body (@{ ScheduleType="package"; UniqueId=$AtrsPackageId; RunBy="API" } | ConvertTo-Json) `
    -TimeoutSec 30
$AtrsExecutionId = [string]$AtrsSubmission.ExecutionId
if ([string]::IsNullOrWhiteSpace($AtrsExecutionId)) {
    throw "No execution ID returned. Check ATRS before submitting another run."
}
$AtrsStatusUrl = "$AtrsBaseUrl/api/Schedule/GetExecutionStatus?ExecutionId=$([Uri]::EscapeDataString($AtrsExecutionId))"
Invoke-RestMethod -Method Get -Uri $AtrsStatusUrl -Headers $AtrsHeaders -TimeoutSec 30

Repeat the status request every five seconds for up to five minutes, keeping the same execution ID. When Status is Completed, decode the JSON string in ResultJson and check that its boolean Result is true. Stop and investigate a failed, terminated, stale or unresolved result. The monitoring deadline does not cancel the execution.

Open the delivered PDF and check that it contains both reports with the intended data. The package recipe includes the complete polling and result-checking script.

Destinations and merged output

Set each member's outputFormat to the required Tableau export format. PDF merging requires compatible PDF output; Excel merging requires compatible Excel output. Changing a filename extension does not convert a file.

For disk delivery, replace the email destination with a DiskDestinations entry containing DestinationName, DestinationType: "Disk", Enabled, OutputFormat and OutputPath. Use a server-side folder or share writable by the ATRS execution account, and set EmailDestinations to [] if no email delivery is required.

Add a data driver

Set DataDriven to true and provide a DataDriver to generate reports for input records. Follow Create a Data-Driven Tableau Package for a complete JSON-row example and the report parameter mapping.

Search, clone or delete

Search PackageSchedule/GetAll with a JSON body containing FilterValues, FilterOperator and MatchType. Use LIKE, NOT LIKE, = or <> with ALL or ANY. Missing or blank filters return the unfiltered list.

Clone with GET /api/Package/Clone?Id=201 and retain the new numeric ID. Inspect the copy's recurrence and destinations before using it.

Delete with DELETE /api/PackageSchedule/Delete?Id=201; a successful response is a JSON boolean. Deletion does not recall delivered files or cancel an execution already in progress.

After a timeout during creation, cloning or execution submission, check ATRS before retrying to avoid another package or duplicate delivery.


Did this page help you?