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": [
{}
]
}
}
}
}
'import requests
url = "https://clarus-api.com/api/scheduled_reports/{id}"
payload = { "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": [{}] }
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'scheduled_reports',
attributes: {
body: JSON.stringify('<string>'),
name: '<string>',
numbers: [123],
subject: '<string>',
time: '<string>'
},
relationships: {
'scheduled-report-reports': {data: [{}]},
'scheduled-report-recipients': {data: [{}]},
'scheduled-report-ftp-recipients': {data: [{}]}
}
}
})
};
fetch('https://clarus-api.com/api/scheduled_reports/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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."
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Scheduled Reports
Update a scheduled report
Update an existing scheduled report. Only the owner can update it. Warning: updates are full replacements — omitting a recipient or report from the update payload will delete it.
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": [
{}
]
}
}
}
}
'import requests
url = "https://clarus-api.com/api/scheduled_reports/{id}"
payload = { "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": [{}] }
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'scheduled_reports',
attributes: {
body: JSON.stringify('<string>'),
name: '<string>',
numbers: [123],
subject: '<string>',
time: '<string>'
},
relationships: {
'scheduled-report-reports': {data: [{}]},
'scheduled-report-recipients': {data: [{}]},
'scheduled-report-ftp-recipients': {data: [{}]}
}
}
})
};
fetch('https://clarus-api.com/api/scheduled_reports/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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."
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}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"
}
}
]
}
}
}
}

