Schedule Lifecycle Reference

Choose the request, identifier and verification step for each schedule action.

Choose the operation for the schedule change you want to make, from renaming or pausing a schedule to running or deleting it.

Before you begin

Complete Authentication and Token Management. The PowerShell examples use $AtrsBaseUrl and $AtrsHeaders from that guide. Run the steps in order in the same PowerShell session. Use your installation’s address and identifiers in place of the examples.

Confirm the schedule’s family and identifier in this installation. The examples below use a single report; package actions use the package-level ID and ScheduleType: "package" for shared schedule actions.

Keep identifiers separate

IdentifierUse
UniqueId in shared requestsStored schedule selected for an action.
Query Id or idStored object selected by the particular lookup, clone, delete or history operation.
ExecutionIdOne API execution for monitoring or cancellation.
ProcessId and ServerNameRunning process and the associated server.

Use the exact spelling in each operation’s schema. One schedule can have several execution IDs.

Create, read and update

Full single-schedule updates need the complete intended definition and destination collections. Retain destination IDs and independently retrieve the result. Successful update has an empty body.

Disable or enable recurring delivery

Select the intended report and disable it with DisableSchedule:

$AtrsLifecycleId = [long](Read-Host "Single-report schedule ID")
$AtrsLifecycleBody = @{UniqueId=$AtrsLifecycleId; ScheduleType="report"} | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "$AtrsBaseUrl/api/Schedule/DisableSchedule" `
    -Headers $AtrsHeaders -ContentType "application/json" -Body $AtrsLifecycleBody -TimeoutSec 30
$AtrsSaved = Invoke-RestMethod -Method Get `
    -Uri "$AtrsBaseUrl/api/SingleSchedule/Get?Id=$AtrsLifecycleId" -Headers $AtrsHeaders -TimeoutSec 30
$AtrsSaved.Schedule | ConvertTo-Json -Depth 20

Expect HTTP 200 with no response body. Confirm disabled recurrence in saved state and ATRS. Disabling prevents future scheduled runs; inspect active work separately.

To resume recurrence deliberately, send the same body to EnableSchedule:

Invoke-RestMethod -Method Post -Uri "$AtrsBaseUrl/api/Schedule/EnableSchedule" `
    -Headers $AtrsHeaders -ContentType "application/json" -Body $AtrsLifecycleBody -TimeoutSec 30

Retrieve the schedule again with the preceding GET and confirm enabled state, next run, local time and destinations.

Rename a schedule

RenameSchedule uses the schedule ID, family and new name:

$AtrsRenameBody = @{
    UniqueId=$AtrsLifecycleId
    ScheduleType="report"
    ScheduleName=(Read-Host "New schedule name")
} | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "$AtrsBaseUrl/api/Schedule/RenameSchedule" `
    -Headers $AtrsHeaders -ContentType "application/json" -Body $AtrsRenameBody -TimeoutSec 30
$AtrsSaved = Invoke-RestMethod -Method Get `
    -Uri "$AtrsBaseUrl/api/SingleSchedule/Get?Id=$AtrsLifecycleId" -Headers $AtrsHeaders -TimeoutSec 30
$AtrsSaved.ScheduleName

Use a nonempty name of at most 255 characters. The successful response is empty; the independent read verifies the saved name.

Clone a schedule

Use SingleSchedule/Clone with the source schedule’s Id:

$AtrsCloneId = Invoke-RestMethod -Method Get `
    -Uri "$AtrsBaseUrl/api/SingleSchedule/Clone?Id=$AtrsLifecycleId" -Headers $AtrsHeaders -TimeoutSec 60
if ($AtrsCloneId -isnot [int] -and $AtrsCloneId -isnot [long]) { throw "Inspect clone response before continuing" }
$AtrsClone = Invoke-RestMethod -Method Get `
    -Uri "$AtrsBaseUrl/api/SingleSchedule/Get?Id=$AtrsCloneId" -Headers $AtrsHeaders -TimeoutSec 30
$AtrsClone | ConvertTo-Json -Depth 100

Cloning returns a JSON integer and creates persisted data despite using GET. Send once and inspect the new schedule’s recurrence, recipients, paths and rendering before allowing it to run. Do not assume a clone starts disabled. For a guaranteed disabled template workflow, use the create guide.

Execute a schedule

Use Quick Start: Execute and Monitor a Schedule for the complete asynchronous workflow.

Execution operationBehavior
ExecuteScheduleAsyncOn-demand submission; retain ExecutionId.
ExecuteScheduleWait for the result; inspect boolean Result.
ExecuteScheduleOnTimeAsyncScheduled-time path; advances NextRun after completion.
ExecuteScheduleByEventAsyncEvent workflow with operation-specific context.

Use only schedule families supported by the selected operation. Confirm dispatch or immediate-process execution availability for your installation before using those separate reference contracts.

Cancel or terminate an execution

CancelExecution uses ExecutionId; TerminateSchedule uses ProcessId. Follow the recovery guide for identity checks, requests and post-action verification.

These state-changing GET operations belong outside health probes and generic GET retries. Neither recalls output already delivered.

Delete a schedule

Confirm the ID belongs to the disposable schedule you intend to remove. For a single report:

$AtrsDeleteId = [long](Read-Host "Schedule ID selected for deletion")
$AtrsToDelete = Invoke-RestMethod -Method Get `
    -Uri "$AtrsBaseUrl/api/SingleSchedule/Get?Id=$AtrsDeleteId" -Headers $AtrsHeaders -TimeoutSec 30
$AtrsToDelete | Select-Object ScheduleName,UniqueId
if ((Read-Host "Type DELETE to remove this confirmed schedule") -cne "DELETE") { throw "Deletion not requested" }
Invoke-RestMethod -Method Delete -Uri "$AtrsBaseUrl/api/SingleSchedule/Delete?Id=$AtrsDeleteId" `
    -Headers $AtrsHeaders -TimeoutSec 30

Inspect the returned boolean, then independently confirm absence in ATRS and the folder schedule listing. A specific missing-record HTTP status is not assumed. Inspect active executions separately; deletion does not recall delivered reports.

Recover an uncertain outcome

After a timeout during create, clone, edit, deletion or execution, inspect saved state and activity before repeating the operation. Use Monitor, Recover, and Reconcile Executions for execution outcomes.


Did this page help you?