Skip to main content
PATCH
/
api
/
scheduled_reports
/
{id}
Update a scheduled report
curl --request PATCH \
  --url https://clarus-api.com/api/scheduled_reports/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "scheduled_reports",
    "attributes": {
      "body": "<string>",
      "name": "<string>",
      "numbers": [
        123
      ],
      "subject": "<string>",
      "time": "<string>"
    },
    "relationships": {
      "scheduled-report-reports": {
        "data": [
          {}
        ]
      },
      "scheduled-report-recipients": {
        "data": [
          {}
        ]
      },
      "scheduled-report-ftp-recipients": {
        "data": [
          {}
        ]
      }
    }
  }
}
'
{
  "data": {
    "id": 123,
    "type": "scheduled_reports",
    "attributes": {
      "name": "Weekly Stock Report",
      "frequency": "Day",
      "numbers": [
        1,
        3,
        5
      ],
      "time": "09:00",
      "subject": "Weekly Stock Report",
      "body": "Please find the weekly stock report attached."
    }
  }
}

Important: Full Replacement

Updates are full replacements for relationships. If you omit a recipient or report from the update, it will be deleted. Always include all desired recipients and reports in the update payload.

Request Structure

{
  "data": {
    "type": "scheduled_reports",
    "attributes": {
      "name": "Updated Weekly Report",
      "time": "10:00"
    },
    "relationships": {
      "scheduled-report-reports": {
        "data": [
          {
            "attributes": {
              "report_id": 1,
              "variables": []
            }
          },
          {
            "attributes": {
              "report_id": 2,
              "variables": []
            }
          }
        ]
      },
      "scheduled-report-recipients": {
        "data": [
          {
            "attributes": {
              "email_address": "[email protected]",
              "name": "Warehouse Manager"
            }
          }
        ]
      }
    }
  }
}

Access Control

Only the scheduled report owner can update it. Returns 403 if the authenticated user is not the owner.

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Path Parameters

id
integer
required

The unique identifier of the scheduled report to update

Body

application/json
data
object
required

Response

Scheduled report updated successfully

data
object