Create a scheduled report
curl --request POST \
--url https://clarus-api.com/api/scheduled_reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "scheduled_reports",
"attributes": {
"name": "Daily Task Report",
"frequency": "Day",
"numbers": [
1,
2,
3,
4,
5,
6,
7
],
"time": "02:00",
"subject": "Daily Task Report",
"body": "Please find the daily task report attached."
},
"relationships": {
"scheduled-report-reports": {
"data": [
{
"attributes": {
"report_id": 1
}
}
]
},
"scheduled-report-recipients": {
"data": [
{
"attributes": {
"email_address": "[email protected]",
"name": "Warehouse Manager"
}
}
]
}
}
}
}
'import requests
url = "https://clarus-api.com/api/scheduled_reports"
payload = { "data": {
"type": "scheduled_reports",
"attributes": {
"name": "Daily Task Report",
"frequency": "Day",
"numbers": [1, 2, 3, 4, 5, 6, 7],
"time": "02:00",
"subject": "Daily Task Report",
"body": "Please find the daily task report attached."
},
"relationships": {
"scheduled-report-reports": { "data": [{ "attributes": { "report_id": 1 } }] },
"scheduled-report-recipients": { "data": [{ "attributes": {
"email_address": "[email protected]",
"name": "Warehouse Manager"
} }] }
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'scheduled_reports',
attributes: {
name: 'Daily Task Report',
frequency: 'Day',
numbers: [1, 2, 3, 4, 5, 6, 7],
time: '02:00',
subject: 'Daily Task Report',
body: JSON.stringify('Please find the daily task report attached.')
},
relationships: {
'scheduled-report-reports': {data: [{attributes: {report_id: 1}}]},
'scheduled-report-recipients': {
data: [
{attributes: {email_address: '[email protected]', name: 'Warehouse Manager'}}
]
}
}
}
})
};
fetch('https://clarus-api.com/api/scheduled_reports', 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": {}
}
]
}Scheduled Reports
Create a scheduled report
Create a new scheduled report that delivers reports via email and/or FTP on a recurring schedule.
POST
/
api
/
scheduled_reports
Create a scheduled report
curl --request POST \
--url https://clarus-api.com/api/scheduled_reports \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "scheduled_reports",
"attributes": {
"name": "Daily Task Report",
"frequency": "Day",
"numbers": [
1,
2,
3,
4,
5,
6,
7
],
"time": "02:00",
"subject": "Daily Task Report",
"body": "Please find the daily task report attached."
},
"relationships": {
"scheduled-report-reports": {
"data": [
{
"attributes": {
"report_id": 1
}
}
]
},
"scheduled-report-recipients": {
"data": [
{
"attributes": {
"email_address": "[email protected]",
"name": "Warehouse Manager"
}
}
]
}
}
}
}
'import requests
url = "https://clarus-api.com/api/scheduled_reports"
payload = { "data": {
"type": "scheduled_reports",
"attributes": {
"name": "Daily Task Report",
"frequency": "Day",
"numbers": [1, 2, 3, 4, 5, 6, 7],
"time": "02:00",
"subject": "Daily Task Report",
"body": "Please find the daily task report attached."
},
"relationships": {
"scheduled-report-reports": { "data": [{ "attributes": { "report_id": 1 } }] },
"scheduled-report-recipients": { "data": [{ "attributes": {
"email_address": "[email protected]",
"name": "Warehouse Manager"
} }] }
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'scheduled_reports',
attributes: {
name: 'Daily Task Report',
frequency: 'Day',
numbers: [1, 2, 3, 4, 5, 6, 7],
time: '02:00',
subject: 'Daily Task Report',
body: JSON.stringify('Please find the daily task report attached.')
},
relationships: {
'scheduled-report-reports': {data: [{attributes: {report_id: 1}}]},
'scheduled-report-recipients': {
data: [
{attributes: {email_address: '[email protected]', name: 'Warehouse Manager'}}
]
}
}
}
})
};
fetch('https://clarus-api.com/api/scheduled_reports', 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": {}
}
]
}Request Structure
Scheduled reports use JSON:API format with embedded relationships:{
"data": {
"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."
},
"relationships": {
"scheduled-report-reports": {
"data": [
{
"attributes": {
"report_id": 1,
"variables": [
{ "name": "date_from", "value": "today 00:00:00" }
]
}
}
]
},
"scheduled-report-recipients": {
"data": [
{
"attributes": {
"email_address": "[email protected]",
"name": "Warehouse Manager"
}
}
]
},
"scheduled-report-ftp-recipients": {
"data": [
{
"attributes": {
"ftp_user_id": 5
}
}
]
}
}
}
}
Key Fields
| Field | Required | Description |
|---|---|---|
name | Yes | Schedule name (max 50 chars) |
frequency | Yes | Day (days of the week) or Month (days of the month) |
numbers | Yes | Array of integers — day numbers when schedule runs |
time | Yes | Time of day to run (e.g., 09:00) |
subject | No | Email subject line (max 256 chars) |
body | No | Email body text |
Frequency & Numbers
Dayfrequency: numbers 1-7 (1 = Monday, 7 = Sunday)Monthfrequency: numbers 1-31 (day of month)
Relationships
Relationship keys use kebab-case in the JSON:APIrelationships object:
| Relationship | Description |
|---|---|
scheduled-report-reports | Reports to generate (each with optional variable overrides) |
scheduled-report-recipients | Email recipients |
scheduled-report-ftp-recipients | FTP destinations |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
Show child attributes
Show child attributes
Response
Scheduled report created successfully
Show child attributes
Show child attributes
⌘I

